﻿/* ========================================
   AUTH PAGES - PREMIUM STYLES
   Login, Register, and authentication pages
   ======================================== */

/* ===== BASE LAYOUT ===== */
.auth-page {
    min-height: 100dvh;
    display: flex;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

/* Animated background pattern */
.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
    animation: authBgFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes authBgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(0, 4%) rotate(0deg); }
    75% { transform: translate(-2%, 2%) rotate(-1deg); }
}

/* ===== SPLIT LAYOUT ===== */
.auth-split {
    display: flex;
    width: 100%;
    min-height: 100dvh;
}

.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.auth-right {
    flex: 1;
    display: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .auth-right {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Right panel decoration */
.auth-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.auth-right-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    padding: 48px;
    max-width: 480px;
}

.auth-right-logo {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.auth-right-logo img {
    max-width: 72px;
    max-height: 72px;
}

.auth-right-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-right-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 40px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
}

.auth-feature i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1rem;
}

/* ===== AUTH CARD ===== */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 12px 24px rgba(0, 0, 0, 0.04),
        0 24px 48px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: authCardSlideIn 0.5s ease-out;
}

@keyframes authCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Header */
.auth-card-header {
    padding: 32px 32px 0;
    text-align: center;
}

.auth-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.auth-logo img {
    max-width: 52px;
    max-height: 52px;
}

.auth-logo i {
    font-size: 2rem;
    color: #fff;
}

.auth-title {
    font-size: 1.625rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

/* Card Body */
.auth-card-body {
    padding: 32px;
}

/* ===== FORM ELEMENTS ===== */
.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.auth-form-group label i {
    margin-right: 6px;
    color: #6b7280;
    font-size: 0.8125rem;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    padding-left: 46px;
    font-size: 0.9375rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    color: #111827;
    transition: all 0.2s ease;
}

.auth-input:hover {
    border-color: #d1d5db;
}

.auth-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.auth-input.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.auth-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input:focus + .auth-input-icon,
.auth-input:focus ~ .auth-input-icon {
    color: #3b82f6;
}

.auth-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    transition: color 0.2s;
}

.auth-toggle-password:hover {
    color: #6b7280;
}

/* Validation message */
.auth-validation-message {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #ef4444;
}

.auth-validation-message i {
    font-size: 0.75rem;
}

/* ===== PASSWORD STRENGTH INDICATOR ===== */
.password-strength {
    margin-top: 12px;
}

.password-strength-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.password-strength-fill.weak { width: 25%; background: #ef4444; }
.password-strength-fill.fair { width: 50%; background: #f59e0b; }
.password-strength-fill.good { width: 75%; background: #10b981; }
.password-strength-fill.strong { width: 100%; background: #059669; }

.password-strength-text {
    font-size: 0.75rem;
    font-weight: 600;
}

.password-strength-text.weak { color: #ef4444; }
.password-strength-text.fair { color: #f59e0b; }
.password-strength-text.good { color: #10b981; }
.password-strength-text.strong { color: #059669; }

.password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
}

.password-requirement {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #9ca3af;
    transition: color 0.2s;
}

.password-requirement i {
    font-size: 0.625rem;
}

.password-requirement.met {
    color: #10b981;
}

/* ===== CHECKBOX ===== */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background: #fff;
}

.auth-checkbox:checked {
    background: #3b82f6;
    border-color: #3b82f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-checkbox-label {
    font-size: 0.875rem;
    color: #4b5563;
    cursor: pointer;
}

/* ===== BUTTONS ===== */
.auth-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-secondary {
    background: #fff;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.auth-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* ===== DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: #9ca3af;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ===== SOCIAL BUTTONS ===== */
.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.auth-social-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.auth-social-btn i {
    font-size: 1.25rem;
}

.auth-social-btn.google i { color: #ea4335; }
.auth-social-btn.microsoft i { color: #00a4ef; }
.auth-social-btn.github i { color: #333; }

/* ===== LINKS ===== */
.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}

.auth-link {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #3b82f6;
}

.auth-link strong {
    color: #3b82f6;
    font-weight: 600;
}

.auth-link strong:hover {
    text-decoration: underline;
}

/* ===== ALERT STYLES ===== */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.auth-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.auth-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
}

.auth-alert i {
    font-size: 1rem;
    margin-top: 2px;
}

/* ===== LOADING SPINNER ===== */
.auth-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: authSpin 0.8s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* ===== LOADING OVERLAY ===== */
.auth-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    place-items: center;
    z-index: 9999;
}

.auth-loading-overlay.show {
    display: grid;
}

.auth-loading-content {
    text-align: center;
}

.auth-loading-spinner-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
}

.auth-loading-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.auth-loading-logo img {
    max-width: 60px;
    max-height: 60px;
}

.auth-loading-ring {
    position: absolute;
    inset: 0;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: authSpin 1s linear infinite;
}

.auth-loading-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.auth-loading-subtext {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .auth-left {
        padding: 24px 16px;
    }
    
    .auth-card {
        border-radius: 20px;
    }
    
    .auth-card-header {
        padding: 24px 24px 0;
    }
    
    .auth-card-body {
        padding: 24px;
    }
    
    .auth-title {
        font-size: 1.375rem;
    }
    
    .password-requirements {
        grid-template-columns: 1fr;
    }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .auth-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

[data-theme="dark"] .auth-page::before {
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
}

[data-theme="dark"] .auth-card {
    background: #1e293b;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 12px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .auth-title {
    color: #f1f5f9;
}

[data-theme="dark"] .auth-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .auth-form-group label {
    color: #e2e8f0;
}

[data-theme="dark"] .auth-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .auth-input:hover {
    border-color: #475569;
}

[data-theme="dark"] .auth-input:focus {
    background: #0f172a;
    border-color: #3b82f6;
}

[data-theme="dark"] .auth-input-icon {
    color: #64748b;
}

[data-theme="dark"] .auth-checkbox {
    background: #0f172a;
    border-color: #475569;
}

[data-theme="dark"] .auth-checkbox-label {
    color: #cbd5e1;
}

[data-theme="dark"] .auth-btn-secondary {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .auth-btn-secondary:hover {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .auth-divider {
    color: #64748b;
}

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    background: #334155;
}

[data-theme="dark"] .auth-social-btn {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .auth-social-btn:hover {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .auth-links {
    border-top-color: #334155;
}

[data-theme="dark"] .auth-link {
    color: #94a3b8;
}

[data-theme="dark"] .auth-loading-overlay {
    background: rgba(15, 23, 42, 0.95);
}

[data-theme="dark"] .auth-loading-logo {
    background: #1e293b;
}

[data-theme="dark"] .auth-loading-text {
    color: #f1f5f9;
}

[data-theme="dark"] .auth-loading-ring {
    border-color: #334155;
    border-top-color: #3b82f6;
}
