/* ============================================= */
/* تنظیمات پایه و متغیرها */
/* ============================================= */
:root {
    /* رنگ‌های قرمز (تم اصلی) */
    --primary-color: #dc3545;
    --primary-dark: #c82333;
    --primary-light: #f8d7da;
    --primary-gradient: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    
    /* رنگ‌های ثانویه */
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* رنگ‌های خنثی */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #e9ecef;
    --dark-gray: #495057;
    --black: #212529;
    
    /* سایه‌ها */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --shadow-primary: 0 4px 15px rgba(220, 53, 69, 0.3);
    
    /* بوردر */
    --border-radius: 12px;
    --border-radius-lg: 20px;
    
    /* فونت */
    --font-family: 'Vazirmatn', sans-serif;
}

/* ============================================= */
/* ریست و تنظیمات عمومی */
/* ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 50%, #fff5f5 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================= */
/* حباب‌های پس‌زمینه انیمیشنی */
/* ============================================= */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(220, 53, 69, 0.1) 0%, 
        rgba(220, 53, 69, 0.05) 100%);
    animation: float 15s infinite ease-in-out;
}

.bubble:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 20%;
    right: 15%;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 100px;
    height: 100px;
    bottom: 15%;
    right: 10%;
    animation-delay: 6s;
}

.bubble:nth-child(5) {
    width: 50px;
    height: 50px;
    top: 50%;
    left: 5%;
    animation-delay: 8s;
}

.bubble:nth-child(6) {
    width: 90px;
    height: 90px;
    top: 70%;
    right: 25%;
    animation-delay: 10s;
}

.bubble:nth-child(7) {
    width: 70px;
    height: 70px;
    top: 5%;
    right: 40%;
    animation-delay: 12s;
}

.bubble:nth-child(8) {
    width: 110px;
    height: 110px;
    bottom: 5%;
    left: 40%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0.8;
    }
}

/* ============================================= */
/* صفحه ورود */
/* ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* ============================================= */
/* کارت ورود */
/* ============================================= */
.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 45px 40px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================= */
/* هدر */
/* ============================================= */
.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-primary);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.05);
}

.login-logo i {
    font-size: 36px;
    color: var(--white);
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ============================================= */
/* فرم */
/* ============================================= */
.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.form-label i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* ============================================= */
/* اینپوت‌ها */
/* ============================================= */
.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 15px 45px 15px 18px;
    border: 2px solid var(--gray);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light-gray);
}

.form-input:hover {
    border-color: #d0d0d0;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.form-input.error {
    border-color: var(--danger-color) !important;
    background: #fff5f5;
    animation: shake 0.5s ease;
}

.form-input.success {
    border-color: var(--success-color) !important;
    background: #f0fff4;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

/* دکمه نمایش رمز */
.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* پیام خطا */
.error-message {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 8px;
}

.error-message.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================= */
/* گزینه‌ها */
/* ============================================= */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

/* چک‌باکس سفارشی */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--secondary-color);
    user-select: none;
}

.checkbox-wrapper input {
    display: none;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: var(--light-gray);
}

.custom-checkbox i {
    font-size: 12px;
    color: transparent;
    transition: all 0.3s ease;
}

.checkbox-wrapper input:checked + .custom-checkbox {
    background: var(--primary-gradient);
    border-color: transparent;
}

.checkbox-wrapper input:checked + .custom-checkbox i {
    color: white;
}

/* لینک فراموشی */
.forgot-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================= */
/* دکمه ورود */
/* ============================================= */
.login-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--primary-gradient);
    color: white;
    font-family: var(--font-family);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
}

.login-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.5s ease;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text,
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-loader {
    display: none;
}

.btn-loader.show {
    display: flex;
}

.btn-text.hidden {
    display: none;
}

/* ============================================= */
/* لینک ثبت‌نام */
/* ============================================= */
.register-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--gray);
}

.register-link p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.register-link a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* لینک بازگشت */
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--secondary-color);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-color);
}

/* ============================================= */
/* مودال موفقیت */
/* ============================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 45px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    max-width: 350px;
    width: 90%;
    animation: slideUp 0.5s ease;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
}

.modal-icon.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: var(--success-color);
}

.modal-icon i {
    font-size: 40px;
}

.modal-content h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--success-color);
    margin-bottom: 10px;
}

.modal-content p {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* نوار لودینگ */
.loading-bar {
    width: 100%;
    height: 6px;
    background: var(--gray);
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress {
    width: 0;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    animation: loadingProgress 1.5s ease forwards;
}

@keyframes loadingProgress {
    from { width: 0; }
    to { width: 100%; }
}

/* ============================================= */
/* کلاس‌های کمکی */
/* ============================================= */
.hidden {
    display: none !important;
}

/* ============================================= */
/* ریسپانسیو */
/* ============================================= */
@media (max-width: 500px) {
    .login-card {
        padding: 35px 25px;
        border-radius: 25px;
        margin: 15px;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
    
    .login-logo {
        width: 70px;
        height: 70px;
    }
    
    .login-logo i {
        font-size: 30px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .login-btn {
        font-size: 1rem;
        padding: 14px;
    }
}