/* ==========================================================================
   CastGrade design system — single source of truth.
   Dark "nautical instrument" theme: layered slate surfaces, hairline edges,
   monospace data readouts, semantic good/moderate/poor condition colors.
   Plain CSS, system fonts only, no build step.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Surfaces — deep slate ramp, page → panel → inset */
    --bg-primary: #0b1220;
    --bg-secondary: #121c2f;
    --bg-card: #1c2a44;
    --bg-card-hover: #243353;
    --bg-input: #0d1626;

    /* Hairlines */
    --border: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.32);

    /* Text */
    --text-primary: #eef2f9;
    --text-secondary: #97a5bd;
    --text-muted: #64748b;
    --text-soft: #c7d2e4;          /* long-form reading text */

    /* Accent — CastGrade blue */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-ink: #8ab2f9;         /* accent as legible text on dark */
    --accent-soft: rgba(59, 130, 246, 0.14);

    /* Semantic condition signal: good / moderate / poor */
    --success: #22c55e;
    --success-ink: #4ade80;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #eab308;
    --warning-ink: #facc15;
    --warning-soft: rgba(234, 179, 8, 0.12);
    --danger: #ef4444;
    --danger-ink: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.12);

    /* Type */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

    /* Shape & depth */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 10px 28px -18px rgba(0, 0, 0, 0.6);
    --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 36px -18px rgba(0, 0, 0, 0.65);

    /* Nav */
    --nav-logo-h: 64px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
}

[id] {
    scroll-margin-top: 96px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    /* faint sky-glow at the top of the page — atmosphere, not decoration */
    background-image: radial-gradient(1100px 540px at 50% -200px, rgba(59, 130, 246, 0.12), transparent 65%);
    background-repeat: no-repeat;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(59, 130, 246, 0.35);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

img {
    display: block;
    max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3 {
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-bottom: 0.75rem;
}

h1 { font-size: 1.625rem; font-weight: 700; }
h2 { font-size: 1.1875rem; font-weight: 600; }
h3 { font-size: 1.0625rem; font-weight: 600; }

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

p a,
li a {
    text-decoration-color: rgba(138, 178, 249, 0.4);
    text-underline-offset: 2px;
}

p a:hover,
li a:hover {
    color: var(--text-primary);
}

/* Uppercase letter-spaced instrument label */
.label-micro,
.condition-label,
.best-time-label,
.time-window-date,
.data-section h3 {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* Monospace data readout — coordinates, scores, times */
.readout {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   4. Layout & utilities
   -------------------------------------------------------------------------- */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

.container.wide {
    max-width: 840px;
}

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

.page-head h1 {
    margin-bottom: 0;
}

.page-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 24px;
}

.text-center { text-align: center; }
.capitalize  { text-transform: capitalize; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

.list-spaced {
    color: var(--text-secondary);
    padding-left: 20px;
}

.list-spaced li {
    margin-bottom: 8px;
}

.list-spaced li::marker {
    color: var(--text-muted);
}

.lede {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Centered "or" between alternatives */
.divider-text {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider-text::before,
.divider-text::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(13, 20, 36, 0.88);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.top-nav .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.top-nav .logo img {
    height: var(--nav-logo-h);
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-links form {
    margin: 0;
}

.nav-links a,
.nav-links button {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    min-height: 40px;
    transition: color 0.15s, background-color 0.15s;
}

.nav-links a:hover,
.nav-links button:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-links a.active {
    color: var(--text-primary);
    background: var(--accent-soft);
}

/* Marketing nav sign-up CTA — re-assert button styling over generic nav-link rules */
.nav-links a.btn {
    margin-left: 6px;
    color: #fff;
    background: linear-gradient(180deg, #4a8ef8, #2e6fe3);
}

.nav-links a.btn:hover {
    color: #fff;
    background: linear-gradient(180deg, #4a8ef8, #2e6fe3);
    filter: brightness(1.08);
}

@media (max-width: 540px) {
    .top-nav {
        justify-content: center;
        padding: 6px 10px;
    }
    .top-nav .logo {
        width: 100%;
        justify-content: center;
        padding-bottom: 2px;
    }
    .top-nav .logo img {
        height: 52px;
    }
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    .nav-links a,
    .nav-links button {
        padding: 7px 9px;
        font-size: 0.875rem;
        min-height: 36px;
    }
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    text-align: center;
    padding: 24px 16px 28px;
    margin-top: 48px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer a:hover {
    color: var(--accent-ink);
}

.site-footer .dot {
    margin: 0 10px;
    color: var(--text-muted);
}

/* Footer directly after a full-width band (marketing pages) */
.site-footer.flush {
    margin-top: 0;
    border-top: none;
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #4a8ef8, #2e6fe3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 16px -10px rgba(59, 130, 246, 0.7);
    transition: filter 0.15s, transform 0.06s, background-color 0.15s, border-color 0.15s;
}

.btn:hover {
    filter: brightness(1.08);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}

.btn-secondary:hover {
    filter: none;
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.btn-danger {
    background: linear-gradient(180deg, #f05252, #dc2626);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.9rem;
    min-height: 38px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 30px;
    font-size: 1.0625rem;
    min-height: 52px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-group .btn {
    flex: 1;
}

.btn-group form {
    flex: 1;
    display: flex;
}

/* Google OAuth button — Google brand guidelines want it light */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    min-height: 48px;
    background: #fff;
    color: #1f2937;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s;
}

.btn-google:hover {
    filter: brightness(0.95);
}

.btn-google svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.label-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: -2px 0 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    min-height: 46px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="datetime-local"] {
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2397a5bd' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* Multi-select chips (tides, wind directions) */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    min-height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.checkbox-group label:hover {
    border-color: var(--accent);
}

.checkbox-group input[type="checkbox"] {
    display: none;
}

.checkbox-group label:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px var(--accent);
}

@media (max-width: 420px) {
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Compass directions are short — keep the 4-across instrument row */
    .checkbox-group.wind {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------------------------------------------------------------
   9. Alerts
   -------------------------------------------------------------------------- */
.error {
    color: var(--danger-ink);
    background: var(--danger-soft);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    font-size: 0.95rem;
}

.alert-success {
    color: var(--success-ink);
    background: var(--success-soft);
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.45);
}

.alert-success p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   10. Cards & tags
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}

/* Small uppercase card heading ("Preferences", "Upcoming Tides") */
.card > .label-micro {
    display: block;
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   11. Spots
   -------------------------------------------------------------------------- */
.spot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spot-card {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.spot-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-raised);
}

.spot-card h3 {
    margin-bottom: 2px;
}

.coords,
.coords-display {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.coords-display {
    text-align: center;
    margin-top: 2px;
}

.spot-card .prefs {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   12. Rankings & conditions
   -------------------------------------------------------------------------- */
.ranking-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.ranking-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ranking-title strong {
    font-size: 1.0625rem;
}

.ranking-rank {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
}

.ranking-score {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent-ink);
    text-align: right;
}

.ranking-score .label-micro {
    display: block;
    text-align: right;
}

.score-good { color: var(--success-ink); }
.score-moderate { color: var(--warning-ink); }
.score-poor { color: var(--danger-ink); }

.ranking-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.condition-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
}

.condition-item:has(.condition-good)     { border-left-color: var(--success); }
.condition-item:has(.condition-moderate) { border-left-color: var(--warning); }
.condition-item:has(.condition-poor)     { border-left-color: var(--danger); }

.condition-value {
    font-size: 0.9375rem;
    font-weight: 500;
    margin-top: 2px;
}

.condition-good { color: var(--success-ink); }
.condition-moderate { color: var(--warning-ink); }
.condition-poor { color: var(--danger-ink); }

.best-time {
    background: var(--success-soft);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    margin-top: 12px;
}

.best-time-label {
    color: var(--success-ink);
}

.best-time-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.0625rem;
    font-weight: 600;
    margin-top: 3px;
}

.ranking-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.time-window {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.time-window-hours {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.1875rem;
    font-weight: 600;
    color: var(--accent-ink);
    margin-top: 4px;
}

@media (max-width: 400px) {
    .conditions-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   13. Stepper (session duration)
   -------------------------------------------------------------------------- */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 6px 0;
}

.stepper-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, border-color 0.15s, transform 0.06s;
}

.stepper-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.stepper-btn:active {
    transform: scale(0.94);
}

.stepper-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.5rem;
    font-weight: 600;
    min-width: 76px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   14. Tide & weather readouts, data sections, map, empty state
   -------------------------------------------------------------------------- */
.data-section {
    margin-top: 16px;
}

.data-section h3 {
    margin-bottom: 10px;
}

.tide-list,
.weather-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tide-item,
.weather-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.tide-time,
.weather-time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    font-weight: 500;
}

.tide-type {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.tide-type.high { color: var(--accent-ink); }
.tide-type.low  { color: var(--warning-ink); }

#map {
    width: 100%;
    height: 320px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    margin-bottom: 10px;
}

.map-small {
    height: 200px;
}

.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--text-muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state .btn {
    margin-top: 18px;
}

/* --------------------------------------------------------------------------
   15. Guide
   -------------------------------------------------------------------------- */
.toc {
    list-style: none;
    counter-reset: toc;
}

.toc li {
    counter-increment: toc;
    margin-bottom: 8px;
}

.toc li::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 12px;
}

.toc a {
    color: var(--accent-ink);
    text-decoration: none;
    font-weight: 500;
}

.toc a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-content,
.placeholder-text {
    display: block;
    color: var(--text-soft);
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    line-height: 1.65;
    font-size: 0.95rem;
}

.guide-content p {
    margin: 0;
}

.guide-content ul,
.placeholder-text ul {
    margin: 12px 0 0;
    padding-left: 20px;
}

.guide-content li,
.placeholder-text li {
    margin-bottom: 6px;
}

.guide-content li::marker,
.placeholder-text li::marker {
    color: var(--text-muted);
}

.location-section,
.lure-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.location-section:first-of-type,
.lure-section:first-of-type {
    margin-top: 14px;
    padding-top: 0;
    border-top: none;
}

.lure-locations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   16. Long-form prose (privacy, etc.)
   -------------------------------------------------------------------------- */
.prose section {
    margin-bottom: 28px;
}

.prose h2 {
    margin-bottom: 10px;
}

.prose p {
    color: var(--text-soft);
    margin-bottom: 10px;
}

.prose ul {
    color: var(--text-soft);
    padding-left: 20px;
    margin-bottom: 10px;
}

.prose li {
    margin-bottom: 6px;
}

.prose li::marker {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   17. Marketing — hero, sections, features, steps, CTA
   -------------------------------------------------------------------------- */
.hero {
    text-align: center;
    padding: 64px 24px 84px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2.1rem, 6vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin-bottom: 18px;
}

.hero h1 span {
    color: var(--accent-ink);
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 32px;
}

.section {
    padding: 72px 24px;
}

.band {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.section-inner.narrow {
    max-width: 760px;
}

.section-title {
    text-align: center;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin-bottom: 44px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    margin-bottom: 14px;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* In-app "What we track" grid */
.track-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 400px) {
    .track-grid {
        grid-template-columns: 1fr;
    }
}

.feature-item {
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 2px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1rem;
}

.step-content h3 {
    font-size: 1.0625rem;
    margin-bottom: 4px;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.cta {
    text-align: center;
    padding: 72px 24px;
}

.cta h2 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.cta p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 28px;
}

/* Inline CTA panel (end of public guide) */
.cta-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-top: 40px;
    padding: 48px 24px;
}

@media (max-width: 600px) {
    .hero {
        padding: 44px 20px 60px;
    }
    .section,
    .cta {
        padding: 52px 20px;
    }
    .section-title,
    .cta h2 {
        font-size: 1.45rem;
    }
}

/* --------------------------------------------------------------------------
   18. Auth (login / register)
   -------------------------------------------------------------------------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    min-height: 100vh;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 26px 24px;
    box-shadow: var(--shadow-raised);
}

.auth-logo {
    display: block;
    margin: 0 auto 22px;
    height: 88px;
    width: auto;
}

.auth-alt {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-alt a {
    color: var(--accent-ink);
    text-decoration: none;
    font-weight: 500;
}

.auth-alt a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--accent-ink);
}

.auth-footer .dot {
    margin: 0 10px;
    color: var(--text-muted);
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 22px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ==========================================================================
   19. Main-branch components — tag filtering, spot sharing, loading states,
   and page-level classes from templates that predate the redesign.
   Appended onto the approved system; built entirely from its tokens.
   ========================================================================== */

/* --- Free-form spot tags (location labels, distinct from preference tags) -- */
.spot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.spot-card .spot-tags {
    margin: 10px 0 0;
}

.spot-tag {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: var(--accent-ink);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* --- Tag filter chips (spot list, rankings, best-times) -------------------- */
.tag-filter {
    margin-bottom: 16px;
}

.tag-filter form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    min-height: 38px;
    border-radius: 999px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tag-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.tag-chip input[type="checkbox"] {
    display: none;
}

.tag-chip-active,
.tag-chip:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.tag-chip-clear {
    background: transparent;
    border-style: dashed;
    color: var(--text-muted);
}

.tag-chip-clear:hover {
    border-color: var(--danger);
    color: var(--danger-ink);
}

/* Preference tags must stay clearly legible on card backgrounds */
.tag {
    color: var(--text-soft);
    border-color: var(--border-strong);
}

/* --- Hint text below an input ---------------------------------------------- */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Loading spinner + HTMX request indicator ------------------------------- */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 0.15s;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Spinner sits at the right edge of a button without shifting its label */
.btn {
    position: relative;
}

.btn .loading-spinner {
    position: absolute;
    right: 14px;
}

/* --- Paste Spot Details (spot-code sharing) --------------------------------- */
.paste-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.paste-row input {
    flex: 1;
}

.paste-feedback {
    display: none;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* --- Marketing pages using pre-redesign class names -------------------------- */
.nav-links a.register {
    margin-left: 6px;
    color: #fff;
    font-weight: 600;
    background: linear-gradient(180deg, #4a8ef8, #2e6fe3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 16px -10px rgba(59, 130, 246, 0.7);
}

.nav-links a.register:hover {
    color: #fff;
    background: linear-gradient(180deg, #4a8ef8, #2e6fe3);
    filter: brightness(1.08);
}

/* Current-page marker on the public guide nav */
.nav-links a.guide-link {
    color: var(--text-primary);
    background: var(--accent-soft);
}

.hero-cta,
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 30px;
    min-height: 52px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #4a8ef8, #2e6fe3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 16px -10px rgba(59, 130, 246, 0.7);
    transition: filter 0.15s, transform 0.06s;
}

.hero-cta:hover,
.cta-button:hover {
    filter: brightness(1.08);
}

.hero-cta:active,
.cta-button:active {
    transform: translateY(1px);
}

.features {
    padding: 72px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.features-container {
    max-width: 1000px;
    margin: 0 auto;
}

.features h2,
.how-it-works h2 {
    text-align: center;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin-bottom: 44px;
}

.how-it-works {
    padding: 72px 24px;
    max-width: 808px;
    margin: 0 auto;
}

/* Emoji icons inside the feature tile */
.feature-icon {
    font-size: 1.375rem;
}

.guide-public-container {
    max-width: 840px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

@media (max-width: 600px) {
    .features,
    .how-it-works {
        padding: 52px 20px;
    }
    .features h2,
    .how-it-works h2 {
        font-size: 1.45rem;
    }
}

/* --- Auth pages using pre-redesign class names -------------------------------- */
body.page-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    min-height: 100vh;
}

.register-link,
.login-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.register-link a,
.login-link a {
    color: var(--accent-ink);
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover,
.login-link a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Utilities ---------------------------------------------------------------- */
.mb-0 {
    margin-bottom: 0;
}
