/* ============================================================
   ROOT VARIABLES & RESET
   ============================================================ */
:root {
    --font-farsi: 'Vazirmatn', sans-serif;
    --accent: #CCFF00;
    --bg-main: #1A1C20;
    --text: #F2F2F5;
    --card-bg: rgba(26, 28, 32, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    --radius: 24px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-main);
    color: var(--text);
    font-family: var(--font-farsi);
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -1px;
    cursor: pointer;
    white-space: nowrap;
}

.logo-part1 { color: #fff; margin-right: 4px; }
.logo-part2 { color: var(--accent); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    flex-grow: 1;
    justify-content: center;
    margin: 0 10px;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover { color: var(--accent); }

.nav-icons {
    display: flex;
    align-items: center;
    gap: 18px;
}

.icon-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 24px;
}

.icon-link:hover { color: var(--accent); transform: scale(1.1); }

.dropdown-wrapper { position: relative; }

.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 32px 0 40px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    pointer-events: none;
    z-index: 999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dropdown-wrapper:hover .dropdown-menu,
.dropdown-menu:hover,
.dropdown-wrapper:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

.dropdown-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.dropdown-column { min-width: 0; }

.dropdown-productGroup-title {
    color: #CCFF00;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-column ul { list-style: none; padding: 0; margin: 0; }
.dropdown-column ul li { margin-bottom: 4px; }

.dropdown-column ul li a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.25s ease;
    display: block;
    padding: 6px 0;
    border-bottom: 1px solid transparent;
}

.dropdown-column ul li a:hover {
    color: #fff;
    padding-right: 8px;
    border-bottom-color: rgba(204, 255, 0, 0.15);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(204, 255, 0, 0.03), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
    order: 3;
}

.icon-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.glass-tooltip {
    position: absolute;
    top: 150%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 10px;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.icon-wrapper:hover .glass-tooltip {
    opacity: 1;
    visibility: visible;
    top: 130%;
}

/* ============================================================
   MAIN
   ============================================================ */
.login-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 60px;
    position: relative;
    background: var(--bg-main);
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-image: url('img/login.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ===== iOS Parallax Fallback ===== */
html.is-ios .login-bg {
    background-attachment: scroll;
    background-image: none !important;
}

html.is-ios .login-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--bg-image-desktop);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
}

/* ============================================================
   LOGIN WRAPPER
   ============================================================ */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
}

.login-card {
    background: rgba(26, 28, 32, 0.75);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow);
    transition: all 0.4s ease;
}

.login-brand {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.brand-part1 { color: #fff; }
.brand-part2 { color: var(--accent); }

.brand-tagline {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.tab-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-farsi);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover { color: rgba(255, 255, 255, 0.7); }

.tab-btn.active {
    background: var(--accent);
    color: #0b1220;
    box-shadow: 0 0 30px rgba(204, 255, 0, 0.08);
}

.auth-form { display: block; transition: all 0.4s ease; }
.auth-form.hidden { display: none; }

.form-group { margin-bottom: 18px; }
.form-row { display: flex; gap: 14px; }
.form-group.half { flex: 1; min-width: 0; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-group label i {
    margin-left: 6px;
    color: var(--accent);
    font-size: 0.75rem;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.95rem;
    font-family: var(--font-farsi);
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(204, 255, 0, 0.04);
}

.form-group input::placeholder { color: rgba(255, 255, 255, 0.2); }

.error-msg {
    display: block;
    font-size: 0.7rem;
    color: #ff6b6b;
    margin-top: 4px;
    min-height: 18px;
}

.otp-group { margin-bottom: 24px; }
.otp-input-wrapper { display: flex; gap: 10px; }
.otp-input-wrapper input { flex: 1; }

.btn-send-otp {
    padding: 0 18px;
    background: rgba(204, 255, 0, 0.06);
    border: 1px solid rgba(204, 255, 0, 0.15);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-farsi);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-send-otp:hover:not(:disabled) {
    background: rgba(204, 255, 0, 0.12);
    border-color: var(--accent);
}

.btn-send-otp:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.otp-timer {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 6px;
    min-height: 20px;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #0b1220;
    font-family: var(--font-farsi);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 4px;
}

.btn-submit:hover {
    background: #ffffff;
    transform: scale(1.02);
    box-shadow: 0 0 40px rgba(204, 255, 0, 0.15);
}

.btn-submit:active { transform: scale(0.98); }

.btn-submit i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.btn-submit:hover i { transform: translateX(-4px); }

.form-footnote {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 18px;
}

.form-footnote a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
}

.form-footnote a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    position: relative;
    z-index: 10;
    background: #0c0c0c;
    color: #fff;
    padding: 40px 20px;
    border-top: 3px solid #ccff00;
    direction: rtl;
}

.footer-inner { max-width: 1200px; margin: 60px auto; }

.footer-about-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #2a2a2a;
}

.footer-about-text {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.5s ease;
    line-height: 2;
    font-size: 15px;
    color: #e6e6e6;
}

.footer-about-text.open { max-height: 500px; }

.footer-links-section {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-column { flex: 1; min-width: 220px; }
.footer-column h3 { font-size: 16px; color: #ccff00; margin-bottom: 15px; }
.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column ul li { margin-bottom: 10px; color: #ddd; }
.footer-column a { color: #ddd; text-decoration: none; transition: 0.3s; }
.footer-column a:hover { color: #ccff00; }

.newsletter-form { display: flex; flex-direction: column; gap: 10px; }

.newsletter-form input {
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    outline: none;
}

.newsletter-form button {
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: #ccff00;
    color: #0c0c0c;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.newsletter-form button:hover { opacity: 0.9; }

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #222;
    font-size: 0.8rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {

    .main-header { position: fixed; top: 0; height: 56px; }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        font-size: 1.5rem;
        z-index: 1001;
    }

    .menu-toggle.active {
        color: var(--accent);
        transform: rotate(90deg);
    }

    .nav-container { gap: 10px; padding: 0 14px; }
    .nav-icons { margin-right: auto; margin-left: 0; gap: 12px; }
    .logo-container { flex-grow: 0; font-size: 1.2rem; }
    .icon-link { font-size: 20px; }

    .nav-links {
        display: flex;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        overflow-anchor: none;
        overscroll-behavior: contain;
        background: rgba(15, 15, 18, 0.98);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 20px 16px 40px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
        pointer-events: none;
        list-style: none;
        scrollbar-width: thin;
        scrollbar-color: var(--accent) transparent;
    }

    .nav-links::-webkit-scrollbar { width: 5px; }
    .nav-links::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-links > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        flex-shrink: 0;
    }

    .nav-links > li:last-child { border-bottom: none; }

    .nav-links > li > a {
        display: block;
        width: 100%;
        padding: 14px 4px;
        font-size: 0.95rem;
        text-align: right;
        color: rgba(255, 255, 255, 0.85);
        font-family: var(--font-farsi);
        text-decoration: none;
    }

    .dropdown-trigger {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }

    .dropdown-trigger .arrow {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.6);
        font-size: 0.65rem;
        transition: all 0.3s ease;
        margin-right: 8px;
        line-height: 1;
    }

    .dropdown-wrapper.open .dropdown-trigger .arrow {
        transform: rotate(180deg);
        background: rgba(204, 255, 0, 0.15);
        color: var(--accent);
    }

    .dropdown-menu {
        position: static;
        display: none;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .dropdown-wrapper.open .dropdown-menu { display: block; }
    .dropdown-menu::before { display: none; }

    .dropdown-inner { padding: 8px 0 12px; }
    .dropdown-columns { display: flex; flex-direction: column; gap: 8px; }

    .dropdown-column {
        padding: 12px;
        background: rgba(255, 255, 255, 0.025);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 12px;
    }

    .dropdown-productGroup-title {
        color: var(--accent);
        font-size: 0.75rem;
        font-weight: 700;
        margin: 0 0 8px;
        padding: 0;
        border: none;
    }

    .dropdown-column ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .dropdown-column ul li { margin: 0; }

    .dropdown-column ul li a {
        display: block;
        color: rgba(255, 255, 255, 0.72);
        font-size: 0.75rem;
        padding: 8px 4px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 7px;
        text-align: center;
        border: none;
    }

    .dropdown-column ul li a:hover {
        background: rgba(204, 255, 0, 0.12);
        color: var(--accent);
    }

    /* ===== عکس پس‌زمینه موبایل ===== */
    .login-bg {
        background-image: url('img/BackMobile/loginMobile.png');
        background-attachment: fixed;
    }

    html.is-ios .login-bg::before {
        background-image: var(--bg-image-mobile);
    }

    /* ===== FOOTER ===== */
    .footer { padding: 30px 16px; }
    .footer-inner { margin: 30px auto; }

    .footer-about-text {
        font-size: 13px;
        line-height: 1.85;
        max-height: none !important;
        overflow: visible !important;
    }

    .footer-links-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px 12px;
    }

    .footer-column { min-width: 0; }
    .footer-column h3 { font-size: 13px; margin-bottom: 10px; }
    .footer-column ul li { font-size: 12px; margin-bottom: 7px; }

    .footer-column:nth-child(3) {
        grid-column: 1 / -1;
        text-align: center;
    }

    .footer-column:nth-child(3) .newsletter-form {
        max-width: 320px;
        margin: 0 auto;
    }

    .newsletter-form input,
    .newsletter-form button {
        padding: 9px 11px;
        font-size: 0.82rem;
    }

    .footer-bottom {
        margin-top: 30px;
        padding-top: 16px;
        font-size: 0.75rem;
    }
}

@media (max-width: 520px) {
    .login-card { padding: 28px 20px; }
    .login-brand { font-size: 1.6rem; }
    .form-row { flex-direction: column; gap: 0; }
    .otp-input-wrapper { flex-direction: column; }
    .btn-send-otp { padding: 12px; width: 100%; }
    .tab-btn { font-size: 0.85rem; padding: 8px; }
    .brand-tagline { font-size: 0.75rem; }
}

@media (max-width: 480px) {
    .footer { padding: 20px 12px; }
    .footer-inner { margin: 20px auto; }

    .footer-about-text {
        font-size: 12px;
        max-height: none !important;
        overflow: visible !important;
    }

    .footer-column h3 { font-size: 12px; }
    .footer-column ul li { font-size: 11px; }
    .footer-bottom { margin-top: 24px; padding-top: 14px; font-size: 0.7rem; }
}

@media (max-width: 380px) {
    .login-card { padding: 20px 14px; }
    .login-brand { font-size: 1.3rem; }
    .form-group input { padding: 12px 14px; font-size: 0.85rem; }
    .btn-submit { padding: 14px; font-size: 0.95rem; }
}