/* تعریف فونت و متغیرها */
@font-face {
    font-family: 'Yekan';
    src: url('../../fonts/Yekan.woff2') format('woff2'),
         url('../../fonts/Yekan.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #699b98;
    --secondary-color: #6b9b7c;
    --text-color: #fff;
    --glass-opacity: 0.15;
    --glass-blur: blur(15px);
    --transition: all 0.3s ease;
    --border-light: rgba(255, 255, 255, 0.2);
    --font-family: 'Yekan', Tahoma, sans-serif;
}

/* ریست استایل‌ها */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    font-family: var(--font-family);
    min-height: 100vh;
    color: var(--text-color);
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
                url('../../images/holyshrine.jpeg') no-repeat center center/cover;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
}

/* چیدمان اصلی */
.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    gap: 2rem;
}

/* لوگو */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* کانتینر فرم‌ها */
.auth-forms-container {
    position: relative;
    width: 100%;
    max-width: 340px; /* تغییر یافته: از 450px به 380px */
    min-height: 500px; /* تغییر یافته: از 500px به 450px */
}

/* استایل عمومی فرم‌ها */
.login-form {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.login-form.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* کارت شیشه‌ای */
.glass-card {
    background: rgba(255, 255, 255, var(--glass-opacity));
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 1.2rem; /* تغییر یافته: از 1.5rem به 1.2rem */
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    max-height: 85vh; /* تغییر یافته: از 90vh به 85vh */
    overflow-y: auto;
}

h1 {
    font-size: 1.5rem; /* تغییر یافته: از 1.8rem به 1.5rem */
    margin-bottom: 1rem; /* تغییر یافته: از 1.5rem به 1rem */
    text-align: center;
}

/* فیلدهای فرم */
.form-group {
    margin-bottom: 1rem; /* تغییر یافته: از 1.2rem به 1rem */
    text-align: right;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* فیلدهای متنی */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 1rem;
}

/* حالت فوکوس */
select:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(105, 155, 152, 0.3);
}

/* فیلد رمز عبور */
.password-field {
    position: relative;
}

.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
}


/* دکمه‌ها */
.glass-btn {
    background: rgba(105, 155, 152, 0.7);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
    padding: 10px; /* تغییر یافته: از 12px به 10px */
    width: 100%;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.8rem; /* تغییر یافته: از 1rem به 0.8rem */
}

.glass-btn:hover {
    background: rgba(105, 155, 152, 0.9);
    transform: translateY(-3px);
}

/* لودینگ */
#loader {
    display: none;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* استایل پیغام خطا */
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* رسپانسیو برای دسکتاپ و تبلت */
@media (min-width: 768px) {
    .login-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 4rem;
    }

    .logo-container {
        flex: 1;
        max-width: 40%;
    }

    .auth-forms-container {
        flex: 1;
        max-width: 50%;
    }

    .logo {
        max-height: 400px;
    }
}

/* رسپانسیو برای موبایل */
@media (max-width: 767px) {
    .login-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }

    .auth-forms-container {
        max-width: 90%; /* تغییر یافته: از 95% به 90% */
    }

    .logo-container {
        max-width: 80%;
    }

    .glass-card {
        padding: 1rem;
    }

    /* تنظیمات فیلدها برای موبایل */
    select, input {
        padding: 10px;
        font-size: 0.9rem;
    }

    .glass-btn {
        padding: 10px;
    }

    h1 {
        font-size: 1rem;
        margin-top: -1.1rem;
    }
}

/* موبایل‌های کوچک */
@media (max-width: 480px) {
    .logo {
        max-width: 200px;
    }

    .glass-card {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }
}
