/* ------------------- CSS Variables برای تم ------------------- */
:root {
    --bg-gradient-start: #1a2980;
    --bg-gradient-end: #26d0ce;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent-primary: #667eea;
    --accent-success: #51cf66;
    --accent-danger: #ff6b6b;
    --blur-amount: 12px;
    --hover-bg: rgba(255, 255, 255, 0.15);
}

html.dark-mode {
    --bg-gradient-start: #0f1a3a;
    --bg-gradient-end: #1a2a4a;
    --glass-bg: rgba(0, 0, 0, 0.25);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-muted: rgba(224, 224, 224, 0.5);
    --accent-primary: #4a5fcf;
    --hover-bg: rgba(255, 255, 255, 0.05);
}

/* ------------------- تنظیمات پایه ------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
    color: var(--text-primary);
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ------------------- افکت‌های پس‌زمینه ------------------- */
.bg-circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    animation: float 20s infinite ease-in-out;
}

.circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 5s;
}

.circle:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(20px, -20px) scale(0.9);
    }
}

/* ------------------- کانتینر اصلی ------------------- */
.login-container {
    width: 100%;
    max-width: 450px;
    z-index: 1;
}

/* ------------------- کارت شیشه‌ای ------------------- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    padding: 40px 30px;
    transition: all 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.5);
}

/* ------------------- دکمه تم ------------------- */
.theme-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--hover-bg);
}

/* ------------------- لوگو و عنوان ------------------- */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 90px;
    height: 90px;
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-primary);
    border: 2px solid var(--glass-border);
    transition: all 0.3s ease;
}

.title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 300;
}

/* ------------------- فرم ورود ------------------- */
.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all 0.3s ease;
    z-index: 2;
}

.form-control {
    width: 100%;
    padding: 15px 45px 15px 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:focus+.input-icon {
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}

.form-control.error {
    border-color: var(--accent-danger);
    background: rgba(231, 76, 60, 0.1);
}

.form-control.success {
    border-color: var(--accent-success);
    background: rgba(46, 204, 113, 0.1);
}

/* ------------------- چک‌باکس ------------------- */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    margin-left: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked+.custom-checkbox {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-wrapper input[type="checkbox"]:checked+.custom-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 14px;
    user-select: none;
    transition: all 0.3s ease;
}

/* ------------------- دکمه ورود ------------------- */
.login-btn {
    width: 100%;
    padding: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ------------------- لینک فراموشی رمز ------------------- */
.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-password a:hover {
    color: var(--text-primary);
}

/* ------------------- پیام‌های بازخورد ------------------- */
.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    display: none;
    align-items: center;
    backdrop-filter: blur(5px);
    border: 1px solid;
}

.alert.show {
    display: flex;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: rgba(231, 76, 60, 0.2);
    border-color: var(--accent-danger);
}

.alert-success {
    background: rgba(46, 204, 113, 0.2);
    border-color: var(--accent-success);
}

/* ------------------- لودینگ ------------------- */
.loading-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.spinner {
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--text-primary);
}

/* ------------------- ریسپانسیو ------------------- */
@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
    }

    .glass-card {
        padding: 30px 20px;
    }

    .title {
        font-size: 24px;
    }

    .logo {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }

    .theme-toggle {
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

}

/* ------------------- افکت‌های اضافی ------------------- */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}