/* ============================================ */
/* WahAI Auth Pages — Premium Dark Theme v2     */
/* ============================================ */

:root {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --glass: #ffffff;
    --glass-border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.1);
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --border: #e2e8f0;
    --radius: 16px;
}

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

body {
    font-family: 'Poppins', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* ============================================ */
/* BACKGROUND ANIMATION                          */
/* ============================================ */

.auth-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: blobFloat 18s ease-in-out infinite;
}

.blob-1 { width: 400px; height: 400px; background: linear-gradient(135deg, #6366f1, #8b5cf6); top: -100px; right: -100px; }
.blob-2 { width: 350px; height: 350px; background: linear-gradient(135deg, #06b6d4, #3b82f6); bottom: -100px; left: -80px; animation-delay: -5s; }
.blob-3 { width: 250px; height: 250px; background: linear-gradient(135deg, #f59e0b, #ef4444); top: 40%; left: 60%; animation-delay: -10s; opacity: 0.2; }

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.05); }
}

/* ============================================ */
/* LAYOUT — SPLIT VIEW                           */
/* ============================================ */

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

/* TWO COLUMN for login (branding left, form right) */
.auth-split {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100vw;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 100vh;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.auth-brand {
    background: #4f46e5;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 48px;
    display: flex; flex-direction: column; justify-content: center;
    position: relative;
    overflow: hidden;
    color: white;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.2), transparent 70%);
    top: -50px; right: -50px;
    border-radius: 50%;
}

.auth-brand .brand-logo {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 28px;
}

.brand-logo .logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

.brand-logo .logo-icon svg { color: white; }

.brand-logo h1 {
    font-size: 1.8rem; font-weight: 800;
    color: white;
}

.auth-brand .brand-tagline {
    font-size: 1.15rem; font-weight: 600; line-height: 1.6;
    margin-bottom: 24px; color: rgba(255, 255, 255, 0.9);
}

.auth-brand .brand-features {
    list-style: none; display: flex; flex-direction: column; gap: 14px;
}

.brand-features li {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; color: rgba(255, 255, 255, 0.85);
}

.feature-icon {
    width: 32px; height: 32px; min-width: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

.feature-icon.fi-purple { background: rgba(99,102,241,0.15); }
.feature-icon.fi-green { background: rgba(16,185,129,0.15); }
.feature-icon.fi-orange { background: rgba(245,158,11,0.15); }
.feature-icon.fi-cyan { background: rgba(6,182,212,0.15); }

.auth-form-side {
    background: #ffffff;
    padding: 60px 48px;
    display: flex; flex-direction: column; justify-content: center;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 4px 20px var(--accent-glow); }
    50% { box-shadow: 0 4px 40px var(--accent-glow), 0 0 60px rgba(99,102,241,0.2); }
}

/* ============================================ */
/* GLASS CARD (Single-column fallback)           */
/* ============================================ */

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ============================================ */
/* LOGO (centered, for single-column)            */
/* ============================================ */

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px var(--accent-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

.auth-logo .logo-icon svg { color: white; }

.auth-logo h1 {
    font-size: 1.8rem; font-weight: 800;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.auth-logo .subtitle { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* Form Title for two-col */
.form-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.form-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 24px; }

/* ============================================ */
/* FORMS                                         */
/* ============================================ */

.form-group { margin-bottom: 16px; flex: 1; }

.form-group label {
    display: block; font-size: 0.82rem; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 6px;
}

.form-row { display: flex; gap: 12px; }

.input-wrapper { position: relative; }

.input-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.form-group input,
.form-group select {
    width: 100%; padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem; font-family: inherit;
    transition: all 0.3s ease; outline: none;
}

.input-wrapper input { padding-left: 42px; }

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder { color: rgba(148, 163, 184, 0.5); }

.toggle-pass {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-secondary); cursor: pointer; padding: 4px;
    transition: color 0.2s;
}
.toggle-pass:hover { color: var(--text-primary); }

/* ============================================ */
/* BUTTONS                                       */
/* ============================================ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: 10px;
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: white; box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-lg { width: 100%; padding: 14px 24px; font-size: 1rem; margin-top: 8px; }

/* ============================================ */
/* TRIAL BADGE                                   */
/* ============================================ */

.trial-badge {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    font-size: 0.8rem; color: var(--success);
    margin-bottom: 16px;
}
.trial-badge strong { color: #34d399; }

/* ============================================ */
/* ALERT                                         */
/* ============================================ */

.alert {
    padding: 12px 16px; border-radius: 10px;
    font-size: 0.85rem; margin-bottom: 16px;
    animation: alertIn 0.3s ease;
}

.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ============================================ */
/* FOOTER                                        */
/* ============================================ */

.auth-footer {
    text-align: center; margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.auth-footer p { font-size: 0.85rem; color: var(--text-secondary); }
.auth-footer a { color: var(--accent-light); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.auth-footer a:hover { color: #c7d2fe; }

.back-link {
    display: inline-block; margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
}
.back-link:hover { color: var(--text-primary) !important; }

/* Divider */
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px;
    background: var(--border);
}

/* Social Proof */
.social-proof {
    margin-top: 24px; text-align: center; padding-top: 20px;
    border-top: 1px solid var(--border);
}
.social-proof p {
    font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6;
}
.social-proof .stat-inline {
    color: var(--accent-light); font-weight: 700;
}

/* ============================================ */
/* RESPONSIVE                                    */
/* ============================================ */

@media (max-width: 968px) {
    .auth-split {
        grid-template-columns: 1fr;
        max-width: 100vw;
    }
    .auth-brand {
        padding: 60px 24px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        min-height: auto;
    }
    .auth-brand .brand-tagline { font-size: 1.1rem; margin-bottom: 16px; }
    .auth-form-side { padding: 40px 24px; }
}

@media (max-width: 520px) {
    .glass-card { padding: 28px 20px; }
    .form-row { flex-direction: column; gap: 0; }
    .auth-logo h1 { font-size: 1.5rem; }
    .auth-split { margin: 0; }
    .auth-brand { padding: 40px 20px; }
    .auth-form-side { padding: 32px 20px; }
}
