/* ══════════════════════════════════════════════════════════════
   Auth Pages — Standalone login/register styling
   Matches NextPlay premium dark theme
   ══════════════════════════════════════════════════════════════ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--bg);
}

.auth-page .app-layout { display: none; }

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ── Brand ────────────────────────────────────────────────── */

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand img {
    border-radius: 50%;
    filter: drop-shadow(0 4px 16px rgba(255,107,53,0.4));
    margin-bottom: 12px;
}

.auth-brand h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 0.15em;
    margin-bottom: 8px;
}

.auth-brand p {
    color: var(--text-2);
    font-size: 0.88rem;
    line-height: 1.4;
}

/* ── Error ────────────────────────────────────────────────── */

.auth-error {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(248,81,73,0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

/* ── Form ─────────────────────────────────────────────────── */

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.auth-form .form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
    outline: none;
}

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

.auth-form .form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-form .password-wrapper {
    position: relative;
}

.auth-form .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.auth-form .password-toggle:hover {
    color: var(--text);
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn-primary-auth {
    width: 100%;
    padding: 14px 20px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    letter-spacing: 0.02em;
}

.btn-primary-auth:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-glow);
}

.btn-primary-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}

.btn-primary-auth.loading {
    position: relative;
    color: transparent;
}

.btn-primary-auth.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

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

/* ── Divider ──────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-3);
    font-size: 0.82rem;
}

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

/* ── Social Buttons ───────────────────────────────────────── */

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-2);
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
}

.btn-social:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--text);
}

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

.btn-google:hover { border-color: #4285f4; background: rgba(66,133,244,0.1); }
.btn-facebook:hover { border-color: #1877f2; background: rgba(24,119,242,0.1); }
.btn-apple:hover { border-color: #fff; background: rgba(255,255,255,0.05); }

/* ── Footer ───────────────────────────────────────────────── */

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-2);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--accent);
    font-weight: 600;
}

/* ── Sidebar User (in base.html) ──────────────────────────── */

.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.sidebar-user .user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.sidebar-user .btn-logout {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.sidebar-user .btn-logout:hover {
    color: var(--red);
    background: var(--red-dim);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
    .auth-page {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }
    .auth-container {
        max-width: 100%;
    }
    .auth-card {
        padding: 24px 18px;
        border-radius: 12px;
    }
    .auth-brand {
        margin-bottom: 24px;
    }
    .auth-brand img {
        width: 64px;
        height: 64px;
    }
    .auth-brand h1 {
        font-size: 1.1rem;
    }
    .auth-brand p {
        font-size: 0.82rem;
    }
    .auth-form .form-input {
        padding: 14px 16px;
        font-size: 16px; /* prevents iOS zoom */
        min-height: 48px;
    }
    .auth-form .password-toggle {
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
    }
    .btn-primary-auth {
        padding: 16px 20px;
        min-height: 48px;
        font-size: 1rem;
    }
    .btn-social {
        padding: 14px 20px;
        min-height: 48px;
    }
    .auth-footer {
        font-size: 0.82rem;
    }
}
