/* ═══════════════════════════════════════════════════════════════════
   app.css  —  Prentzas FM  |  Senior CSS  |  Production Grade
   ─────────────────────────────────────────────────────────────────
   Table of contents
   1.  Design Tokens (custom properties)
   2.  Reset & Base
   3.  Typography
   4.  Body background & grain
   5.  Site shell
   6.  Header & navigation
   7.  Page layout & containers
   8.  Cards
   9.  Hero / auth panel
   10. Forms — labels, inputs, helpers
   11. Password strength meter
   12. Buttons
   13. Alerts
   14. Auth & account page specifics
   15. Stat boxes
   16. Divider
   17. Utility classes
   18. Accessibility
   19. Reduced-motion
   20. Responsive  — 1100 → 420px
═══════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════
   1. DESIGN TOKENS
═══════════════════════════════════════════════════════════════════ */
:root {
    /* Surfaces */
    --bg:               #050505;
    --bg-soft:          #0c0c0e;
    --panel:            rgba(17, 17, 22, 0.90);
    --panel-strong:     rgba(22, 22, 28, 0.97);
    --panel-soft:       rgba(255, 255, 255, 0.032);
    --glass:            rgba(255, 255, 255, 0.038);
    --glass-hover:      rgba(255, 255, 255, 0.055);

    /* Borders */
    --border:           rgba(255, 75, 75, 0.17);
    --border-strong:    rgba(255, 75, 75, 0.36);
    --border-soft:      rgba(255, 255, 255, 0.09);
    --border-focus:     rgba(255, 59, 59, 0.55);

    /* Text */
    --text:             #f2f4f8;
    --text-strong:      #ffffff;
    --muted:            rgba(235, 237, 245, 0.62);
    --muted-strong:     rgba(235, 237, 245, 0.84);
    --faint:            rgba(255, 255, 255, 0.30);

    /* Brand palette */
    --accent:           #ff3b3b;
    --accent-deep:      #c00000;
    --accent-mid:       #e02020;
    --accent-light:     #ff7a7a;
    --accent-faint:     rgba(255, 59, 59, 0.08);
    --accent-faint-2:   rgba(255, 59, 59, 0.14);

    /* Semantic */
    --success:          #28c76f;
    --success-bg:       rgba(40, 199, 111, 0.10);
    --success-border:   rgba(40, 199, 111, 0.28);
    --warning:          #ffb020;
    --danger:           #ff5c5c;
    --danger-bg:        rgba(255, 92, 92, 0.10);
    --danger-border:    rgba(255, 92, 92, 0.28);
    --info:             #40a9ff;

    /* Shadows */
    --shadow:           0 24px 64px rgba(0, 0, 0, 0.38);
    --shadow-soft:      0 10px 32px rgba(0, 0, 0, 0.22);
    --shadow-glow:      0 0 48px rgba(255, 59, 59, 0.14);
    --shadow-btn:       0 12px 28px rgba(179, 0, 0, 0.30);

    /* Shape */
    --radius:           24px;
    --radius-lg:        28px;
    --radius-md:        18px;
    --radius-sm:        13px;
    --radius-xs:        9px;
    --radius-pill:      999px;

    /* Layout */
    --container:        1180px;
    --header-height:    84px;
    --header-height-sm: 68px;  /* shrunk state */

    /* Inputs */
    --input-height:     56px;
    --input-height-sm:  48px;

    /* Motion */
    --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out:      cubic-bezier(0.4, 0, 0.2, 1);
    --transition:       0.22s var(--ease-in-out);
    --transition-slow:  0.38s var(--ease-out);
}


/* ═══════════════════════════════════════════════════════════════════
   2. RESET & BASE
═══════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
    /* Prevent iOS bounce causing white flash */
    overscroll-behavior: none;
    /* Prevent CLS from scrollbar appearing */
    scrollbar-gutter: stable;
}

body {
    min-height: 100dvh;    /* dvh = dynamic viewport height — fixes mobile address-bar issue */
    color: var(--text);
    font-family: 'DM Sans', 'Helvetica Neue', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent text size inflation on mobile rotation */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Kill grey tap flash on iOS */
    -webkit-tap-highlight-color: transparent;
    background:
        radial-gradient(ellipse 70% 50% at 0% 0%,    rgba(255, 0, 0, 0.17)   0%, transparent 55%),
        radial-gradient(ellipse 55% 40% at 100% 0%,  rgba(255, 80, 80, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255, 59, 59, 0.07) 0%, transparent 50%),
        linear-gradient(160deg, #020202 0%, #09090b 42%, #111116 100%);
}

/* Ambient grain overlay — gives depth, not noise */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0.028;
    /* Both prefixed and unprefixed for cross-browser */
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
    mask-image:         radial-gradient(ellipse at center, black 40%, transparent 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg, video {
    max-width: 100%;
    display: block;
}

/* Inherit font for all interactive elements */
button, input, textarea, select, optgroup {
    font: inherit;
    color: inherit;
}

/* Remove default list styles when used decoratively */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}


/* ═══════════════════════════════════════════════════════════════════
   3. TYPOGRAPHY
═══════════════════════════════════════════════════════════════════ */

/* Import from index.php's $extraHead or standalone */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,300&display=swap');

h1, h2, h3, h4 {
    color: var(--text-strong);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

p { max-width: 72ch; }


/* ═══════════════════════════════════════════════════════════════════
   4. SITE SHELL
═══════════════════════════════════════════════════════════════════ */
.site-shell {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
}


/* ═══════════════════════════════════════════════════════════════════
   5. HEADER & NAVIGATION
═══════════════════════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Promote to its own compositor layer for smooth blur */
    will-change: backdrop-filter, box-shadow;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    background: rgba(5, 5, 7, 0.84);
    border-bottom: 1px solid rgba(255, 75, 75, 0.13);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.20);
    transition: min-height var(--transition), background var(--transition), box-shadow var(--transition);
}

/* Scroll-shrink state — toggled by header.php JS */
.site-header.is-scrolled {
    background: rgba(4, 4, 6, 0.96);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
    border-bottom-color: rgba(255, 75, 75, 0.20);
}

.site-header.is-scrolled .site-header__inner {
    min-height: var(--header-height-sm);
    padding-block: 10px;
}

.site-header.is-scrolled .brand img {
    width: 46px;
    height: 46px;
}

.site-header__inner {
    position: relative;
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
    min-height: var(--header-height);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding-block: 14px;
    transition: min-height var(--transition), padding var(--transition);
}

/* ── Brand ──────────────────────────────────────────────────────── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
}

.brand__logo-wrap { flex-shrink: 0; }

.brand img {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    object-fit: cover;
    background: #140707;
    border: 1px solid rgba(255, 75, 75, 0.30);
    padding: 7px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
    transition: width var(--transition), height var(--transition), border-radius var(--transition);
}

.brand__copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.brand strong {
    display: block;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Hamburger toggle ───────────────────────────────────────────── */
.site-nav-toggle {
    display: none;              /* shown at ≤ 860px via media query */
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--glass);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
    /* Ensure reliable hit target on mobile */
    touch-action: manipulation;
}

.site-nav-toggle:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 75, 75, 0.22);
}

.site-nav-toggle:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 3px;
}

.site-nav-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--text-strong);
    transform-origin: center;
    transition: transform 0.24s var(--ease-in-out),
                opacity   0.18s var(--ease-in-out),
                width     0.18s var(--ease-in-out);
    will-change: transform;
}

/* Animated X state */
body.nav-open .site-nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .site-nav-toggle span:nth-child(2) {
    opacity: 0;
    width: 0;
}
body.nav-open .site-nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Primary nav ────────────────────────────────────────────────── */
.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: var(--glass);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--transition),
                background var(--transition),
                border-color var(--transition),
                transform var(--transition);
    will-change: transform;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--text-strong);
    border-color: rgba(255, 75, 75, 0.26);
    background: var(--accent-faint-2);
    transform: translateY(-1px);
}

.site-nav a.is-active {
    color: var(--text-strong);
    border-color: var(--border);
    background: var(--accent-faint-2);
}

.site-nav a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 3px;
}


/* ═══════════════════════════════════════════════════════════════════
   6. PAGE LAYOUT & CONTAINERS
═══════════════════════════════════════════════════════════════════ */
.page-wrap {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
    padding-block: clamp(24px, 4vw, 44px) clamp(48px, 7vw, 80px);
}

/* Auth / account two-column grids */
.auth-grid,
.account-grid {
    display: grid;
    grid-template-columns: 1.04fr 0.96fr;
    gap: clamp(16px, 2.5vw, 28px);
    align-items: stretch;
}


/* ═══════════════════════════════════════════════════════════════════
   7. CARDS
═══════════════════════════════════════════════════════════════════ */
.card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(
        180deg,
        rgba(20, 20, 26, 0.96) 0%,
        rgba(11, 11, 16, 0.99) 100%
    );
    box-shadow: var(--shadow);
    /* Contain paint — prevents backdrop-filter bleed */
    contain: layout paint;
}

/* Shimmer highlight on top edge */
.card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.032) 0%,
        transparent 22%
    );
    border-radius: inherit;
    z-index: 0;
}

.card-body {
    position: relative;
    z-index: 1;
    padding: clamp(20px, 3vw, 32px);
}


/* ═══════════════════════════════════════════════════════════════════
   8. HERO / AUTH PANEL
═══════════════════════════════════════════════════════════════════ */
.hero-panel {
    min-height: 100%;
    background:
        radial-gradient(ellipse 55% 42% at 18% 18%, rgba(255, 59, 59, 0.26), transparent 50%),
        radial-gradient(ellipse 40% 28% at 80% 12%, rgba(255, 130, 130, 0.10), transparent 55%),
        linear-gradient(160deg, rgba(28, 4, 4, 0.95) 0%, rgba(9, 9, 14, 0.98) 100%);
}

/* Eyebrow badge */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong);
    background: rgba(255, 59, 59, 0.11);
    color: #ffd8d8;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Page / card headings */
.hero-panel h1,
.card h1 {
    margin-block: 16px 12px;
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: 0.02em;
    color: var(--text-strong);
}

.section-title {
    font-size: clamp(1.25rem, 2.2vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 4px;
}

.lead {
    color: var(--muted);
    font-size: clamp(0.92rem, 1.3vw, 1.02rem);
    font-weight: 300;
    line-height: 1.78;
    max-width: 62ch;
}

/* Feature list (auth hero panel) */
.feature-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.feature-item {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: var(--glass);
    transition: transform var(--transition),
                border-color var(--transition),
                background var(--transition);
    will-change: transform;
}

.feature-item:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    background: var(--glass-hover);
}

.feature-item strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-strong);
    font-size: 0.95rem;
}

.feature-item p,
.feature-item span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════════════════
   9. FORMS — labels, inputs, helpers
═══════════════════════════════════════════════════════════════════ */

/* Tab switcher (Login / Register) */
.form-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
}

.form-tabs button {
    appearance: none;
    border: 0;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    transition: color var(--transition),
                background var(--transition),
                box-shadow var(--transition);
    touch-action: manipulation;
}

.form-tabs button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.form-tabs button.is-active {
    background: linear-gradient(
        135deg,
        rgba(255, 59, 59, 0.18) 0%,
        rgba(200, 0, 0, 0.09) 100%
    );
    color: var(--text-strong);
    box-shadow: inset 0 0 0 1px rgba(255, 75, 75, 0.22);
}

.form-tabs button:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 3px;
}

/* Form grid */
form {
    display: grid;
    gap: clamp(12px, 2vw, 18px);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 1.5vw, 16px);
}

/* Labels */
label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--text-strong);
    cursor: pointer;
}

/* Input wrapper (for absolute-positioned toggles) */
.input-wrap { position: relative; }

/* All field inputs */
input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.030);
    color: var(--text);
    border-radius: var(--radius-md);
    min-height: var(--input-height);
    padding: 14px 16px;
    outline: none;
    transition: border-color var(--transition),
                background var(--transition),
                box-shadow var(--transition);
    /* Stop iOS from rounding inputs */
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: rgba(235, 237, 245, 0.36);
}

textarea {
    min-height: 136px;
    resize: vertical;
    padding-top: 15px;
    line-height: 1.65;
}

select {
    cursor: pointer;
    /* Custom caret */
    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 1l5 5 5-5' stroke='rgba(245,247,250,0.55)' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

input:hover,
textarea:hover,
select:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.042);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(255, 59, 59, 0.11);
    background: rgba(255, 255, 255, 0.048);
}

/* Password field — room for the toggle button */
.input-with-button input {
    padding-right: 86px;
}

/* Show/hide password button */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    z-index: 2;
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.07);
    color: var(--muted-strong);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.84rem;
    transition: background var(--transition), color var(--transition);
    touch-action: manipulation;
    white-space: nowrap;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-strong);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Field hint text */
.field-hint {
    font-size: 0.83rem;
    color: var(--muted);
    margin-top: -2px;
    line-height: 1.55;
}

/* Checkbox row */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.55;
    cursor: pointer;
}

.checkbox-row input[type='checkbox'] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
    border-radius: 5px;
}


/* ═══════════════════════════════════════════════════════════════════
   10. PASSWORD STRENGTH METER
═══════════════════════════════════════════════════════════════════ */
.password-strength {
    display: grid;
    gap: 8px;
}

.password-strength__bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.password-strength__bars span {
    display: block;
    height: 6px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.09);
    transition: background 0.30s var(--ease-out);
}

.password-strength__bars span.is-on {
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.password-strength__text {
    font-size: 0.84rem;
    color: var(--muted);
}


/* ═══════════════════════════════════════════════════════════════════
   11. BUTTONS
═══════════════════════════════════════════════════════════════════ */
.btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 14px 24px;
    border-radius: 16px;
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    font-size: 0.97rem;
    letter-spacing: 0.01em;
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: var(--shadow-btn);
    transition: transform var(--transition),
                box-shadow var(--transition),
                filter var(--transition);
    will-change: transform;
    white-space: nowrap;
    touch-action: manipulation;
    user-select: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(179, 0, 0, 0.38);
    filter: brightness(1.06);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-btn);
    filter: brightness(0.97);
}

.btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 3px;
}

.btn:disabled,
.btn[aria-disabled='true'] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* Secondary variant */
.btn-secondary {
    background: var(--glass);
    box-shadow: none;
    color: var(--text);
    border: 1px solid var(--border-soft);
}

.btn-secondary:hover {
    background: var(--glass-hover);
    box-shadow: none;
    border-color: var(--border);
    filter: none;
}

/* Button row wrapper */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}


/* ═══════════════════════════════════════════════════════════════════
   12. ALERTS
═══════════════════════════════════════════════════════════════════ */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-md);
    font-size: 0.94rem;
    line-height: 1.62;
    border: 1px solid transparent;
}

.alert + .alert { margin-top: 10px; }

.alert ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: #dff8ea;
}

.alert-error,
.alert-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: #ffe4e4;
}


/* ═══════════════════════════════════════════════════════════════════
   13. AUTH & ACCOUNT PAGE SPECIFICS
═══════════════════════════════════════════════════════════════════ */
.auth-panel-foot {
    margin-top: 6px;
    padding-top: 4px;
}

.helper-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
}

.helper-links a {
    color: #ffd8d8;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.helper-links a:hover { color: var(--text-strong); }
.helper-links a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Account welcome bar */
.account-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Auth badges strip */
.auth-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-soft);
    color: var(--muted-strong);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Avatar preview */
.avatar-preview {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ═══════════════════════════════════════════════════════════════════
   14. STAT BOXES
═══════════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 1.5vw, 16px);
    margin-top: 22px;
}

.stat-box {
    padding: clamp(14px, 2vw, 20px);
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--border-soft);
    transition: border-color var(--transition), transform var(--transition);
}

.stat-box:hover {
    border-color: var(--border);
    transform: translateY(-1px);
}

.stat-box strong {
    display: block;
    font-size: clamp(0.96rem, 1.4vw, 1.1rem);
    margin-bottom: 5px;
    color: var(--text-strong);
}

.stat-box span {
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.55;
}


/* ═══════════════════════════════════════════════════════════════════
   15. DIVIDER
═══════════════════════════════════════════════════════════════════ */
.divider {
    position: relative;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    margin-block: 6px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.divider span {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding-inline: 12px;
    background: rgba(12, 12, 16, 0.99);
}


/* ═══════════════════════════════════════════════════════════════════
   16. RADIO CONSOLE PAGE  (scope guard)
═══════════════════════════════════════════════════════════════════ */
.radio-console-page .site-shell {
    min-height: 100dvh;
}

.radio-console-page .page-wrap {
    position: relative;
}


/* ═══════════════════════════════════════════════════════════════════
   17. UTILITY CLASSES
═══════════════════════════════════════════════════════════════════ */
.muted    { color: var(--muted); }
.strong   { color: var(--text-strong); }
.faint    { color: var(--faint); }
.text-center { text-align: center; }

.hide { display: none !important; }

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   18. ACCESSIBILITY — global focus ring
═══════════════════════════════════════════════════════════════════ */
:focus-visible {
    outline: 2px solid rgba(255, 100, 100, 0.75);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Remove focus ring for mouse users — only show for keyboard */
:focus:not(:focus-visible) {
    outline: none;
}


/* ═══════════════════════════════════════════════════════════════════
   19. REDUCED MOTION
═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration:   0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration:  0.01ms !important;
        scroll-behavior:      auto   !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   20. RESPONSIVE
   ──────────────────────────────────────────────────────────────────
   Breakpoints (mobile-first friendly, applied as max-width):
     1100px  — two-column grids collapse to one column
      920px  — tablet: looser header, reduced padding
      860px  — hamburger nav activates
      640px  — mid-mobile: form tabs, button tweaks
      480px  — small phone: stats → 2-col
      420px  — smallest supported: final tighten
═══════════════════════════════════════════════════════════════════ */

/* ── 1100px — auth & account grids ─────────────────────────────── */
@media (max-width: 1100px) {
    .auth-grid,
    .account-grid {
        grid-template-columns: 1fr;
    }

    /* Hero panel no longer needs to fill height */
    .hero-panel {
        min-height: unset;
    }
}

/* ── 920px — tablet ─────────────────────────────────────────────── */
@media (max-width: 920px) {
    :root {
        --header-height: 76px;
    }

    .site-header__inner,
    .page-wrap {
        width: min(var(--container), calc(100% - 24px));
    }

    .page-wrap {
        padding-block: clamp(18px, 3.5vw, 34px) clamp(36px, 6vw, 60px);
    }

    .card-body {
        padding: clamp(18px, 3vw, 26px);
    }

    .hero-panel h1,
    .card h1 {
        font-size: clamp(1.8rem, 5vw, 2.6rem);
    }

    /* Stats stay 3-col down to 920px — only collapse at 480 */
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ── 860px — hamburger nav breakpoint ───────────────────────────── */
@media (max-width: 860px) {
    :root {
        --header-height: 72px;
    }

    .site-header__inner {
        width: min(100%, calc(100% - 20px));
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        padding-block: 12px;
    }

    .site-nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: fixed;
        top: var(--header-h, 72px);
        right: 10px;
        left: auto;

        width: auto;
        min-width: 0;
        max-width: calc(100vw - 20px);

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 6px;
        padding: 4px;

        border-radius: 16px;
        border: 1px solid var(--border);
        background: rgba(8, 8, 12, 0.98);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
        box-shadow: 0 20px 44px rgba(0, 0, 0, 0.44),
                    0 0 0 1px rgba(255, 75, 75, 0.08);

        transform: translateY(-8px) scale(0.97);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.26s var(--ease-out),
                    opacity 0.22s var(--ease-in-out),
                    visibility 0.22s;
        transform-origin: top right;
        z-index: 999;
    }

    body.nav-open .site-nav {
        transform: translateY(0) scale(1);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .site-nav a {
        display: block;
        width: 190px;
        max-width: calc(100vw - 28px);
        min-height: 40px;
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 0.94rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    .page-wrap {
        width: min(100%, calc(100% - 20px));
    }
}

/* ── 640px — mid mobile ─────────────────────────────────────────── */
@media (max-width: 640px) {
    :root {
        --header-height:    68px;
        --input-height:     50px;
    }

    .site-header__inner {
        width: min(100%, calc(100% - 18px));
        min-height: var(--header-height);
        gap: 10px;
        padding-block: 10px;
    }

    .brand { gap: 11px; }

    .brand img {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        padding: 6px;
    }

    .brand strong { font-size: 1rem; }
    .brand span   { font-size: 0.82rem; max-width: 48vw; }

    .card-body { padding: clamp(16px, 4vw, 22px); }

    /* Buttons full-width on mobile */
    .btn,
    .btn-secondary {
        width: 100%;
        min-height: 52px;
        justify-content: center;
    }

    .btn-row {
        flex-direction: column;
        align-items: stretch;
    }

    /* Tighter password toggle */
    .password-toggle {
        min-height: 36px;
        padding-inline: 10px;
        font-size: 0.8rem;
    }

    .input-with-button input { padding-right: 78px; }

    /* grid-2 already collapsed; form-tabs stays 2-col until 480 */
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-badges {
        gap: 6px;
    }
}

/* ── 480px — small phone ─────────────────────────────────────────── */
@media (max-width: 480px) {
    :root {
        --radius:    20px;
        --radius-lg: 24px;
        --radius-md: 15px;
        --radius-sm: 11px;
    }

    .page-wrap {
        width: min(var(--container), calc(100% - 16px));
    }

    .site-header__inner {
        width: min(100%, calc(100% - 16px));
    }

    /* form tabs collapse to single column */
    .form-tabs {
        grid-template-columns: 1fr;
    }

    .form-tabs button {
        min-height: 46px;
    }

    /* stats grid → single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel h1,
    .card h1 {
        font-size: clamp(1.7rem, 10vw, 2.4rem);
    }

    .section-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 860px) {
    .site-nav a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 190px;
        max-width: calc(100vw - 28px);
        min-height: 40px;
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 0.94rem;
        line-height: 1.2;
        white-space: nowrap;
        gap: 12px;
    }

    .site-nav a span {
        min-width: 0;
    }

    .site-nav a i {
        flex: 0 0 auto;
        margin-left: auto;
        font-size: 0.9rem;
        opacity: 0.9;
    }
}