/* Theme tokens. Light is the default; dark is applied via the OS preference.
   Explicit media-query values (rather than CSS light-dark()) keep colours
   deterministic across browsers. */
:root {
    color-scheme: light dark;

    --bg: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --surface: #f9fafb;
    --accent: #1d4ed8;
    --danger: #c8102e;
    --danger-bg: #fef2f2;
    --success: #15803d;
    --btn: #111827;
    --on-btn: #ffffff;
    --dashed: #d1d5db;
    --shadow-1: rgba(0, 0, 0, 0.06);
    --shadow-2: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #09090b;
        --text: #f9fafb;
        --muted: #a1a1aa;
        --border: #27272a;
        --surface: #18181b;
        --accent: #60a5fa;
        --danger: #f87171;
        --danger-bg: #27181b;
        --success: #4ade80;
        --btn: #f9fafb;
        --on-btn: #111827;
        --dashed: #3f3f46;
        --shadow-1: rgba(0, 0, 0, 0.4);
        --shadow-2: rgba(0, 0, 0, 0.35);
    }
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win. Several components set an explicit
   `display` (e.g. `.field`/`.loc-card` are `display: flex`), which otherwise
   beats the UA `[hidden] { display: none }` rule and leaves a "hidden" field or
   the empty location card still rendered. Force it. */
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    transition: background-color 160ms ease, color 160ms ease;
}

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

select, input, textarea, button { font-family: inherit; }
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
/* Keep native dropdown popups legible in both themes. */
option { background-color: var(--surface); color: var(--text); }

/* Layout — a single centred card, mobile first. */
.support {
    min-height: 100vh;
    display: flex;
    justify-content: center;
}
.support__card {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    padding: 0 0 40px;
}

/* Desktop — the card floats as a bordered, elevated panel rather than a
   stranded column against a wide blank background. Mobile stays edge-to-edge. */
@media (min-width: 600px) {
    .support {
        align-items: flex-start;
        padding: 48px 24px;
    }
    .support__card {
        border: 1px solid var(--border);
        border-radius: 20px;
        background: var(--bg);
        box-shadow:
            0 1px 3px var(--shadow-1),
            0 12px 28px var(--shadow-2);
        padding-bottom: 28px;
    }
    .support__topbar { border-radius: 20px 20px 0 0; }
}

/* Sticky top bar — the brand header and the step progress bar stay pinned
   while the form scrolls underneath. */
.support__topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

/* Header — brand + step badge. */
.support__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 16px;
}
.brand { display: flex; flex-direction: column; }
.brand__name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand__tagline { font-size: 12px; color: var(--muted); }
.step-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    padding: 5px 11px;
    white-space: nowrap;
}

/* Three-segment progress bar. */
.progress-bars {
    display: flex;
    gap: 4px;
    padding: 0 20px 20px;
}
.progress-bars__seg {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.3s;
}
.progress-bars__seg.filled { background: var(--accent); }

/* Panels — one per step. */
.panel {
    padding: 20px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.panel[hidden] { display: none; }
.panel--centered { padding: 24px 20px 0; }

/* Form fields. */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}
.field__hint { font-size: 12.5px; color: var(--muted); }
.field__error {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--danger);
}

.control {
    width: 100%;
    min-height: 44px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 15px;
}
.control--area {
    min-height: 96px;
    resize: vertical;
}
.field--invalid .control { border-color: var(--danger); }

/* QR-pinned location card. */
.loc-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
}
.loc-card__flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}
.loc-card__flag svg { display: block; width: 100%; height: 100%; }
.loc-card__text { display: flex; flex-direction: column; min-width: 0; }
.loc-card__city { font-size: 14.5px; font-weight: 600; color: var(--text); }
.loc-card__site { font-size: 13px; color: var(--muted); }
.loc-card__chevron { margin-left: auto; font-size: 11px; color: var(--muted); }
.loc-card__select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
}

/* Attachment drop zone. */
.dropzone__input { display: none; }
.dropzone {
    border: 1px dashed var(--dashed);
    background: var(--surface);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
}
.dropzone:hover { border-color: var(--muted); }

/* Inline notice banner (validation / submit errors). */
.notice {
    border: 1px solid var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13.5px;
    font-weight: 500;
}

/* Buttons. */
.btn {
    border-radius: 10px;
    padding: 0 15px;
    font-weight: 600;
    cursor: pointer;
}
.btn--primary {
    background: var(--btn);
    color: var(--on-btn);
    border: none;
    min-height: 48px;
    font-size: 15px;
}
.btn--primary:hover { opacity: 0.9; }
.btn--primary:active { opacity: 0.8; }
.btn--ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    min-height: 44px;
    font-size: 14.5px;
}
.btn--ghost:hover { border-color: var(--muted); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* Step 2 — sending. */
.panel__title { margin: 0; font-size: 17px; font-weight: 600; }
.progress-track {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}
.progress-track__fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
    width: 0;
    transition: width 0.18s linear;
}
.progress-label { font-size: 13px; color: var(--muted); }

/* Step 3 — success. */
.success-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}
.success-card__badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-size: 14px;
    font-weight: 600;
}
.success-card__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.success-card__title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.success-card__lead { margin: 0; font-size: 14px; color: var(--muted); }
.success-card__ref {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-family: ui-monospace, Menlo, monospace;
    word-break: break-all;
    color: var(--text);
}
.success-card__note { margin: 0; font-size: 13px; color: var(--muted); }
