/*
 * Authentication Pages Styles (Login/Register)
 * Extends theme-base.css for auth-specific styling
 */

/* ==========================================
   Auth Page Layout
   ========================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-bg, linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2a2a2a 100%));
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-white, #ffffff);
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

/* Animated background particles for auth */
.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(var(--primary-rgb, 220, 38, 38), 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(var(--primary-rgb, 220, 38, 38), 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(var(--primary-rgb, 220, 38, 38), 0.05) 0%, transparent 50%);
    animation: authBackgroundShift 20s ease-in-out infinite;
    z-index: -2;
}

@keyframes authBackgroundShift {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); }
    25% { transform: translateX(-20px) translateY(-10px) scale(1.1); }
    50% { transform: translateX(10px) translateY(-20px) scale(0.9); }
    75% { transform: translateX(-10px) translateY(10px) scale(1.05); }
}

/* Floating particles for auth pages */
.auth-page .particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--primary, #dc2626);
    border-radius: 50%;
    opacity: 0.6;
    animation: authFloat 15s infinite linear;
    z-index: -1;
}

.auth-page .particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.auth-page .particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 18s; }
.auth-page .particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 15s; }
.auth-page .particle:nth-child(4) { left: 40%; animation-delay: 6s; animation-duration: 20s; }
.auth-page .particle:nth-child(5) { left: 50%; animation-delay: 8s; animation-duration: 14s; }
.auth-page .particle:nth-child(6) { left: 60%; animation-delay: 10s; animation-duration: 16s; }
.auth-page .particle:nth-child(7) { left: 70%; animation-delay: 12s; animation-duration: 13s; }
.auth-page .particle:nth-child(8) { left: 80%; animation-delay: 14s; animation-duration: 17s; }
.auth-page .particle:nth-child(9) { left: 90%; animation-delay: 16s; animation-duration: 19s; }

@keyframes authFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* ==========================================
   Auth Container
   ========================================== */
.auth-container {
    max-width: 480px;
    width: 100%;
    padding: 20px;
}

/* ==========================================
   Auth Card
   ========================================== */
.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(var(--primary-rgb, 220, 38, 38), 0.3);
    padding: 60px 50px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: authCardEntrance 0.8s ease-out;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--primary, #dc2626),
        var(--primary-light, #ff4444),
        var(--primary, #dc2626));
    background-size: 200% 100%;
    animation: authGradientSlide 3s linear infinite;
}

@keyframes authCardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes authGradientSlide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   Auth Header
   ========================================== */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    font-size: 3rem;
    color: var(--primary, #dc2626);
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(var(--primary-rgb, 220, 38, 38), 0.5));
    animation: authLogoPulse 3s ease-in-out infinite;
}

@keyframes authLogoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(var(--primary-rgb, 220, 38, 38), 0.5)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 30px rgba(var(--primary-rgb, 220, 38, 38), 0.8)); }
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-white, #fff);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* ==========================================
   Auth Form
   ========================================== */
.auth-form .form-group {
    margin-bottom: 24px;
}

.auth-form .form-label {
    display: block;
    font-weight: 600;
    color: var(--text-white, #fff);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.auth-form .form-control {
    width: 100%;
    padding: 16px 20px;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid rgba(var(--primary-rgb, 220, 38, 38), 0.2);
    border-radius: 14px;
    color: var(--text-white, #fff);
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary, #dc2626);
    background: rgba(30, 30, 30, 0.95);
    box-shadow:
        0 0 0 4px rgba(var(--primary-rgb, 220, 38, 38), 0.2),
        0 0 20px rgba(var(--primary-rgb, 220, 38, 38), 0.2);
    transform: translateY(-2px);
}

/* ==========================================
   Auth Buttons
   ========================================== */
.auth-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary, #dc2626), var(--primary-dark, #b91c1c));
    border: none;
    border-radius: 14px;
    color: var(--text-white, #fff);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb, 220, 38, 38), 0.4);
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.auth-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 10px 30px rgba(var(--primary-rgb, 220, 38, 38), 0.5),
        0 0 30px rgba(var(--primary-rgb, 220, 38, 38), 0.3);
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   Social Auth Buttons
   ========================================== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: rgba(255, 255, 255, 0.5);
}

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

.auth-divider span {
    padding: 0 20px;
    font-size: 0.9rem;
}

.social-auth-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-white, #fff);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

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

.social-auth-btn i {
    font-size: 1.2rem;
}

/* ==========================================
   Auth Footer Links
   ========================================== */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.7);
}

.auth-footer a {
    color: var(--primary, #dc2626);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-light, #ff4444);
    text-shadow: 0 0 10px rgba(var(--primary-rgb, 220, 38, 38), 0.5);
}

/* ==========================================
   Auth Alerts
   ========================================== */
.auth-alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-alert.error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.5);
    color: #ff6b6b;
}

.auth-alert.success {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.5);
    color: #4ade80;
}

.auth-alert.warning {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.5);
    color: #fbbf24;
}

/* ==========================================
   Remember Me & Forgot Password
   ========================================== */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #dc2626);
    cursor: pointer;
}

.auth-checkbox label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary, #dc2626);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-light, #ff4444);
}

/* ==========================================
   Responsive Auth
   ========================================== */
@media (max-width: 576px) {
    .auth-card {
        padding: 40px 24px;
        border-radius: 20px;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    .auth-logo {
        font-size: 2.5rem;
    }

    .auth-form .form-control {
        padding: 14px 16px;
    }

    .auth-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================
   Password Strength Indicator
   ========================================== */
.password-strength {
    margin-top: 8px;
}

.password-strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-fill.weak {
    width: 25%;
    background: #ef4444;
}

.password-strength-fill.fair {
    width: 50%;
    background: #f59e0b;
}

.password-strength-fill.good {
    width: 75%;
    background: #3b82f6;
}

.password-strength-fill.strong {
    width: 100%;
    background: #22c55e;
}

.password-strength-text {
    font-size: 0.8rem;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================
   Loading State
   ========================================== */
.auth-loading {
    position: relative;
    pointer-events: none;
}

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

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

