@font-face {
    font-family: 'Vazirmatn';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
body {
    font-family: 'Vazirmatn', sans-serif;
    margin: 0;
    background-color: #f4f7f9;
    color: #343a40;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.main-content-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* --- Header Styles --- */
.main-header { background-color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 1000; }
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; max-width: 1400px; margin: 0 auto; }
.logo { font-size: 28px; font-weight: bold; color: #0d6efd; }
.logo a { text-decoration: none; color: inherit; }
.main-nav { display: flex; align-items: center; gap: 25px; }
.main-nav a { text-decoration: none; color: #495057; font-size: 16px; padding-bottom: 5px; border-bottom: 2px solid transparent; transition: all 0.3s ease; }
.main-nav a:hover, .main-nav a.active { color: #0d6efd; border-bottom-color: #0d6efd; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.header-actions .btn { padding: 8px 20px; border-radius: 6px; text-decoration: none; font-size: 15px; transition: all 0.3s ease; }
.header-actions .btn-login { background-color: #0d6efd; color: #fff; }
.header-actions .btn-login:hover { background-color: #0b5ed7; }
.hamburger-menu { display: none; font-size: 24px; cursor: pointer; }

/* --- Login Page Wrapper --- */
.page-wrapper {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 80vh;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}
.login-section, .slideshow-section {
    width: 50%;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Slideshow Corrected Styles --- */
.slideshow-section {
    background-color: #f8fafc;
    padding: 0;
}
.slideshow-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}
/* اسلایدها به صورت پیش‌فرض مخفی هستند */
.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    animation: fadeEffect 1.5s;
}
/* فقط اسلایدی که کلاس active دارد نمایش داده می‌شود */
.slide.active {
    display: block;
}
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 15px;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
    z-index: 10;
}

/* --- Form Styles --- */
.login-container { animation: fadeIn 1s ease-in-out; }
.login-container h2 { text-align: center; margin-bottom: 30px; color: #1e293b; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #475569; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; }
.captcha-group { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.captcha-group img { border-radius: 8px; cursor: pointer; }
.submit-btn { width: 100%; padding: 12px; background-color: #4f46e5; color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.form-links { text-align: center; margin-top: 20px; font-size: 14px; }
.form-links a { color: #4f46e5; text-decoration: none; }
#ajax-message { padding: 15px; margin-bottom: 20px; border-radius: 5px; display: none; text-align: center; }
#ajax-message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#ajax-message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Footer Styles --- */
.main-footer { background-color: #212529; color: #adb5bd; padding: 40px 5%; }
.footer-container { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.footer-col h4 { color: #fff; margin-bottom: 20px; position: relative; padding-bottom: 10px; }
.footer-col h4::after { content: ''; position: absolute; right: 0; bottom: 0; width: 50px; height: 2px; background-color: #0d6efd; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li a { text-decoration: none; color: #adb5bd; }
.social-links a { display: inline-block; width: 40px; height: 40px; line-height: 40px; text-align: center; background-color: #343a40; color: #fff; border-radius: 50%; margin-left: 10px; }
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 20px; border-top: 1px solid #343a40; font-size: 13px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeEffect { from { opacity: 0.4; } to { opacity: 1; } }

/* --- Responsive Styles (Mobile View) - FINAL FIX --- */
@media (max-width: 992px) {
    .main-nav { display: none; flex-direction: column; position: absolute; top: 75px; right: 0; width: 100%; background-color: #fff; padding: 20px 0; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
    .main-nav.active { display: flex; }
    .hamburger-menu { display: block; }
    .page-wrapper { flex-direction: column; min-height: auto; margin: 20px; max-width: 500px; }
    .login-section, .slideshow-section { width: 100%; padding: 0; }
    .login-section { padding: 25px; }

    .slideshow-section {
        order: -1;
    }
    .slideshow-container {
        /* حذف نسبت ابعاد ثابت تا ارتفاع خودکار شود */
        /* aspect-ratio: 16 / 9; */
        height: auto;
        border-radius: 15px 15px 0 0;
        overflow: hidden;
    }
    /* در حالت موبایل، ساختار اسلایدها ستونی می‌شود */
    .slide {
        flex-direction: column;
        height: auto;
    }
    /* اسلاید فعال به صورت فلکس نمایش داده می‌شود تا متن زیر عکس بیاید */
    .slide.active {
        display: flex;
    }
    /* ** کلید اصلی حل مشکل ** ارتفاع عکس دیگر 100% نیست و به صورت خودکار تنظیم می‌شود
    */
    .slide img {
        width: 100%;
        height: auto;
    }
    .caption {
        position: static;
        background-color: #f0f2f5;
        color: #333;
        text-align: right;
        font-size: 0.9rem;
        padding: 12px;
    }
}