/* Fantasy Football Nerds - Editorial Authentication System */
/* Shared tokens, form surfaces, and branded account gateway patterns */

@import url('/css/brand-tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-hand: 'Inter', sans-serif;

    --bg-base: #eff4fb;
    --bg-base-strong: #e3ebf6;
    --bg-surface: rgba(255, 255, 255, 0.84);
    --bg-surface-strong: rgba(255, 255, 255, 0.94);
    --bg-surface-muted: rgba(225, 232, 240, 0.74);
    --bg-contrast: #0f1728;
    --bg-hover: rgba(255, 255, 255, 0.9);

    --text-primary: #0a101d;
    --text-secondary: #42506b;
    --text-muted: #73839f;
    --text-soft: #9aa9c1;
    --text-inverse: #f8fbff;

    --border-light: rgba(10, 16, 29, 0.08);
    --border-medium: rgba(10, 16, 29, 0.14);
    --border-strong: rgba(10, 16, 29, 0.2);
    --border-focus: #0057ff;

    --accent-blue: #0057ff;
    --accent-blue-soft: rgba(0, 87, 255, 0.12);
    --accent-blue-strong: #2962ff;
    --accent-green: #0d8d6f;
    --accent-green-soft: rgba(13, 141, 111, 0.12);
    --accent-ink: #10213b;

    --success: #0d8d6f;
    --success-bg: rgba(13, 141, 111, 0.12);
    --success-border: rgba(13, 141, 111, 0.24);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.09);
    --error-border: rgba(220, 38, 38, 0.22);
    --warning: #b45309;
    --warning-bg: rgba(180, 83, 9, 0.1);
    --warning-border: rgba(180, 83, 9, 0.22);

    --input-bg: rgba(255, 255, 255, 0.92);
    --input-border: rgba(115, 131, 159, 0.34);
    --input-border-focus: #0057ff;
    --input-border-error: #dc2626;
    --input-border-success: #0d8d6f;

    --shadow-xs: 0 1px 2px rgba(10, 16, 29, 0.06);
    --shadow-sm: 0 14px 36px rgba(10, 16, 29, 0.08);
    --shadow-md: 0 20px 56px rgba(10, 16, 29, 0.12);
    --shadow-lg: 0 36px 100px rgba(10, 16, 29, 0.18);
    --shadow-blue: 0 22px 60px rgba(0, 87, 255, 0.16);
}

[data-theme="dark"] {
    --bg-base: #06111b;
    --bg-base-strong: #0b1625;
    --bg-surface: rgba(7, 19, 33, 0.84);
    --bg-surface-strong: rgba(9, 23, 39, 0.96);
    --bg-surface-muted: rgba(15, 23, 42, 0.75);
    --bg-contrast: #020811;
    --bg-hover: rgba(20, 33, 56, 0.9);

    --text-primary: #f4f8ff;
    --text-secondary: #d3def3;
    --text-muted: #9eb0cd;
    --text-soft: #72819d;
    --text-inverse: #ffffff;

    --border-light: rgba(158, 176, 205, 0.14);
    --border-medium: rgba(158, 176, 205, 0.24);
    --border-strong: rgba(158, 176, 205, 0.34);
    --border-focus: #38b6ff;

    --accent-blue: #38b6ff;
    --accent-blue-soft: rgba(56, 182, 255, 0.16);
    --accent-blue-strong: #7cc7ff;
    --accent-green: #34d399;
    --accent-green-soft: rgba(52, 211, 153, 0.16);
    --accent-ink: #dbeafe;

    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --success-border: rgba(52, 211, 153, 0.3);
    --error-bg: rgba(220, 38, 38, 0.14);
    --error-border: rgba(220, 38, 38, 0.3);
    --warning-bg: rgba(180, 83, 9, 0.16);
    --warning-border: rgba(180, 83, 9, 0.3);

    --input-bg: rgba(12, 22, 37, 0.92);
    --input-border: rgba(158, 176, 205, 0.24);
    --input-border-focus: #38b6ff;

    --shadow-xs: 0 1px 2px rgba(2, 8, 17, 0.22);
    --shadow-sm: 0 18px 44px rgba(2, 8, 17, 0.28);
    --shadow-md: 0 24px 66px rgba(2, 8, 17, 0.34);
    --shadow-lg: 0 40px 120px rgba(2, 8, 17, 0.48);
    --shadow-blue: 0 24px 70px rgba(56, 182, 255, 0.18);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-base-strong) 100%);
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 12% 12%, rgba(41, 98, 255, 0.16), transparent 24%),
        radial-gradient(circle at 84% 16%, rgba(13, 141, 111, 0.12), transparent 22%),
        radial-gradient(circle at 72% 82%, rgba(165, 180, 252, 0.16), transparent 28%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025)),
        radial-gradient(circle at 1px 1px, rgba(10, 16, 29, 0.08) 1px, transparent 0);
    background-size: auto, 56px 56px;
    opacity: 0.36;
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] body::after,
body.theme-dark::after {
    opacity: 0.2;
}

body.auth-form-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 40px;
}

a {
    color: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-bloom-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.auth-bloom {
    position: absolute;
    border-radius: 999px;
    filter: blur(140px);
    opacity: 0.16;
    animation: authDrift 18s infinite alternate ease-in-out;
}

.auth-bloom.bloom-1 {
    top: -10%;
    left: 14%;
    width: 46vw;
    height: 46vw;
    background: radial-gradient(circle, rgba(41, 98, 255, 0.56) 0%, transparent 72%);
    animation-delay: -3s;
}

.auth-bloom.bloom-2 {
    right: 0;
    bottom: -14%;
    width: 52vw;
    height: 52vw;
    background: radial-gradient(circle, rgba(165, 180, 252, 0.52) 0%, transparent 72%);
}

.auth-bloom.bloom-3 {
    left: -8%;
    bottom: 24%;
    width: 34vw;
    height: 34vw;
    background: radial-gradient(circle, rgba(13, 141, 111, 0.28) 0%, transparent 74%);
    animation-duration: 23s;
}

@keyframes authDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(4%, 8%, 0) scale(1.08);
    }
}

.floating-nav-left,
.floating-nav-right {
    position: fixed;
    top: 24px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-nav-left {
    left: 24px;
}

.floating-nav-right {
    right: 24px;
}

.nav-btn,
.theme-toggle {
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .nav-btn,
[data-theme="dark"] .theme-toggle,
body.theme-dark .nav-btn,
body.theme-dark .theme-toggle {
    background: rgba(7, 19, 33, 0.72);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
    color: #ffffff;
    border-color: transparent;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-toggle .icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color 0.15s ease, transform 0.2s ease;
}

.nav-btn:hover,
.theme-toggle:hover {
    transform: translateY(-1px);
    background: var(--bg-hover);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
}

.nav-btn.primary:hover {
    filter: brightness(1.04);
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
}

.nav-btn:focus-visible,
.theme-toggle:focus-visible,
.form-input:focus-visible,
.auth-btn:focus-visible,
.auth-links a:focus-visible,
.auth-action:focus-visible,
.auth-gateway-card:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.auth-stage {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 460px);
    gap: clamp(28px, 4vw, 72px);
    align-items: center;
}

.auth-brand-panel {
    position: relative;
    min-height: 640px;
    padding: clamp(28px, 4vw, 44px);
    border-radius: 34px;
    border: 1px solid var(--border-medium);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.42) 100%),
        radial-gradient(circle at top right, rgba(41, 98, 255, 0.12), transparent 32%);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

[data-theme="dark"] .auth-brand-panel,
body.theme-dark .auth-brand-panel {
    background:
        linear-gradient(180deg, rgba(7, 19, 33, 0.8) 0%, rgba(7, 19, 33, 0.62) 100%),
        radial-gradient(circle at top right, rgba(56, 182, 255, 0.14), transparent 34%);
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 40%),
        linear-gradient(180deg, transparent 0%, rgba(0, 87, 255, 0.04) 100%);
    pointer-events: none;
}

.auth-panel-kicker {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--bg-surface-muted);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.auth-panel-kicker::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent-blue);
}

.auth-brand-title {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    font-size: clamp(3rem, 6vw, 5.8rem);
    line-height: 0.9;
    letter-spacing: -0.05em;
    font-weight: 900;
    text-transform: uppercase;
    max-width: 11ch;
}

.auth-brand-title span {
    display: block;
}

.auth-brand-title .dim {
    color: rgba(16, 33, 59, 0.16);
}

[data-theme="dark"] .auth-brand-title .dim,
body.theme-dark .auth-brand-title .dim {
    color: rgba(219, 234, 254, 0.14);
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
    margin-top: 26px;
    max-width: 44ch;
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.auth-brand-showcase {
    position: relative;
    z-index: 1;
}

.auth-brand-content-cluster {
    min-width: 0;
}

.auth-brand-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.auth-brand-stat {
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
}

.auth-brand-stat strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.auth-brand-stat span {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.auth-brand-list {
    position: relative;
    z-index: 1;
    list-style: none;
    margin-top: 24px;
    display: grid;
    gap: 12px;
    max-width: 40rem;
}

.auth-brand-list li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    color: var(--text-secondary);
    font-size: 15px;
}

.auth-brand-list li::before {
    content: '';
    width: 10px;
    height: 10px;
    margin-top: 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
    box-shadow: 0 0 0 6px var(--accent-blue-soft);
}

.auth-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid var(--border-light);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

[data-theme="dark"] .auth-brand-chip,
body.theme-dark .auth-brand-chip {
    background: rgba(7, 19, 33, 0.74);
}

.auth-mascot-wrap {
    position: absolute;
    right: clamp(14px, 2vw, 24px);
    bottom: 12px;
    width: clamp(180px, 26vw, 280px);
    transform: rotate(-4deg);
    pointer-events: none;
}

.auth-login-page .auth-stage,
.auth-register-page .auth-stage {
    width: min(1260px, 100%);
    grid-template-columns: minmax(0, 1.18fr) minmax(380px, 470px);
    align-items: stretch;
}

.auth-login-page .auth-brand-panel,
.auth-register-page .auth-brand-panel,
.auth-login-page .auth-main,
.auth-register-page .auth-main,
.auth-login-page .auth-container,
.auth-register-page .auth-container {
    height: 100%;
}

.auth-login-page .auth-brand-panel,
.auth-register-page .auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.auth-login-page .auth-brand-showcase,
.auth-register-page .auth-brand-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(196px, 22vw, 252px);
    gap: clamp(18px, 2vw, 28px);
    align-items: end;
    margin-top: 32px;
}

.auth-login-page .auth-brand-grid,
.auth-register-page .auth-brand-grid {
    margin-top: 0;
    grid-template-columns: minmax(0, 1.18fr) minmax(126px, 0.82fr);
    align-items: end;
}

.auth-login-page .auth-brand-stat,
.auth-register-page .auth-brand-stat {
    position: relative;
    overflow: hidden;
    min-height: 102px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.94) 0%, rgba(227, 235, 246, 0.76) 100%);
}

.auth-login-page .auth-brand-stat::before,
.auth-register-page .auth-brand-stat::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 86px;
    height: 86px;
    background: radial-gradient(circle, rgba(0, 87, 255, 0.16) 0%, transparent 72%);
    pointer-events: none;
}

.auth-login-page .auth-brand-stat:first-child,
.auth-register-page .auth-brand-stat:first-child {
    padding-block: 22px 18px;
    border-color: rgba(0, 87, 255, 0.18);
}

.auth-login-page .auth-brand-stat:first-child strong,
.auth-register-page .auth-brand-stat:first-child strong {
    font-size: 34px;
}

.auth-login-page .auth-brand-stat:last-child,
.auth-register-page .auth-brand-stat:last-child {
    transform: translateY(16px) rotate(-2deg);
    background: linear-gradient(155deg, rgba(0, 87, 255, 0.12) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.auth-login-page .auth-brand-stat:last-child strong,
.auth-register-page .auth-brand-stat:last-child strong {
    font-size: 24px;
}

.auth-login-page .auth-brand-list,
.auth-register-page .auth-brand-list {
    margin-top: 30px;
    max-width: none;
    gap: 14px;
}

.auth-login-page .auth-brand-list li,
.auth-register-page .auth-brand-list li {
    padding: 14px 16px 14px 18px;
    border-radius: 18px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(10px);
}

.auth-login-page .auth-brand-list li:nth-child(1),
.auth-register-page .auth-brand-list li:nth-child(1) {
    border-color: rgba(0, 87, 255, 0.14);
}

.auth-login-page .auth-brand-list li:nth-child(2),
.auth-register-page .auth-brand-list li:nth-child(2) {
    border-color: rgba(13, 141, 111, 0.16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.64) 0%, rgba(13, 141, 111, 0.06) 100%);
}

.auth-login-page .auth-brand-list li:nth-child(3),
.auth-register-page .auth-brand-list li:nth-child(3) {
    border-color: rgba(16, 33, 59, 0.12);
}

.auth-login-page .auth-brand-footer,
.auth-register-page .auth-brand-footer {
    margin-top: 24px;
}

.auth-login-page .auth-mascot-wrap,
.auth-register-page .auth-mascot-wrap {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 250px;
    margin: 4px 0 0 auto;
    align-self: end;
    transform: rotate(-3deg);
}

.auth-login-page .auth-mascot-note,
.auth-register-page .auth-mascot-note {
    top: -26px;
    left: -46px;
    font-size: clamp(26px, 2.7vw, 34px);
}

.auth-login-page .auth-mascot-arrow,
.auth-register-page .auth-mascot-arrow {
    top: 4px;
    left: -14px;
    width: 50px;
    height: 50px;
}

[data-theme="dark"] .auth-login-page .auth-brand-stat,
[data-theme="dark"] .auth-register-page .auth-brand-stat,
body.theme-dark.auth-login-page .auth-brand-stat,
body.theme-dark.auth-register-page .auth-brand-stat {
    background: linear-gradient(160deg, rgba(11, 22, 37, 0.92) 0%, rgba(16, 29, 48, 0.82) 100%);
}

[data-theme="dark"] .auth-login-page .auth-brand-stat:last-child,
[data-theme="dark"] .auth-register-page .auth-brand-stat:last-child,
body.theme-dark.auth-login-page .auth-brand-stat:last-child,
body.theme-dark.auth-register-page .auth-brand-stat:last-child {
    background: linear-gradient(155deg, rgba(56, 182, 255, 0.16) 0%, rgba(11, 22, 37, 0.9) 100%);
}

[data-theme="dark"] .auth-login-page .auth-brand-list li,
[data-theme="dark"] .auth-register-page .auth-brand-list li,
body.theme-dark.auth-login-page .auth-brand-list li,
body.theme-dark.auth-register-page .auth-brand-list li {
    background: rgba(10, 22, 38, 0.8);
}

[data-theme="dark"] .auth-login-page .auth-brand-list li:nth-child(2),
[data-theme="dark"] .auth-register-page .auth-brand-list li:nth-child(2),
body.theme-dark.auth-login-page .auth-brand-list li:nth-child(2),
body.theme-dark.auth-register-page .auth-brand-list li:nth-child(2) {
    background: linear-gradient(135deg, rgba(10, 22, 38, 0.86) 0%, rgba(52, 211, 153, 0.08) 100%);
}

.auth-mascot-note {
    position: absolute;
    top: -34px;
    left: -70px;
    font-family: var(--font-hand);
    font-size: 34px;
    color: var(--accent-blue);
    white-space: nowrap;
    transform: rotate(-12deg);
}

.auth-mascot-arrow {
    position: absolute;
    top: 8px;
    left: -16px;
    width: 56px;
    height: 56px;
    stroke: var(--accent-blue);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
}

.auth-hand-drawn {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0px 2px 4px rgba(0, 87, 255, 0.18));
}

.auth-main {
    width: 100%;
    position: relative;
    z-index: 1;
}

.auth-container {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 4vw, 40px);
    border-radius: 28px;
    background: var(--bg-surface-strong);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.auth-container::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-green) 100%);
}

.auth-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(0, 87, 255, 0.08), transparent 28%),
        radial-gradient(circle at bottom left, rgba(13, 141, 111, 0.08), transparent 28%);
    pointer-events: none;
}

.auth-logo-section,
.auth-form,
.auth-links,
.auth-footer,
.auth-success-state,
.auth-alert-container,
.auth-status-block,
.auth-gateway-grid {
    position: relative;
    z-index: 1;
}

.auth-logo-section {
    margin-bottom: 28px;
}

.auth-logo {
    width: clamp(170px, 36vw, 240px);
    max-width: 100%;
    height: auto;
    max-height: 72px;
    display: block;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 22px rgba(0, 87, 255, 0.14));
}

.auth-overline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--accent-blue-soft);
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.auth-title {
    font-size: clamp(2rem, 3vw, 2.55rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    max-width: 12ch;
}

.auth-subtitle {
    margin-top: 12px;
    max-width: 34ch;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.auth-context-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--bg-surface-muted) 0%, rgba(255, 255, 255, 0.18) 100%);
}

.auth-context-pill {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-context-copy {
    min-width: 0;
}

.auth-context-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-context-text {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.password-input-row {
    position: relative;
}

.form-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
    outline: none;
}

.password-input-row .form-input {
    padding-right: 82px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-medium);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.password-toggle:hover {
    background: var(--bg-surface-muted);
    border-color: var(--input-border-focus);
    color: var(--text-primary);
}

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 87, 255, 0.12);
}

[data-theme="dark"] .password-toggle:focus-visible,
body.theme-dark .password-toggle:focus-visible {
    box-shadow: 0 0 0 4px rgba(56, 182, 255, 0.14);
}

.form-input::placeholder {
    color: var(--text-soft);
}

.form-input:focus {
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 4px rgba(0, 87, 255, 0.12);
    transform: translateY(-1px);
}

[data-theme="dark"] .form-input:focus,
body.theme-dark .form-input:focus {
    box-shadow: 0 0 0 4px rgba(56, 182, 255, 0.14);
}

.form-input.valid {
    border-color: var(--input-border-success);
}

.form-input.invalid {
    border-color: var(--input-border-error);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.form-hint.success {
    color: var(--success);
}

.form-hint.error {
    color: var(--error);
}

.auth-btn,
.auth-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, filter 0.15s ease, background 0.15s ease;
    position: relative;
    font-family: inherit;
}

.auth-btn.primary,
.auth-action.primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-blue);
}

.auth-action.secondary,
.auth-btn.secondary {
    background: transparent;
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.auth-btn:hover:not(:disabled),
.auth-action:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.auth-btn.secondary:hover,
.auth-action.secondary:hover {
    background: var(--bg-surface-muted);
}

.auth-btn:disabled,
.auth-action:disabled {
    opacity: 0.56;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.auth-alert.success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.auth-alert.error {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error-border);
}

.auth-alert.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.auth-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 14px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.auth-loading.show {
    display: flex;
}

.auth-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-blue);
    animation: spin 0.8s linear infinite;
}

.auth-links {
    margin-top: 22px;
    display: grid;
    gap: 8px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-links a {
    color: var(--accent-blue);
    font-weight: 700;
    text-decoration: none;
}

.auth-links a:hover {
    opacity: 0.86;
}

.auth-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.auth-footer p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-footer p + p {
    margin-top: 6px;
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--text-primary);
}

.auth-success-state {
    display: none;
    text-align: center;
}

.auth-success-state.show {
    display: block;
}

.auth-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
    color: #fff;
    box-shadow: var(--shadow-blue);
}

.auth-success-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.auth-success-message {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.auth-status-block,
.auth-email-info {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
}

.auth-status-block.success {
    border-color: var(--success-border);
    background: var(--success-bg);
    color: var(--success);
}

.auth-status-block.warning {
    border-color: var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning);
}

.auth-status-block.error {
    border-color: var(--error-border);
    background: var(--error-bg);
    color: var(--error);
}

.auth-status-block p + p,
.auth-email-info p + p {
    margin-top: 8px;
}

.auth-action-row {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.auth-gateway-grid {
    display: grid;
    gap: 14px;
    margin-top: 26px;
}

.auth-gateway-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-gateway-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.auth-gateway-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-blue-soft);
    color: var(--accent-blue);
}

.auth-gateway-copy strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.auth-gateway-copy span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-gateway-arrow {
    color: var(--text-soft);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 1080px) {
    .auth-stage {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: auto;
        order: 2;
    }

    .auth-main {
        order: 1;
        max-width: 540px;
    }

    .auth-brand-title {
        max-width: none;
    }

    .auth-mascot-wrap {
        position: relative;
        right: auto;
        bottom: auto;
        margin: 36px 0 0 auto;
    }

    .auth-login-page .auth-stage,
    .auth-register-page .auth-stage {
        grid-template-columns: 1fr;
    }

    .auth-login-page .auth-main,
    .auth-register-page .auth-main {
        max-width: 560px;
    }

    .auth-login-page .auth-brand-panel,
    .auth-register-page .auth-brand-panel,
    .auth-login-page .auth-main,
    .auth-register-page .auth-main,
    .auth-login-page .auth-container,
    .auth-register-page .auth-container {
        height: auto;
    }

    .auth-login-page .auth-brand-showcase,
    .auth-register-page .auth-brand-showcase {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .auth-login-page .auth-brand-grid,
    .auth-register-page .auth-brand-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .auth-login-page .auth-brand-stat:last-child,
    .auth-register-page .auth-brand-stat:last-child {
        transform: none;
    }

    .auth-login-page .auth-mascot-wrap,
    .auth-register-page .auth-mascot-wrap {
        max-width: 220px;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    body.auth-form-page {
        padding: 116px 18px 28px;
    }

    .floating-nav-left,
    .floating-nav-right {
        top: 16px;
    }

    .floating-nav-left {
        left: 16px;
        gap: 8px;
    }

    .floating-nav-right {
        right: 16px;
    }

    .nav-btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .auth-brand-panel {
        padding: 26px;
        border-radius: 26px;
    }

    .auth-container {
        padding: 26px;
        border-radius: 24px;
    }

    .auth-brand-grid {
        grid-template-columns: 1fr;
    }

    .auth-gateway-card {
        grid-template-columns: auto 1fr;
    }

    .auth-gateway-arrow {
        display: none;
    }
}

@media (max-width: 560px) {
    .floating-nav-left {
        flex-wrap: wrap;
        max-width: calc(100vw - 88px);
    }

    .nav-btn.primary {
        order: -1;
    }

    .auth-brand-title {
        font-size: clamp(2.4rem, 14vw, 3.6rem);
    }

    .auth-brand-copy {
        font-size: 15px;
    }

    .auth-logo {
        width: clamp(148px, 62vw, 190px);
    }

    .auth-title {
        font-size: 1.85rem;
    }

    .auth-mascot-wrap {
        width: 180px;
        margin-top: 28px;
    }

    .auth-mascot-note {
        left: -52px;
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
