/* =========================================================================
   ArcaSearch Forms — UI system
   "Quiet precision": a calm, refined, professional surface. Subtle depth,
   hairline borders, confident accent, snappy micro-interactions.
   ========================================================================= */

:root {
    /* Neutrals — cool slate */
    --bg:          #eef1f6;
    --bg-tint:     #e7ecf4;
    --surface:     #ffffff;
    --surface-2:   #f7f9fc;
    --surface-3:   #f1f4f9;

    --ink:         #0f1729;   /* primary text */
    --ink-2:       #3f4a5e;   /* secondary text */
    --muted:       #64708a;   /* tertiary / captions */
    --faint:       #94a0b8;   /* placeholders, disabled */

    --line:        #e4e9f1;   /* hairline */
    --line-2:      #d4dbe7;   /* stronger divider */

    /* Brand — confident cobalt */
    --brand:       #2a50e0;
    --brand-strong:#1f3fc4;
    --brand-ink:   #1b369c;
    --brand-tint:  #eef2ff;
    --brand-glow:  rgba(42, 80, 224, .16);

    /* Status */
    --ok:          #0f7a52;
    --ok-bg:       #e7f7ef;
    --ok-line:     #b7e7cf;
    --warn:        #9a5a09;
    --warn-bg:     #fdf4e3;
    --warn-line:   #f3dca6;
    --err:         #c0322b;
    --err-bg:      #fdeceb;
    --err-line:    #f4c5c1;

    /* Radii */
    --r-sm: 9px;
    --r:    13px;
    --r-lg: 18px;
    --r-xl: 24px;

    /* Shadows — soft, slightly cool, layered */
    --shadow-xs: 0 1px 1px rgba(15,23,42,.04);
    --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.05);
    --shadow:    0 2px 4px -1px rgba(15,23,42,.05), 0 6px 16px -6px rgba(15,23,42,.10);
    --shadow-md: 0 4px 10px -3px rgba(15,23,42,.08), 0 14px 32px -12px rgba(15,23,42,.16);
    --shadow-lg: 0 8px 20px -6px rgba(15,23,42,.12), 0 28px 60px -20px rgba(15,23,42,.24);
    --ring:      0 0 0 3px var(--brand-glow);

    --t:    150ms cubic-bezier(.4, 0, .2, 1);
    --t-sm: 110ms cubic-bezier(.4, 0, .2, 1);

    --font-ui:   "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-head: "Schibsted Grotesk", var(--font-ui);
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv05" 1, "ss01" 1;
}

/* Atmospheric background — a faint cool mesh anchored to the top.
   Fixed so it stays put while content scrolls. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1100px 520px at 18% -8%, #ffffff 0%, rgba(255,255,255,0) 60%),
        radial-gradient(900px 480px at 102% 0%, var(--bg-tint) 0%, rgba(231,236,244,0) 55%),
        linear-gradient(180deg, #f3f6fb 0%, var(--bg) 38%);
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color var(--t-sm);
}
a:hover { color: var(--brand-strong); }

/* Inline content links get an animated underline (not nav/buttons). */
.card a:not(.btn):not(.badge),
.public-intro a, p a {
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1.5px;
    transition: background-size var(--t), color var(--t-sm);
}
.card a:not(.btn):not(.badge):hover,
.public-intro a:hover, p a:hover {
    background-size: 100% 1.5px;
    text-decoration: none;
}

.container {
    max-width: 940px;
    margin: 0 auto;
    padding: 34px 22px 72px;
}

/* ---------------------------------------------------------------- Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.04rem;
    letter-spacing: -.012em;
    color: var(--ink);
    padding: 15px 0;
}
.topbar .brand:hover { color: var(--ink); }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(150deg, var(--brand) 0%, #4f74ff 100%);
    color: #fff;
    font-size: .92rem;
    font-weight: 800;
    box-shadow: 0 2px 6px -1px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav a {
    position: relative;
    color: var(--muted);
    font-weight: 500;
    font-size: .94rem;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    transition: color var(--t-sm), background var(--t-sm);
}
.topbar nav a:hover { color: var(--ink); background: var(--surface-3); }
.topbar nav a.is-active { color: var(--brand-ink); background: var(--brand-tint); }
.topbar nav .logout-form { margin: 0 0 0 6px; }
.topbar nav .logout-form::before {
    content: "";
    align-self: stretch;
    border-left: 1px solid var(--line-2);
    margin: 10px 8px 10px 2px;
}

/* ---------------------------------------------------------------- Cards */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: 26px 28px;
    margin-bottom: 22px;
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.center { text-align: center; }

/* ---------------------------------------------------------------- Type */
h1, h2, h3 {
    font-family: var(--font-head);
    letter-spacing: -.02em;
    color: var(--ink);
    line-height: 1.2;
}
h1 { font-size: 1.62rem; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 1.18rem; font-weight: 650; margin: 0 0 14px; }
.subtitle { color: var(--muted); margin-top: 0; font-size: 1rem; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.page-head h1 { margin: 0; }

/* ---------------------------------------------------------------- Forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 7px; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: .82rem; font-weight: 400; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=tel], select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    font-size: .98rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--t-sm), box-shadow var(--t-sm), background var(--t-sm);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 116px; resize: vertical; line-height: 1.5; }

select {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 38px;
    cursor: pointer;
}

input:hover, select:hover, textarea:hover { border-color: #b9c3d4; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--ring);
    background: var(--surface);
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
    font-weight: 400;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--t-sm), background var(--t-sm);
}
.choice:hover { border-color: #c4cedd; background: var(--surface-2); }
.choice:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-tint);
}
.choice input { width: auto; margin-top: 3px; accent-color: var(--brand); flex: none; }

.code-input {
    letter-spacing: .5em;
    text-align: center;
    font-size: 1.6rem;
    font-family: var(--font-mono);
    padding: 14px;
}

/* ---------------------------------------------------------------- Buttons */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--brand);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    padding: 11px 19px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.1;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.18);
    transition: background var(--t-sm), box-shadow var(--t), transform var(--t-sm);
}
button:hover, .btn:hover {
    background: var(--brand-strong);
    text-decoration: none;
    box-shadow: 0 4px 12px -2px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.18);
    transform: translateY(-1px);
}
button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-secondary {
    background: var(--surface);
    color: var(--ink-2);
    border-color: var(--line-2);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--surface-2);
    color: var(--ink);
    border-color: #c4cedd;
    box-shadow: var(--shadow-sm);
}
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #a52823; box-shadow: 0 4px 12px -2px rgba(192,50,43,.28); }
.btn-sm { padding: 7px 13px; font-size: .85rem; border-radius: 8px; }

.linklike {
    background: none; border: none; color: var(--muted); font-weight: 500;
    padding: 8px 12px; cursor: pointer; font-size: .94rem; border-radius: var(--r-sm);
    box-shadow: none;
}
.linklike:hover { color: var(--ink); background: var(--surface-3); box-shadow: none; transform: none; }

.actions { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.actions form { margin: 0; }

/* ---------------------------------------------------------------- Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
}
/* When a table sits directly in a card, drop the redundant frame */
.card > .table-wrap { border: none; border-radius: 0; }
.card > .table-wrap { margin: -4px 0; }

table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-2);
}
thead th:first-child { border-top-left-radius: var(--r); }
thead th:last-child  { border-top-right-radius: var(--r); }
tbody tr { transition: background var(--t-sm); }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td a { font-weight: 600; }

/* ---------------------------------------------------------------- Flash / alerts */
.flash {
    position: relative;
    padding: 13px 16px 13px 44px;
    border-radius: var(--r-sm);
    margin-bottom: 22px;
    font-size: .94rem;
    font-weight: 500;
    border: 1px solid transparent;
    box-shadow: var(--shadow-xs);
}
.flash::before {
    content: "";
    position: absolute;
    left: 15px; top: 50%;
    width: 18px; height: 18px;
    transform: translateY(-50%);
    background: currentColor;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-size: contain; mask-size: contain;
}
.flash-info    { background: var(--brand-tint); color: var(--brand-ink); border-color: #d7e0ff; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.flash-warning { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.flash-error   { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.flash-success::before { -webkit-mask-image: var(--ico-check); mask-image: var(--ico-check); }
.flash-error::before, .flash-warning::before { -webkit-mask-image: var(--ico-alert); mask-image: var(--ico-alert); }
.flash-info::before { -webkit-mask-image: var(--ico-info); mask-image: var(--ico-info); }

.alert-error {
    background: var(--err-bg);
    color: var(--err);
    border: 1px solid var(--err-line);
    padding: 13px 16px;
    border-radius: var(--r-sm);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: .94rem;
}
.field-error { color: var(--err); font-size: .84rem; font-weight: 500; margin-top: 6px; }
.field input:focus.has-error { border-color: var(--err); }

:root {
    --ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --ico-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4m0 4h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3C/svg%3E");
    --ico-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4m0-4h.01'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px 4px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 650;
    letter-spacing: .005em;
    border: 1px solid transparent;
    line-height: 1;
}
.badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}
.badge-active   { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-disabled { background: var(--surface-3); color: var(--muted); border-color: var(--line-2); }

/* ---------------------------------------------------------------- Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
}
.stat .stat-label {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    color: var(--muted);
}
.stat .stat-value {
    font-family: var(--font-head);
    font-size: 1.85rem;
    font-weight: 750;
    letter-spacing: -.02em;
    color: var(--ink);
    line-height: 1.1;
    margin-top: 4px;
}
.stat .stat-value .stat-unit { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat .stat-value { font-size: 1.55rem; }
}

/* ---------------------------------------------------------------- Empty state */
.empty-state { text-align: center; padding: 40px 24px; }
.empty-state .empty-icon {
    width: 46px; height: 46px;
    margin: 0 auto 14px;
    display: grid; place-items: center;
    border-radius: 13px;
    background: var(--brand-tint);
    color: var(--brand);
}
.empty-state .empty-icon svg { width: 24px; height: 24px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }

/* ---------------------------------------------------------------- Utilities */
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .86rem; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- Copy row */
.copy-row { display: flex; gap: 9px; }
.copy-row input {
    font-family: var(--font-mono);
    font-size: .86rem;
    background: var(--surface-2);
    color: var(--ink-2);
}
.copy-row input:focus { background: var(--surface); }
.copy-row .btn { flex: none; }

/* ---------------------------------------------------------------- Error page */
.error-code {
    font-family: var(--font-head);
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -.03em;
    margin: 0 0 4px;
    background: linear-gradient(150deg, var(--brand) 0%, #5a7bff 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.error-message { font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-top: 0; }
.error-detail {
    text-align: left;
    background: #0c1426;
    color: #cdd7ea;
    padding: 16px;
    border-radius: var(--r-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: .8rem;
    line-height: 1.55;
}

/* ---------------------------------------------------------------- 2FA / enroll */
.qr {
    display: flex;
    justify-content: center;
    margin: 22px 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-xs);
}
.qr svg { width: 208px; height: 208px; display: block; }
.secret {
    font-family: var(--font-mono);
    font-size: .92rem;
    background: var(--surface-3);
    border: 1px solid var(--line);
    padding: 9px 14px;
    border-radius: var(--r-sm);
    word-break: break-all;
    display: inline-block;
    color: var(--ink-2);
}

/* ---------------------------------------------------------------- Question builder */
.q-row {
    background: var(--surface-2) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r) !important;
    box-shadow: none !important;
}
.q-top { display: flex; gap: 11px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.q-top .q-label { flex: 1 1 240px; }
.q-top .q-type { flex: 0 0 auto; width: auto; }
.q-required-wrap { white-space: nowrap; margin: 0; font-weight: 500; align-self: stretch; }
.q-options-wrap { margin-bottom: 12px; }
.q-controls { justify-content: flex-end; }

/* ---------------------------------------------------------------- Answers list */
dl.answers { margin: 0; display: grid; gap: 2px; }
dl.answers dt { font-weight: 650; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 18px; }
dl.answers dt:first-child { margin-top: 0; }
dl.answers dd { margin: 4px 0 0; color: var(--ink); font-size: 1rem; }

/* ---------------------------------------------------------------- Public form */
body.public .container { max-width: 660px; }
body.public { background: var(--bg); }
.public-intro { margin-bottom: 26px; }
.public-intro h1 { font-size: 1.78rem; }
.public-intro .subtitle { margin-top: 8px; line-height: 1.6; }

/* Accent bar across the top of the public form card */
body.public .container > .card:first-of-type::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: var(--r) var(--r) 0 0;
    background: linear-gradient(90deg, var(--brand) 0%, #5a7bff 60%, #7d97ff 100%);
}
body.public .card { padding-top: 30px; }

.thankyou { text-align: center; padding: 44px 28px; }
.thankyou h1 { font-size: 1.9rem; }
.required-star { color: var(--err); font-weight: 700; }

/* ---------------------------------------------------------------- Survey wizard */
/* No-JS fallback: steps just stack (default block flow). The classes below only
   take effect once form.js adds .is-wizard, so the form always works without JS. */
.survey-form { margin-top: 2px; }

#form-steps.is-wizard > [data-step] { display: none; }
#form-steps.is-wizard > [data-step].is-active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 304px;
    animation: stepIn 400ms cubic-bezier(.16, .8, .26, 1) both;
}
@keyframes stepIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Focused, oversized question in wizard mode */
#form-steps.is-wizard .field { margin-bottom: 0; }
#form-steps.is-wizard .field > label {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -.018em;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 20px;
}
#form-steps.is-wizard .field > label .hint { font-size: .92rem; font-weight: 400; }
#form-steps.is-wizard input[type=text],
#form-steps.is-wizard input[type=email],
#form-steps.is-wizard input[type=password],
#form-steps.is-wizard input[type=number],
#form-steps.is-wizard input[type=tel] {
    font-size: 1.08rem;
    padding: 13px 15px;
}
#form-steps.is-wizard textarea { min-height: 132px; font-size: 1.04rem; }
#form-steps.is-wizard .choice { padding: 13px 16px; font-size: 1.04rem; margin: 9px 0; }

/* End / submit step */
.form-step--end { text-align: center; }
.form-step--end .end-title {
    font-family: var(--font-head);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 8px;
}
.form-step--end .end-note { margin: 0 auto 24px; max-width: 40ch; }
.form-step--end .actions { justify-content: center; }
.btn-lg { padding: 14px 28px; font-size: 1.04rem; border-radius: var(--r-sm); }

/* Progress bar */
.form-progress { display: flex; align-items: center; gap: 14px; margin: 6px 0 28px; }
.form-progress__track {
    flex: 1;
    height: 6px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
}
.form-progress__bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #5a7bff);
    transition: width 440ms cubic-bezier(.16, .8, .26, 1);
}
.form-progress__label {
    font-size: .78rem;
    font-weight: 650;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

/* Nav row */
.form-nav { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.form-nav__spacer { flex: 1; }
.form-hint { font-size: .78rem; color: var(--faint); white-space: nowrap; }
.form-next, .form-back { min-width: 96px; }

@media (max-width: 640px) {
    .form-hint { display: none; }
    #form-steps.is-wizard .field > label { font-size: 1.3rem; }
    #form-steps.is-wizard > [data-step].is-active { min-height: 240px; }
    .form-next, .form-back { min-width: 84px; }
}

/* ---------------------------------------------------------------- Footer */
.site-footer {
    text-align: center;
    color: var(--faint);
    font-size: .82rem;
    padding: 28px 20px 36px;
}
.site-footer a { color: var(--muted); }

/* ---------------------------------------------------------------- Motion */
@media (prefers-reduced-motion: no-preference) {
    .container > .card,
    .container > .page-head,
    main.container > .flash {
        animation: rise 460ms cubic-bezier(.16, .8, .26, 1) both;
    }
    .container > .page-head { animation-delay: 20ms; }
    .container > .card:nth-of-type(1) { animation-delay: 60ms; }
    .container > .card:nth-of-type(2) { animation-delay: 130ms; }
    .container > .card:nth-of-type(3) { animation-delay: 200ms; }
    .container > .card:nth-of-type(4) { animation-delay: 270ms; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 640px) {
    .container { padding: 24px 16px 56px; }
    .topbar { padding: 0 16px; }
    .topbar nav { gap: 0; }
    .topbar nav a { padding: 8px 9px; font-size: .88rem; }
    .card { padding: 20px 18px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    h1 { font-size: 1.42rem; }
}
