/* auth.css -- MyBest24 Login Overlay
   Matches existing design tokens from styles.css
   Load AFTER styles.css so variables are available
*/

/* ── OVERLAY CONTAINER ──────────────────────────────────────────────────── */

#auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999; /* above everything, including wizard (9999) */
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: auth-fade-in 0.4s ease both;
}

@keyframes auth-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Subtle grid texture — echoes the 24-box concept */
#auth-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(70, 165, 206, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(70, 165, 206, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* ── CARD ───────────────────────────────────────────────────────────────── */

.auth-card {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--box-border);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(70, 165, 206, 0.08),
        0 24px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(70, 165, 206, 0.05);
    padding: 48px 40px 40px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: auth-card-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes auth-card-rise {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── BRANDING ───────────────────────────────────────────────────────────── */

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.auth-logo-icon {
    width: 36px;
    height: 36px;
    image-rendering: pixelated;
}

.auth-logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
    line-height: 1;
}

.auth-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* ── DIVIDER ────────────────────────────────────────────────────────────── */

.auth-divider {
    width: 100%;
    height: 1px;
    background: var(--box-border);
    margin-bottom: 32px;
}

/* ── GOOGLE BUTTON ──────────────────────────────────────────────────────── */

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #131314;
    border: 1px solid #444;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e3e3e3;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    letter-spacing: 0.1px;
    margin-bottom: 16px;
}

.auth-google-btn:hover {
    background: #1e1e1e;
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 12px var(--accent-glow);
}

.auth-google-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.auth-google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── FINE PRINT ─────────────────────────────────────────────────────────── */

.auth-fine-print {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    opacity: 0.6;
    margin-top: 8px;
}

.auth-fine-print a {
    color: var(--accent-color);
    text-decoration: none;
}

/* ── LOADING STATE ──────────────────────────────────────────────────────── */

.auth-google-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-google-btn.loading .auth-btn-text::after {
    content: '…';
    animation: auth-ellipsis 1s steps(4) infinite;
}

@keyframes auth-ellipsis {
    0%   { content: '.'; }
    33%  { content: '..'; }
    66%  { content: '...'; }
    100% { content: '.'; }
}

/* ── SLIDE-OUT ON LOGIN ──────────────────────────────────────────────────── */

#auth-overlay.auth-exiting {
    animation: auth-fade-out 0.35s ease forwards;
    pointer-events: none;
}

@keyframes auth-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ── MOBILE ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .auth-card {
        padding: 36px 24px 32px;
        border-radius: 12px;
    }

    .auth-logo-text {
        font-size: 1.5rem;
    }
}