/* Same palette as the sibling Bad Marine apps (Driver's Report / CrashDiagram.Showcase) - one
   dark-cyan house look across all three, per Sean 2026-08-30. --surface and --surface-2 both
   resolve to the same panel tone (Driver's Report doesn't distinguish a second elevated tone
   either - it leans on border color alone); kept as two variables so nothing downstream needed
   touching. --danger/--danger-bg stay true red rather than the house's amber --warn: the 911 gate
   is a genuine "stop, active danger" alarm, a different signal than Driver's Report's amber
   reversible-undo convention, which this app has no equivalent of. */
:root {
    --bg: #08090b;
    --surface: #16181d;
    --surface-2: #16181d;
    --line: #2a2d34;
    --text: #eef0f3;
    --muted: #9aa0ac;
    --accent: #33c7f5;
    --accent-glow: #7fe3ff;
    --accent-ink: #04222c;
    --accent-2: #2dd4a0;
    --warn: #f2994a;
    --warn-glow: #ffb673;
    --danger: #e5484d;
    --danger-bg: #3a1416;
    --ok: #2dd4a0;
    --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

h1 { font-size: 1.4rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
p { margin: .5rem 0; }
a { color: var(--accent-glow); }
a:hover { color: var(--accent); }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 96px; }

.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.site-header .brand {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.08rem;
    letter-spacing: .02em;
    white-space: nowrap;
    line-height: 1;
}
.site-header .brand:hover { color: var(--accent-glow); }
.site-header a { text-decoration: none; color: var(--text); }
.header-right { display: flex; align-items: center; gap: 14px; flex: none; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-toggle button {
    background: transparent; color: var(--muted); border: 0; padding: 4px 9px;
    font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.lang-toggle button.on { background: var(--accent); color: var(--accent-ink); }

/* Same 30px circular icon-button footprint as Driver's Report's header controls. -danger uses
   --warn (not --danger/red) to match that app's own convention of amber for a reversible action -
   wiping a draft is undoable in effect but not a "someone/something is in danger" signal. */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.icon-btn-danger { color: var(--warn); }
.icon-btn-danger:hover { color: var(--warn-glow); border-color: var(--warn); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 0;
}

.choice {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin: 10px 0;
    color: var(--text);
    cursor: pointer;
}
.choice:hover, .choice:focus-visible { border-color: var(--accent); outline: none; }
.choice .choice-title { font-weight: 600; margin-bottom: 4px; }
.choice .choice-blurb { color: var(--muted); font-size: .92rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
/* Amber, not --danger/red - matches Driver's Report's own .ndp-btn-danger convention (used for
   this same "wipe everything" confirm there): a destructive-but-deliberate action the reporter
   chose, not a "something is actively wrong" alarm. --danger/red stays reserved for the 911 gate. */
.btn-danger { background: rgba(242, 153, 74, .16); color: var(--warn-glow); border-color: var(--warn); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }

label, .field-label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], textarea, select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
    color-scheme: dark; /* dark-render any remaining native <select> popups */
}
textarea { min-height: 90px; resize: vertical; }
select option { background: var(--surface-2); color: var(--text); }
select optgroup { background: var(--surface-2); color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; margin-top: 4px; }

.linklike {
    background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
    color: var(--accent-glow); cursor: pointer; text-decoration: underline;
}
.linklike:hover { color: var(--accent); }

.toggle { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; }
.toggle input { margin-top: 3px; }

/* Compact checkbox field (Details step: "also notify the sheriff") */
.field-check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; }
.field-check > input { flex: none; margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); }
.field-check .fc-title { margin: 0; font-weight: 600; }
.field-check .hint { margin-top: 2px; }

/* Segmented control — 2-3 mutually exclusive choices (Location step: road type) */
.segmented { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 6px 0; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented label {
    flex: 1; margin: 0; text-align: center; padding: 10px 8px; font-weight: 600;
    font-size: .92rem; color: var(--muted); cursor: pointer; border-left: 1px solid var(--line);
}
.segmented label:first-of-type { border-left: 0; }
.segmented input:checked + label { background: var(--accent); color: var(--accent-ink); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent-glow); outline-offset: -2px; }

/* Radio pill group — short single-select lists (Details step: blocking / condition) */
.radio-group { display: flex; flex-direction: column; gap: 5px; margin: 6px 0; }
.radio-pill {
    display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
    color: var(--text); font-weight: 500; font-size: .94rem; cursor: pointer;
}
.radio-pill input { flex: none; margin: 0; accent-color: var(--accent); }
.radio-pill:hover { border-color: var(--accent); }
.radio-pill.on { border-color: var(--accent); background: rgba(51, 199, 245, .1); }

/* Themed select — custom accessible dropdown for long grouped lists (Details step: "what is it") */
.tselect { position: relative; margin: 6px 0; }
.tselect-trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
    color: var(--text); font: inherit; padding: 10px 12px; text-align: left; cursor: pointer;
}
.tselect.open .tselect-trigger, .tselect-trigger:focus-visible { border-color: var(--accent); outline: none; }
.tselect-placeholder { color: var(--muted); }
.tselect-caret { flex: none; color: var(--muted); transition: transform .12s ease; }
.tselect.open .tselect-caret { transform: rotate(180deg); }
.tselect-backdrop { position: fixed; inset: 0; z-index: 40; }
.tselect-panel {
    position: absolute; z-index: 41; top: calc(100% + 4px); left: 0; right: 0;
    max-height: min(320px, 55vh); overflow-y: auto; margin: 0; padding: 4px;
    list-style: none; background: var(--surface); border: 1px solid var(--accent);
    border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}
.tselect-group {
    padding: 8px 10px 4px; color: var(--muted); font-size: .74rem;
    text-transform: uppercase; letter-spacing: .05em;
}
.tselect-opt { padding: 9px 10px; border-radius: 8px; font-size: .95rem; cursor: pointer; }
.tselect-opt:hover { background: rgba(51, 199, 245, .08); }
.tselect-opt.active { background: rgba(51, 199, 245, .16); }
.tselect-opt[aria-selected="true"] { color: var(--accent-glow); font-weight: 700; }

/* Compact inline alert banner (Location step: municipal redirect) */
.banner {
    display: flex; align-items: flex-start; gap: 10px; margin: 12px 0;
    border-radius: 10px; padding: 10px 12px; font-size: .9rem; line-height: 1.45;
}
.banner-warn { background: rgba(242, 153, 74, .1); border: 1px solid var(--warn); color: var(--text); }
.banner .b-icon { flex: none; }
.banner .b-body { flex: 1; min-width: 0; }
.banner .b-body strong { color: #fff; }
.banner .b-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.banner .b-actions a, .banner .b-actions .linklike { color: var(--warn-glow); }
.banner .b-actions a:hover, .banner .b-actions .linklike:hover { color: var(--warn); }
.b-dismiss {
    flex: none; appearance: none; -webkit-appearance: none;
    background: none; border: 0; padding: 2px 6px; margin: -2px -4px 0 0;
    color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.b-dismiss:hover { color: var(--text); }

/* Location action row: "Use my location" + the "Don't know your location?" link */
.loc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }
.loc-actions .btn { flex: 1 1 auto; min-width: 170px; }

/* Compact one-line location badge (Location step: resolved coords / place) */
.meta-chip {
    display: flex; align-items: baseline; gap: 7px;
    background: rgba(51, 199, 245, .08); border: 1px solid var(--line);
    border-radius: 10px; padding: 6px 11px; margin: 10px 0;
    font-size: .82rem; white-space: nowrap; overflow: hidden;
}
.meta-chip code {
    flex: none; color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem;
}
.meta-chip .m-sep { flex: none; color: var(--muted); }
.meta-chip .m-ellip { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

/* Routing summary card (Review step) */
.summary .kv { display: flex; gap: 12px; margin: 0; padding: 8px 0; border-top: 1px solid var(--line); }
.summary .kv:first-child { border-top: 0; padding-top: 0; }
.summary .kv:last-child { padding-bottom: 0; }
.summary .kv .k { flex: none; width: 90px; padding-top: 1px; color: var(--muted); font-size: .85rem; }
.summary .kv .v { flex: 1; min-width: 0; font-weight: 600; word-break: break-word; }

/* Email payload preview (Review step) */
.code-card { margin: 10px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0d0f13; }
.code-card .code-head {
    padding: 8px 12px; border-bottom: 1px solid var(--line);
    color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em;
}
.code-card pre {
    margin: 0; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem; line-height: 1.5; color: var(--text);
}

.btn-sm { min-height: 38px; padding: 7px 12px; font-size: .86rem; }
.btn-cta { min-height: 54px; font-size: 1rem; }

.map { height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

.alert-911 {
    background: var(--danger-bg);
    border: 1px solid #5a2023;
    color: #ffd7d8;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin: 12px 0;
    font-weight: 600;
}

.notice {
    background: rgba(242, 153, 74, .1);
    border: 1px solid var(--warn);
    color: var(--text);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin: 12px 0;
}
.notice strong { color: #fff; }
.notice a { color: var(--warn-glow); }

.pill { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .82rem; color: var(--muted); }

.stepper { display: flex; gap: 6px; margin: 12px 0 4px; }
.stepper .dot { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.stepper .dot.done { background: var(--accent); }

.kv { margin: 6px 0; }
.kv .k { color: var(--muted); font-size: .85rem; }
.kv .v { font-weight: 600; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-grid figure { margin: 0; position: relative; }
.photo-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-grid button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 6px; padding: 2px 6px; cursor: pointer; }

/* ---- overlay / modal (911 gate, wipe confirm) ---- */
.overlay {
    /* Above Leaflet's internal panes/controls (which climb to z-index ~1000) so a modal opened
       on the Location step isn't punched through by the map. */
    position: fixed; inset: 0; z-index: 1500;
    background: rgba(4, 7, 10, .78);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    max-width: 460px;
    width: 100%;
}
.modal ul { padding-left: 18px; }
.modal li { margin: 6px 0; }

/* ---- Blazor boilerplate ---- */
.loading-progress { position: relative; display: block; width: 8rem; height: 8rem; margin: 20vh auto 1rem; }
.loading-progress circle { fill: none; stroke: var(--line); stroke-width: .5rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--accent); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; transition: stroke-dasharray .05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-weight: bold; inset: calc(20vh + 3.25rem) 0 auto 0; color: var(--muted); }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

#blazor-error-ui {
    background: #2b1416; color: #ffd7d8; bottom: 0; display: none;
    left: 0; padding: 10px 14px; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }

/* Pre-boot crawlable text in index.html's #app, below the absolutely-positioned spinner;
   Blazor replaces it on first render. */
.rr-static-landing {
    max-width: 720px;
    margin: 0 auto;
    padding: calc(20vh + 10rem) 16px 48px;
    color: var(--muted);
}

.rr-static-landing h1 { font-size: 1.6rem; line-height: 1.25; color: var(--text); }
