/* ═══════════════════════════════════════════════════════
   🎨 VIRALIX AUTH SYSTEM — Premium Split-Screen Design
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Montserrat:wght@700;800;900&display=swap');

:root {
    --bg-primary: #000000;
    --bg-secondary: #0A0A0A;
    --bg-surface: #141414;
    --bg-surface-hover: #1a1a1a;
    --accent-primary: #8A4FFF;
    --accent-secondary: #4DA1FF;
    --accent-gradient: linear-gradient(135deg, #8A4FFF, #4DA1FF);
    --accent-gradient-hover: linear-gradient(135deg, #9B6AFF, #6DB4FF);
    --text-primary: #E4E6EB;
    --text-secondary: #A9B1D6;
    --text-muted: #64748B;
    --border-primary: rgba(229, 231, 235, 0.08);
    --border-accent: rgba(138, 79, 255, 0.25);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-head: 'Montserrat', sans-serif;
    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-glow: 0 0 30px rgba(138, 79, 255, 0.15);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── SPLIT SCREEN LAYOUT ─── */
.auth-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.auth-brand-side {
    flex: 1;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.auth-brand-side::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle at 30% 40%, rgba(138, 79, 255, 0.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(77, 161, 255, 0.08) 0%, transparent 40%);
    animation: brandGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes brandGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -20px) scale(1.05); }
}

.auth-brand-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 70%);
    pointer-events: none;
}

.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

/* ─── BRAND CONTENT ─── */
.brand-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

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

.brand-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-logo span {
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
}

.brand-heading {
    font-family: var(--font-head);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.brand-heading .hl {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 40px;
}

/* Feature list on brand side */
.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.brand-features li .feat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(138, 79, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* ─── FORM CARD (Glassmorphism) ─── */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 40px;
    position: relative;
    animation: cardEntry 0.6s ease-out;
}

@keyframes cardEntry {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.auth-card-header h2 {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-card-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ─── STEP PROGRESS ─── */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 12px rgba(138, 79, 255, 0.5);
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.step-line {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.4s ease;
}

.step-line.completed {
    background: var(--success);
}

/* ─── FORM STEPS ─── */
.form-step {
    display: none;
    animation: stepSlide 0.4s ease-out;
}

.form-step.active {
    display: block;
}

@keyframes stepSlide {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ─── SOCIAL BUTTONS ─── */
.social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

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

.social-divider span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

/* ─── INPUT GROUPS ─── */
.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    transition: color 0.3s;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    background: rgba(138, 79, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(138, 79, 255, 0.1);
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
    color: var(--accent-primary);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-text {
    color: var(--error);
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

.error-text.show {
    display: block;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Toggle password visibility */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 4px;
    transition: color 0.3s;
}

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

/* ─── PASSWORD STRENGTH ─── */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.strength-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.3s;
}

.strength-segment.weak { background: var(--error); }
.strength-segment.medium { background: var(--warning); }
.strength-segment.strong { background: var(--success); }

.strength-text {
    font-size: 12px;
    font-weight: 600;
    transition: color 0.3s;
}

.strength-text.weak { color: var(--error); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* ─── OTP INPUT ─── */
.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}

.otp-input {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    outline: none;
}

.otp-input:focus {
    border-color: var(--accent-primary);
    background: rgba(138, 79, 255, 0.05);
    box-shadow: 0 0 15px rgba(138, 79, 255, 0.2);
    transform: scale(1.05);
}

.otp-input.filled {
    border-color: var(--accent-primary);
    background: rgba(138, 79, 255, 0.08);
}

.otp-timer {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 12px;
}

.otp-timer span {
    color: var(--accent-primary);
    font-weight: 700;
}

.resend-otp {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-decoration: underline;
    font-family: var(--font-main);
}

.resend-otp:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    text-decoration: none;
}

/* ─── BUTTONS ─── */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient-hover);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(138, 79, 255, 0.35);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary span {
    position: relative;
    z-index: 1;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Loading spinner in button */
.btn-loading {
    pointer-events: none;
}

.btn-loading span {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 2;
}

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

/* ─── AUTH LINKS ─── */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: var(--accent-secondary);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-primary);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.remember-me input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.remember-me input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.remember-me span {
    font-size: 13px;
    color: var(--text-secondary);
}

.forgot-link {
    font-size: 13px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: var(--accent-secondary);
}

/* ─── ALERT/TOAST ─── */
.auth-alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: alertSlide 0.3s ease-out;
}

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

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

.auth-alert.error {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert.success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.auth-alert.info {
    background: rgba(138, 79, 255, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(138, 79, 255, 0.2);
}

/* ─── MARKETING CONSENT ─── */
.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
}

.consent-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid var(--border-primary);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 2px;
    position: relative;
}

.consent-check input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.consent-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.consent-check label {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    cursor: pointer;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-brand-side {
        padding: 40px 30px 30px;
        min-height: auto;
    }

    .brand-heading {
        font-size: 24px;
    }

    .brand-features {
        display: none;
    }

    .auth-form-side {
        padding: 20px;
    }

    .auth-card {
        padding: 30px 24px;
    }
}

@media (max-width: 480px) {
    .auth-brand-side {
        padding: 30px 20px 20px;
    }

    .brand-logo {
        margin-bottom: 20px;
    }

    .brand-subtitle {
        display: none;
    }

    .auth-form-side {
        padding: 16px;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
    }

    .otp-input {
        width: 44px;
        height: 52px;
        font-size: 20px;
    }

    .otp-container {
        gap: 6px;
    }
}

/* ─── RESET PASSWORD PAGE ─── */
.reset-centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
}

.reset-centered::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(138, 79, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* ─── SUCCESS STATE ─── */
.success-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
