:root {
    /* --- Modern Luxury Palette --- */
    --primary-bg: #F0F2F5; /* کمی تیره‌تر برای کنتراست بهتر با کارت سفید */
    --card-surface: rgba(255, 255, 255, 0.90);
    --glass-surface: rgba(255, 255, 255, 0.65);

    /* Typography */
    --text-primary: #1A1A1A;
    --text-secondary: #64748B;
    --text-placeholder: #94A3B8;

    /* Brand Colors (Gold/Champagne) */
    --accent-color: #C5A059;
    --accent-hover: #B08D4C;
    --accent-light: rgba(197, 160, 89, 0.1);
    
    /* Borders & Shadows */
    --border-light: rgba(197, 160, 89, 0.25);
    --border-focus: rgba(197, 160, 89, 0.5);
    
    /* سایه‌های چند لایه برای عمق دادن (Elevation) */
    --shadow-card: 
        0 20px 40px -10px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(197, 160, 89, 0.05);
    --shadow-input-focus: 0 0 0 4px rgba(197, 160, 89, 0.15);

    /* Utils */
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* فونت پیش‌فرض سیستم یا فونت فارسی دلخواه شما */
}

/* --- Layout --- */
.auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background-color: var(--primary-bg);
    margin-top: -5rem;
}

/* Background Image with Overlay */
.auth-main::before {
    content: "";
    position: absolute;
    inset: -20px; /* جلوگیری از لبه سفید هنگام بلر */
    background: url('/assets/img/hero-bg.webp') center/cover no-repeat;
    filter: blur(8px) brightness(0.9);
    z-index: 0;
    transform: scale(1.05); /* زوم برای حذف لبه‌های بلر شده */
}

.auth-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 650px;
    background: var(--card-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    
    /* انیمیشن ورود کل کارت */
    animation: slideUpFade 0.8s ease-out;
}

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

/* --- Left Column (Visual) --- */
.visual-side {
    flex: 0 0 45%; /* کمی عریض‌تر */
    position: relative;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    overflow: hidden;
}

/* تصویر سمت چپ با افکت تاریک ملایم */
.visual-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/assets/img/auth.webp') center/cover no-repeat;
    transition: transform 10s ease; /* افکت زوم خیلی آرام */
}

.visual-side:hover::before {
    transform: scale(1.1);
}

/* گرادینت روی عکس برای خوانایی متن */
.visual-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    z-index: 1;
}

.visual-side > * {
    position: relative;
    z-index: 2;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 50px;
    transition: var(--transition);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(5px); /* حرکت ریز در هاور */
}

.visual-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.visual-content p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 90%;
}

/* --- Right Column (Form) --- */
.form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px;
    background: rgba(255, 255, 255, 0.4); /* Glassmorphism خیلی ملایم */
    backdrop-filter: blur(20px);
}

#auth-form-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Header */
.auth-header {
    text-align: right;
    margin-bottom: 35px;
}

.auth-header h2 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.link-accent {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.link-accent:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* استایل جدید اینپوت‌ها */
.form-group input:not([type="checkbox"]) {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-primary);
    background: #FFFFFF;
    border: 1px solid #E2E8F0; /* بوردر خاکستری خنثی */
    border-radius: var(--radius-md);
    transition: var(--transition);
}

/* افکت فوکوس حرفه‌ای */
.form-group input:not([type="checkbox"]):focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--shadow-input-focus);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-placeholder);
}

/* Password Eye */
.password-input-group {
    position: relative;
}

.password-input-group input {
    padding-left: 45px !important;
}

.password-input-group .toggle-password {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    font-size: 1.1rem;
}

.password-input-group .toggle-password:hover {
    color: var(--accent-color);
}

/* Checkbox Styling */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2px solid var(--border-light);
    border-radius: 5px;
    appearance: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    background: white;
}

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

.checkbox-group input[type="checkbox"]:checked::after {
    content: '\f00c'; /* آیکون FontAwesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: white;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-options {
    display: flex;
    justify-content: space-between; /* پخش کردن فاصله */
    align-items: center;
    margin-bottom: 25px;
}

.link-plain {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* --- Buttons --- */
.auth-button.primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.auth-button.primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.4);
    transform: translateY(-2px);
}

.auth-button.primary:active:not(:disabled) {
    transform: translateY(0);
}

.auth-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Separator */
.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E2E8F0;
}

.separator::before { margin-left: 15px; }
.separator::after { margin-right: 15px; }

/* Social Buttons */
.social-login-group {
    display: grid;
    width: 100%;
    gap: 15px;
}

.social-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.social-button:hover {
    border-color: var(--accent-color);
    background: var(--accent-light);
    color: var(--accent-hover);
    transform: translateY(-2px);
}

/* Switch Mode Tab */
.switch-mode-group {
    display: flex;
    justify-content: center;
    background: #F8FAFC;
    padding: 5px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.switch-mode-link {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.switch-mode-link.active {
    background: white;
    color: var(--accent-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-weight: 700;
}

.switch-mode-link.active::after { display: none; } /* حذف خط زیرین قدیمی */

/* Alerts */
.alert-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-message.danger {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-message.success {
    background-color: #F0FDF4;
    color: #166534;
    border: 1px solid #86EFAC;
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
    .auth-wrapper {
        min-height: auto;
        flex-direction: column;
        max-width: 500px; /* کارت در تبلت باریک‌تر شود */
    }
    
    .visual-side {
        display: none; /* پنهان کردن عکس در تبلت/موبایل */
    }
    
    .form-side {
        padding: 40px 30px;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 15px;
        align-items: flex-start; /* در موبایل فرم بالاتر قرار بگیرد */
        padding-top: 40px;
    }

    .auth-wrapper {
        border-radius: 20px;
    }

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

    .auth-header h2 {
        font-size: 1.6rem;
    }

    .social-login-group {
        grid-template-columns: 1fr; /* دکمه‌های سوشال زیر هم */
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
