/* ==========================================================================
   Snappass — "Sealed dossier" theme
   Self-hosted, no external font/CDN requests by design (this page handles
   secrets — nothing here should leak the visitor's IP to a third party).
   ========================================================================== */

:root {
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Fira Code", Menlo, Consolas, "Liberation Mono", monospace;

    --radius: 10px;
    --radius-sm: 6px;

    --bg: #0C0E11;
    --bg-grain: #101318;
    --panel: #15181D;
    --border: #262B33;
    --border-strong: #333A44;
    --text: #E7E9EC;
    --text-muted: #8B93A0;
    --accent: #C1382F;
    --accent-strong: #D9483D;
    --accent-text: #FFF5F3;
    --accent-wash: rgba(193, 56, 47, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html {
    position: relative;
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% -10%, var(--bg-grain), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* -- Top bar --------------------------------------------------------- */

.topbar {
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 18px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
}

.wordmark:hover { color: var(--text); }

.wordmark-seal {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

.topbar-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.lang-toggle:hover { color: var(--accent); border-color: var(--border-strong); }
.lang-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* -- Page / dossier card ---------------------------------------------- */

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

.dossier {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 40px 36px;
}

.dossier-center {
    text-align: center;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.eyebrow::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 8px;
    background: var(--accent);
    border-radius: 1px;
    vertical-align: middle;
}

.eyebrow-sealed, .eyebrow-revealed { color: var(--accent); }

.dossier-title {
    font-family: var(--font-body);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 28px;
    color: var(--text);
}

/* -- Document-style fields --------------------------------------------- */

.field { margin-bottom: 20px; }

.field-document {
    position: relative;
}

.document-input {
    display: block;
    width: 100%;
    resize: vertical;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text);
}

.document-input::placeholder { color: var(--text-muted); }

.document-input:focus,
.document-input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

.field-inline {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.document-input-inline {
    flex: 1;
    resize: none;
    white-space: nowrap;
    overflow-x: auto;
}

textarea.document-input-inline { white-space: pre-wrap; }

.btn-copy {
    flex: 0 0 auto;
    width: 46px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-copy:hover { color: var(--accent); border-color: var(--accent); }
.btn-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.field-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
}

.field-tag-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.field-tag-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235B626D'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 32px 8px 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

.field-tag-select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

/* -- Seal button (signature element) ----------------------------------- */

.btn-seal {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 22px;
    background: var(--accent);
    color: var(--accent-text);
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transform: scale(1) rotate(0deg);
    transition: transform 0.12s ease, background 0.15s ease;
}

.btn-seal:hover { background: var(--accent-strong); }
.btn-seal:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-seal-stamp {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-text);
    opacity: 0.85;
}

.btn-seal-lg {
    padding: 16px 30px;
    font-size: 15.5px;
}

.btn-seal.is-sealing {
    animation: seal-press 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes seal-press {
    0%   { transform: scale(1) rotate(0deg); }
    35%  { transform: scale(0.9) rotate(-3deg); }
    60%  { transform: scale(1.06) rotate(1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .btn-seal.is-sealing { animation: none; }
}

/* -- Burn note ----------------------------------------------------------- */

.burn-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
    margin: 20px 0 0;
}

.burn-note-line {
    flex: 0 0 22px;
    height: 0;
    border-top: 1px dashed var(--border-strong);
}

/* -- Void stamp (expired page) -------------------------------------------- */

.void-stamp {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    transform: rotate(-6deg);
    margin: 0 0 20px;
}

/* -- Misc / legacy hooks kept for compatibility ------------------------- */

.break-word { word-wrap: break-word; }
.margin-bottom-10 { margin-bottom: 10px; }
input[readonly].readonly-text { background-color: var(--panel); cursor: text; }

@media (max-width: 520px) {
    .dossier { padding: 28px 22px 26px; }
    .field-row { flex-direction: column; align-items: stretch; }
    .btn-seal { justify-content: center; }
}
