﻿/* ========================================
   AUTH PAGES - PREMIUM STYLES
   Login, Register, and authentication pages
   ======================================== */

/* ===== BASE RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color .2s;
}

.back-link:hover { color: #111827; }

/* ===== 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(14, 165, 233, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(129, 140, 248, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(52, 211, 153, 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, #0ea5e9 0%, #0284c7 50%, #0369a1 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);
    font-size: 2.8rem;
}

.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, #0ea5e9, #0284c7);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
    color: #fff;
    font-size: 2rem;
}

.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: #0ea5e9;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.auth-input.input-validation-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.auth-input.input-validation-error: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: #0ea5e9;
}

.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,
.field-validation-error {
    display: block;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #ef4444;
}

/* ===== 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: #0ea5e9;
    border-color: #0ea5e9;
    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, #0ea5e9, #0284c7);
    color: #fff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===== 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: #0ea5e9;
}

.auth-link a {
    color: #0ea5e9;
    font-weight: 600;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ===== HINT BOX ===== */
.auth-hint {
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
    margin-top: 20px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.auth-hint code {
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: #374151;
}

/* ===== ALERT STYLES ===== */
.auth-alert,
.validation-summary-errors {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.auth-alert-danger,
.validation-summary-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.validation-summary-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-summary-valid {
    display: none;
}

/* ===== 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: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.auth-loading-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
    color: #fff;
    font-size: 2rem;
}

.auth-loading-ring {
    position: absolute;
    inset: 0;
    border: 4px solid #e5e7eb;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: authSpin 1s linear infinite;
}

.auth-loading-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.auth-loading-subtext {
    font-size: 0.875rem;
    color: #6b7280;
    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;
    }
}
