/* ==========================================================================
   AUTUMN TWILIGHT — global design system
   Place this file at: wwwroot/css/autumn-twilight.css
   Then reference it from your app shell's <head>:
     Blazor WASM  -> wwwroot/index.html
     Blazor Server-> Components/App.razor (or Pages/_Host.cshtml on older templates)
   <link rel="stylesheet" href="css/autumn-twilight.css" />

   This file is intentionally NOT component-scoped (no .razor.css) because it
   needs to apply to every page. Page components add their own *.razor.css
   for elements unique to that page only.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    /* base palette */
    --void: #07070b;
    --ash: #121017;
    --ash-line: #221f29;
    --bone: #cdc7bc;
    --bone-dim: #8b8579;
    --ember: #ff5a3c;
    --ember-dim: #7a2c1e;
    /* faction chromatics */
    --f-cinder: #d63d2e;
    --f-verdant: #3f8f5f;
    --f-storm: #3a6ea5;
    --f-frost: #cfd3d6;
    --f-ashveil: #7d5aa6;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--void);
    color: var(--bone);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------------- shared type helpers ---------------- */

.at-eyebrow,
.at-section-eyebrow,
.at-tag,
.at-flag,
.at-mono {
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.at-display,
.at-section-title,
.at-hero-title {
    font-family: 'Cormorant', serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--bone);
}

/* ---------------- header / nav (used by MainLayout) ---------------- */

.at-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(7, 7, 11, 0.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ash-line);
}

.at-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.at-logo-mark {
    color: var(--ember);
}

.at-logo-accent {
    color: var(--ember);
}

.at-nav-toggle-input {
    display: none;
}

.at-nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    cursor: pointer;
}

    .at-nav-toggle span {
        width: 20px;
        height: 2px;
        background: var(--bone);
        display: block;
    }

.at-nav {
    position: fixed;
    top: 53px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    background: var(--void);
    border-bottom: 1px solid var(--ash-line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

    .at-nav a {
        padding: 14px 18px;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--ash-line);
    }

.at-nav-toggle-input:checked ~ .at-nav {
    max-height: 420px;
}

.at-nav-cta {
    color: var(--ember) !important;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem !important;
    letter-spacing: 0.05em;
}

.at-nav a.at-nav-active {
    color: var(--ember);
}

    .at-nav a.at-nav-active::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--ember);
        margin-right: 8px;
        vertical-align: middle;
    }

@media (min-width: 720px) {
    .at-nav a.at-nav-active::before {
        display: none;
    }

    .at-nav a.at-nav-active {
        border-bottom: 2px solid var(--ember);
    }
}

/* ---------------- buttons ---------------- */

.at-btn {
    display: inline-block;
    padding: 14px 22px;
    border-radius: 2px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.at-btn-primary {
    background: var(--ember);
    color: var(--void);
}

.at-btn-ghost {
    border-color: var(--ash-line);
    color: var(--bone);
    background: transparent;
}

.at-btn-block {
    display: block;
    width: 100%;
}

/* ---------------- generic section scaffolding ---------------- */

.at-section {
    padding: 56px 20px;
    max-width: 720px;
    margin: 0 auto;
}

.at-section-dark {
    background: var(--ash);
    border-top: 1px solid var(--ash-line);
    border-bottom: 1px solid var(--ash-line);
}

.at-section-full {
    max-width: none;
}

.at-section-eyebrow {
    font-size: 0.7rem;
    color: var(--ember);
    margin: 0 0 12px;
}

.at-section-title {
    font-size: 1.9rem;
    margin: 0 0 14px;
}

.at-section-lede {
    color: var(--bone-dim);
    max-width: 42ch;
    margin: 0 0 32px;
}

/* ---------------- chips (reused across pages) ---------------- */

.at-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.at-chip {
    display: inline-block;
    background: var(--void);
    border: 1px solid var(--ash-line);
    color: var(--bone);
    font-size: 0.78rem;
    padding: 7px 13px;
    border-radius: 999px;
}

.at-chip-ghost {
    background: transparent;
    color: var(--bone-dim);
    font-size: 0.72rem;
    padding: 6px 12px;
}

.at-chip-active {
    background: var(--ember);
    border-color: var(--ember);
    color: var(--void);
    font-weight: 600;
}

.at-subgroup-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bone-dim);
    margin: 22px 0 10px;
}

/* ---------------- footer ---------------- */

.at-footer {
    padding: 32px 20px 40px;
    border-top: 1px solid var(--ash-line);
    text-align: center;
}

.at-footer-logo {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.at-footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--bone-dim);
}

.at-footer-copy {
    font-size: 0.72rem;
    color: var(--bone-dim);
    margin: 0;
}

/* ---------------- form fields (login, join, feedback) ---------------- */

.at-field {
    background: var(--ash);
    border: 1px solid var(--ash-line);
    color: var(--bone);
    padding: 14px 16px;
    border-radius: 2px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

    .at-field::placeholder {
        color: var(--bone-dim);
    }

.at-field-label {
    display: block;
    font-size: 0.72rem;
    color: var(--bone-dim);
    margin-bottom: 6px;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.04em;
}

/* ---------------- page hero meta wrapper (shared small header block) ---------------- */

.at-page-hero {
    padding: 48px 20px 36px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

    .at-page-hero .at-hero-title {
        font-size: 2.2rem;
        margin: 0 0 12px;
    }

    .at-page-hero .at-hero-sub {
        color: var(--bone-dim);
        max-width: 42ch;
        margin: 0 auto;
    }

/* ---------------- auth (Login.razor + Register.razor) ----------------
   Moved here from the old Login.razor.css because Login and Register are
   now two separate component files (Blazor CSS isolation means a scoped
   .razor.css only applies to its own component) — see Login.razor's
   header comment for why they had to split. The old radio/tab CSS is
   gone since there's no in-page tab toggle anymore, just a link between
   the two pages. */

.at-auth-section {
    max-width: 420px;
}

.at-auth-card {
    background: var(--ash);
    border: 1px solid var(--ash-line);
    border-radius: 2px;
    padding: 26px 22px;
}

.at-field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.at-field-otp {
    letter-spacing: 0.5em;
    text-align: center;
    font-size: 1.2rem;
}

.at-auth-forgot {
    display: block;
    align-self: flex-end;
    text-align: right;
    font-size: 0.78rem;
    color: var(--bone-dim);
    margin: -10px 0 16px;
}

.at-auth-note {
    font-size: 0.78rem;
    color: var(--bone-dim);
    margin: 4px 0 0;
    line-height: 1.5;
}

.at-auth-note-center {
    text-align: center;
    margin-top: 20px;
}

.at-auth-inline-link {
    color: var(--ember);
    font-weight: 500;
    cursor: pointer;
}

.at-auth-error {
    color: var(--f-cinder);
    font-size: 0.8rem;
    margin: 0 0 14px;
}

.at-auth-info {
    color: var(--f-verdant);
    font-size: 0.85rem;
    margin: 0 0 16px;
    line-height: 1.5;
}

.at-auth-meta {
    margin-top: 24px;
    text-align: center;
}

.at-chip-row-center {
    justify-content: center;
}

.at-nav-user {
    color: var(--bone-dim);
    font-size: 0.72rem;
    padding: 8px 14px;
    white-space: nowrap;
}

.at-nav-logout-form {
    display: inline-block;
}

.at-nav-logout-btn {
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font: inherit;
}

@media (min-width: 720px) {
    .at-nav-toggle {
        display: none;
    }

    .at-nav {
        position: static;
        flex-direction: row;
        max-height: none;
        overflow: visible;
        background: transparent;
        border-bottom: none;
        gap: 4px;
    }

        .at-nav a {
            border-bottom: none;
            padding: 8px 14px;
        }

    .at-section {
        max-width: 960px;
    }

    .at-page-hero {
        padding: 76px 20px 56px;
    }

        .at-page-hero .at-hero-title {
            font-size: 3rem;
        }
}

/* ---------------- reduced motion + focus ---------------- */

@media (prefers-reduced-motion: reduce) {
    .at-nav {
        transition: none;
    }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-visible {
    outline: 2px solid var(--ember);
    outline-offset: 2px;
}

[tabindex="-1"]:focus {
    outline: none;
}
