/* =========================================================================
   Apex Lawyers — public verification page
   Same design system as the internal portal (portal_html/assets/style.css)
   — glass as a metaphor for verification/transparency, one seal mark,
   everything else disciplined. See that file for the fuller rationale;
   kept as a separate file because the two subdomains are on separate
   document roots with no shared static-asset path on this hosting.
   No external font loading — see the portal stylesheet for why (CSP +
   a real data-protection reason for a law firm specifically).
   ========================================================================= */

:root {
    color-scheme: light;
    --bg: #EEF1F5;
    --bg-mesh-a: rgba(11, 27, 51, 0.05);
    --bg-mesh-b: rgba(176, 141, 79, 0.06);
    --surface: rgba(255, 255, 255, 0.62);
    --surface-solid: #FFFFFF;
    --surface-raised: rgba(255, 255, 255, 0.82);
    --border: rgba(11, 27, 51, 0.10);
    --border-strong: rgba(11, 27, 51, 0.18);
    --text: #10192B;
    --text-muted: #4B5568;
    --text-faint: #8390A3;
    --navy: #0B1B33;
    --gold: #9C7A3F;
    --gold-soft: rgba(156, 122, 63, 0.14);
    --gold-strong: #7C6130;
    --success: #276B50;
    --success-bg: rgba(39, 107, 80, 0.11);
    --danger: #8C3B3B;
    --danger-bg: rgba(140, 59, 59, 0.11);
    --warn: #8A5D1E;
    --warn-bg: rgba(138, 93, 30, 0.13);
    --shadow-glass: 0 12px 40px rgba(16, 25, 43, 0.10), 0 2px 6px rgba(16, 25, 43, 0.06);
    --shadow-pop: 0 18px 50px rgba(16, 25, 43, 0.16);
    --blur: 20px;
    --radius-lg: 18px;
    --radius-sm: 8px;
    --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0A1120;
    --bg-mesh-a: rgba(156, 122, 63, 0.07);
    --bg-mesh-b: rgba(90, 130, 190, 0.08);
    --surface: rgba(22, 32, 54, 0.58);
    --surface-solid: #131D33;
    --surface-raised: rgba(28, 40, 66, 0.85);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #E8EDF6;
    --text-muted: #9AA7C2;
    --text-faint: #6B7794;
    --gold: #CBA968;
    --gold-soft: rgba(203, 169, 104, 0.16);
    --gold-strong: #E4C78C;
    --success: #6BC6A0;
    --success-bg: rgba(107, 198, 160, 0.14);
    --danger: #E29999;
    --danger-bg: rgba(226, 153, 153, 0.14);
    --warn: #E0BC7A;
    --warn-bg: rgba(224, 188, 122, 0.14);
    --shadow-glass: 0 12px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-pop: 0 20px 60px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0A1120;
        --bg-mesh-a: rgba(156, 122, 63, 0.07);
        --bg-mesh-b: rgba(90, 130, 190, 0.08);
        --surface: rgba(22, 32, 54, 0.58);
        --surface-solid: #131D33;
        --surface-raised: rgba(28, 40, 66, 0.85);
        --border: rgba(255, 255, 255, 0.09);
        --border-strong: rgba(255, 255, 255, 0.16);
        --text: #E8EDF6;
        --text-muted: #9AA7C2;
        --text-faint: #6B7794;
        --gold: #CBA968;
        --gold-soft: rgba(203, 169, 104, 0.16);
        --gold-strong: #E4C78C;
        --success: #6BC6A0;
        --success-bg: rgba(107, 198, 160, 0.14);
        --danger: #E29999;
        --danger-bg: rgba(226, 153, 153, 0.14);
        --warn: #E0BC7A;
        --warn-bg: rgba(224, 188, 122, 0.14);
        --shadow-glass: 0 12px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
        --shadow-pop: 0 20px 60px rgba(0, 0, 0, 0.55);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text);
    background:
        radial-gradient(60rem 40rem at 8% -10%, var(--bg-mesh-a), transparent 60%),
        radial-gradient(50rem 40rem at 110% 10%, var(--bg-mesh-b), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; letter-spacing: -0.01em; color: var(--text); margin: 0 0 0.5rem; }
a { color: var(--gold-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

header.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: var(--surface-raised);
    backdrop-filter: blur(var(--blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}
.seal { width: 28px; height: 28px; flex-shrink: 0; color: var(--gold); }
.subtitle { color: var(--text-muted); font-size: 0.85rem; margin-left: 0.35rem; }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
}
.theme-toggle:hover { color: var(--gold-strong); border-color: var(--border-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

main.container { max-width: 500px; margin: 3rem auto; padding: 0 1.25rem; flex: 1; width: 100%; }

.card {
    background: var(--surface);
    backdrop-filter: blur(var(--blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-glass);
}

label { display: block; font-size: 0.83rem; font-weight: 500; color: var(--text-muted); margin: 1.1rem 0 0.35rem; }

input[type="text"], input[type="date"] {
    width: 100%;
    padding: 0.62rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
    font-family: var(--font-body);
    background: var(--surface-solid);
    color: var(--text);
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }

button.btn {
    margin-top: 1.6rem;
    width: 100%;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 0.72rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
button.btn:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); }
:root[data-theme="dark"] button.btn { background: var(--gold); color: #0A1120; }

.alert { padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 1rem; border: 1px solid transparent; display: flex; align-items: center; gap: 0.55rem; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }

.muted { color: var(--text-muted); font-size: 0.85rem; }

table.result-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-variant-numeric: tabular-nums; }
table.result-table td { padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.result-table td:first-child { color: var(--text-muted); width: 40%; }

.status-pill { display: inline-block; padding: 0.18rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.status-active { background: var(--success-bg); color: var(--success); }
.status-revoked { background: var(--danger-bg); color: var(--danger); }
.status-expired { background: var(--warn-bg); color: var(--warn); }

.view-links { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface-solid);
}
.btn-link:hover { border-color: var(--gold); color: var(--gold-strong); text-decoration: none; }

footer.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-faint);
    font-size: 0.8rem;
}

.card-mt { margin-top: 1.5rem; }
.mt-tight { margin-top: 0.6rem; }

.cf-turnstile { margin: 1rem 0 0.5rem; }

button.btn.btn-sm {
    width: auto;
    margin-top: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    font-size: 0.85rem;
}
button.btn.button-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    width: auto;
}
:root[data-theme="dark"] button.btn.button-secondary { background: var(--surface); color: var(--text); }
button.btn.button-secondary:hover { border-color: var(--gold); color: var(--gold-strong); box-shadow: none; transform: none; }

/* QR scan panel — modal overlay, same glass surface language as the
   rest of this page. Purely a convenience UI: it only ever fills the
   two fields above, never submits anything itself. */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(8, 13, 24, 0.55);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
}
.modal {
    background: var(--surface-raised);
    backdrop-filter: blur(var(--blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: 1.75rem;
    max-width: 440px;
    width: 100%;
}
.modal h2 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--text); }
