/* login.css — v3 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:      #090b0e;
    --surface: #111318;
    --card:    #161920;
    --border:  rgba(255,255,255,0.07);
    --accent:  #c8102e;
    --eagles:  #004c54;
    --text:    #f0f2f5;
    --muted:   #6b7280;
    --live:    #22d96b;
    --radius:  14px;
    --trans:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-head: 'Barlow Condensed', sans-serif;
    --font-body: 'Barlow', sans-serif;
}

html, body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

/* ── Background ─────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: fixed;
    inset: 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='0.04'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 50% -10%, rgba(0,76,84,0.2) 0%, transparent 60%);
    pointer-events: none;
}

/* Video background */
.bg-video-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.bg-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9,11,14,0.35);
}

/* ── Card ───────────────────────────────────────────────────────── */
.login-card {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    animation: cardIn 0.4s var(--trans) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* ── Logo ───────────────────────────────────────────────────────── */
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--eagles);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0,76,84,0.5);
}

.logo-mark svg { width: 18px; height: 18px; fill: white; }

.logo-text {
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.logo-text span { color: var(--eagles); }

/* ── Tab switcher (Login / Register) ────────────────────────────── */
.auth-tabs {
    display: flex;
    background: var(--surface);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 9px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-radius: 7px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.auth-tab.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Forms ──────────────────────────────────────────────────────── */
.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: rgba(0,76,84,0.7);
    box-shadow: 0 0 0 3px rgba(0,76,84,0.12);
}

.form-input.valid {
    border-color: rgba(34,217,107,0.4);
}

.form-input.invalid {
    border-color: rgba(200,16,46,0.4);
}

/* ── Username availability ──────────────────────────────────────── */
.username-status {
    font-size: 12px;
    margin-top: 5px;
    min-height: 0;
    transition: color 0.2s;
}

.username-status.ok      { color: var(--live); }
.username-status.err     { color: #ff6b7a; }
.username-status.checking { color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}

.btn-primary:hover { background: #a50d26; }
.btn-primary:disabled {
    background: rgba(255,255,255,0.08);
    color: var(--muted);
    cursor: not-allowed;
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(200,16,46,0.1);
    border: 1px solid rgba(200,16,46,0.25);
    color: #ff6b7a;
}

.alert-success {
    background: rgba(34,217,107,0.08);
    border: 1px solid rgba(34,217,107,0.2);
    color: var(--live);
}

/* ── Code entry (after email sent) ─────────────────────────────── */
.code-step {
    text-align: center;
}

.code-step-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.code-step-title {
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 22px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.code-step-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.code-input-wrap {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.code-digit {
    width: 44px;
    height: 54px;
    text-align: center;
    font-family: 'Barlow Condensed', monospace;
    font-size: 28px;
    font-weight: 700;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.code-digit:focus {
    border-color: rgba(0,76,84,0.7);
    box-shadow: 0 0 0 3px rgba(0,76,84,0.12);
}

.code-resend {
    font-size: 13px;
    color: var(--muted);
    margin-top: 16px;
}

.code-resend a {
    color: var(--text);
    cursor: pointer;
    text-decoration: underline;
}

/* ── Verify page (error card) ───────────────────────────────────── */
.verify-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.verify-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}

.verify-card .logo-text {
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 24px;
    display: block;
}

.verify-card .logo-text span { color: var(--eagles); }

.verify-icon { font-size: 40px; margin-bottom: 16px; }

.verify-card h2 {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 10px;
}

.verify-card p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.verify-card .btn {
    display: inline-flex;
    width: auto;
    padding: 12px 28px;
}

/* ── Cloudflare Turnstile ─────────────────────────────────────────── */
.cf-turnstile {
    margin: 2px 0 16px;
    display: flex;
    justify-content: center;
}


/* ── Email + invite status ──────────────────────────────────────── */
.email-status,
.invite-status {
    font-size: 12px;
    margin-top: 5px;
    min-height: 0;
    transition: color 0.2s;
}

.email-status.ok,
.invite-status.ok       { color: var(--live); }
.email-status.err,
.invite-status.err      { color: #ff6b7a; }
.email-status.checking,
.invite-status.checking { color: var(--muted); }
@media (max-width: 440px) {
    .login-card { padding: 28px 20px 32px; border-radius: 16px; }
    .code-digit { width: 38px; height: 48px; font-size: 24px; }
}
/* ── FireTV / Silk single-input OTP ─────────────────────────────── */
#code-single {
    width: 100%;
    max-width: 280px;
    height: 64px;
    text-align: center;
    font-family: 'Barlow Condensed', monospace;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.35em;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    padding: 0 12px;
    box-sizing: border-box;
}

#code-single:focus {
    border-color: rgba(0, 76, 84, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 76, 84, 0.12);
}

#code-single::placeholder {
    letter-spacing: 0.2em;
    color: var(--muted);
    font-size: 22px;
}