/* ============================================
   AUTH.CSS - Login / Signup Page
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ---- Left Panel (Branding) ---- */
.auth-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
    background: var(--bg-surface);
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 60%);
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03), transparent 60%);
    pointer-events: none;
}

.brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 1;
    /* Removed automatic animation to prevent black screen on Safari if animation fails */
}

.brand-content.animate {
    animation: fade-up 0.6s ease forwards;
}

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

.brand-logo-icon {
    width: 48px;
    height: 48px;
    background: transparent;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.brand-logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-tagline {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
}

.brand-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 380px;
    margin-bottom: 48px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.brand-feature-icon {
    width: 32px;
    height: 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-light);
}

.brand-stats {
    display: flex;
    gap: 32px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.brand-stat-value {
    font-size: 28px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Floating Cards Preview ---- */
.floating-preview {
    position: absolute;
    bottom: 60px;
    right: 60px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: float 5s ease-in-out infinite;
}

.preview-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.preview-card-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Right Panel (Form) ---- */
.auth-form-panel {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 48px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    position: relative;
}

.auth-form-container {
    width: 100%;
    max-width: 360px;
    /* Removed 'both' and automatic animation to ensure content is visible if JS/Safari hangs */
}

.auth-form-container.animate {
    animation: fade-up 0.5s ease 0.1s forwards;
}

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

.auth-logo-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.auth-logo-mobile .brand-logo-icon {
    width: 40px;
    height: 40px;
}

.auth-logo-mobile .brand-logo-text {
    font-size: 20px;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

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

/* ---- Tabs ---- */
.auth-tabs {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 32px;
    position: relative;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-base);
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.auth-tab.active {
    color: var(--text-primary);
}

.auth-tab-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    background: var(--bg-card);
    border-radius: calc(var(--radius-md) - 4px);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid var(--border);
}

/* ---- Form ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form-section {
    display: none;
}

.auth-form-section.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-input-wrapper {
    position: relative;
}

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

.form-input-wrapper .form-input {
    padding-left: 44px;
}

.form-input-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    background: none;
    border: none;
}

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

.auth-btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

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

/* ---- Social Buttons ---- */
.auth-social {
    display: flex;
    gap: 10px;
}

.btn-social {
    flex: 1;
    padding: 11px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-base);
    cursor: pointer;
}

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

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

.auth-link {
    color: var(--primary-light);
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.auth-link:hover {
    color: var(--primary);
}

/* ---- Terms ---- */
.auth-terms {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    line-height: 1.6;
}

.auth-terms a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--border);
}

/* ---- Error / Success Message ---- */
.auth-message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: none;
    animation: fade-in 0.3s ease;
}

.auth-message.show {
    display: block;
}

.auth-message.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-message.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

    .auth-brand {
        padding: 40px 24px;
    }

    .auth-brand::before,
    .auth-brand::after {
        display: none;
        /* Remove huge glowing backgrounds on mobile to avoid layout stretch */
    }

    .brand-tagline {
        font-size: 32px;
    }

    .brand-stats {
        margin-top: 32px;
        padding-top: 24px;
        flex-wrap: wrap;
        gap: 20px;
    }

    .floating-preview {
        display: none;
    }

    .auth-form-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 40px 24px 80px;
    }

    .auth-logo-mobile {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-form-panel {
        padding: 24px 16px;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .auth-title {
        font-size: 24px;
    }
}