/* Shared typography, shell and basic controls. */
@font-face {
    font-family: "Inter Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Fraunces Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/geist-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/geist-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/geist-mono-latin-600-normal.woff2") format("woff2");
}

/* ── Page ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
/* An element marked hidden stays hidden, whatever display its class gives it. */
[hidden] { display: none !important; }
body {
    margin: 0;
    background: var(--theme-clay-surface);
    color: var(--theme-text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--theme-link); text-underline-offset: 0.22em; }
a:hover { color: var(--theme-text-strong); }
:focus-visible { outline: 2px solid var(--theme-focus-ring); outline-offset: 2px; }
h1, h2 {
    margin: 0;
    color: var(--theme-text-strong);
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.15;
    font-optical-sizing: auto;
    text-wrap: balance;
}
h1 { font-size: 30px; }
h2 { font-size: 20px; line-height: 1.2; }
p { margin: 0; }
.portal-shell {
    width: 100%;
    max-width: 1040px;
    min-height: 100svh;
    margin-inline: auto;
    padding: 28px 32px 48px;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
.muted { color: var(--theme-text-muted); }
.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    z-index: 20;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-control);
    background: var(--theme-clay-surface);
    box-shadow: var(--shadow-raised-sm);
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* ── Header ───────────────────────────────────────────────────────────── */

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}
.site-home { display: block; flex-shrink: 0; border-radius: var(--radius-control); }
.site-logo { height: 60px; width: auto; display: block; }
.site-logo__mark { fill: var(--theme-text-strong); }
.site-logo__tick { stroke: var(--theme-accent); }
.site-logo__word { fill: var(--theme-text-strong); font-family: var(--font-display); }
.site-logo__tag { fill: var(--theme-text-muted); font-family: var(--font-mono); font-weight: 500; }
.header-nav { display: flex; align-items: center; gap: 14px 22px; font-size: 14px; color: var(--theme-text-muted); }
.header-nav a { text-decoration: none; font-weight: 500; }
.header-nav a:hover { text-decoration: underline; }
.card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-raised);
}
.card > .button { align-self: flex-start; }
.eyebrow {
    color: var(--theme-text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.text-link { align-self: flex-start; font-size: 14px; font-weight: 500; }

/* ── Buttons ──────────────────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-control);
    background: none;
    color: var(--theme-text-strong);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-raised-sm);
    transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.button:hover { color: var(--theme-text-strong); }
.button:active { box-shadow: var(--shadow-sunken); }
.button--primary { background: var(--theme-button-surface); color: var(--theme-button-text); box-shadow: var(--shadow-accent); }
.button--primary:hover { background: var(--theme-button-surface-hover); color: var(--theme-button-text); }
.button--primary:active { box-shadow: var(--shadow-accent); }
.button:disabled {
    background: none;
    color: var(--theme-text-muted);
    box-shadow: inset 0 0 0 1px var(--theme-clay-shadow);
    cursor: not-allowed;
    opacity: 0.75;
}
/* A form being sent disables its button; that is a wait, not a refusal, so it keeps its colour. */
form[aria-busy="true"] .button:disabled { cursor: wait; }
form[aria-busy="true"] .button--primary:disabled {
    background: var(--theme-button-surface);
    color: var(--theme-button-text);
    box-shadow: var(--shadow-accent);
}

.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field label { color: var(--theme-text); font-size: 14px; font-weight: 500; }
.form-field input {
    width: 100%;
    min-height: 46px;
    padding: 11px 16px;
    border: 0;
    border-radius: var(--radius-control);
    background: var(--theme-clay-surface);
    color: var(--theme-text);
    font: inherit;
    font-size: 15px;
    box-shadow: var(--shadow-sunken);
}
/* The ring is a shadow; the transparent outline is what forced colours paint instead, where shadows vanish. */
.form-field input:focus { outline: 2px solid transparent; box-shadow: var(--shadow-sunken), 0 0 0 2px var(--theme-focus-ring); }
.form-field input[aria-invalid="true"] { box-shadow: var(--shadow-sunken), 0 0 0 1px var(--theme-danger); }
.form-field input[aria-invalid="true"]:focus { box-shadow: var(--shadow-sunken), 0 0 0 2px var(--theme-danger); }
.field-errors { color: var(--theme-danger); font-size: 14px; }
.field-errors p + p { margin-top: 4px; }
.field-hint, .form-note, .panel-note { color: var(--theme-text-muted); font-size: 13px; }
.submission-status { color: var(--theme-text-muted); font-size: 13px; }
.submission-status:empty { display: none; }

.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-well);
    box-shadow: var(--shadow-sunken);
    font-size: 14px;
}
.notice::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: var(--radius-pill);
    background: currentColor;
}
.notice--refusal { background: var(--theme-notice-refusal-surface); color: var(--theme-notice-refusal-text); }
.notice--refusal::before { background: var(--theme-notice-refusal-dot); }

.auth-layout { display: flex; flex-direction: column; align-items: center; gap: 24px; padding-top: 8px; }
.auth-panel { width: 100%; max-width: 460px; }
.auth-panel form { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.auth-panel .form-field { align-self: stretch; }
.auth-intro { color: var(--theme-text-muted); }

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    padding-top: 28px;
    color: var(--theme-text-muted);
    font-size: 13px;
}

@media (max-width: 760px) {
    .header-nav { flex: 1; justify-content: flex-end; min-width: 0; }
}
@media (max-width: 560px) {
    .portal-shell { padding: 16px 16px 32px; }
    .site-logo { height: 52px; }
    .card { padding: 20px; gap: 20px; }
    /* Prevent auto-zoom on iOS when a field receives focus. */
    .form-field input { font-size: max(16px, 1rem); }
    .card > .button, .auth-panel form .button { align-self: stretch; }
}
@media (forced-colors: active) {
    .card, .notice { border: 1px solid CanvasText; }
    .button, .form-field input { border: 1px solid ButtonText; }
    .button:disabled { border-color: GrayText; color: GrayText; }
    :root .notice::before { forced-color-adjust: none; background: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
