/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    /* گرادیانت هدر سایت — برای تیتر ستون‌های فوتر */
    --footer-grad: linear-gradient(100deg, #48ff91, #2d9fff);

    position: relative;
    padding: 60px 0 30px;
    border-top: 1px solid var(--line-strong);
    font-size: 0.82rem;
    color: var(--text);
}

.footer .container {
    position: relative;
}

/* ============================================================
   Layout: دو ستونه (brand چپ + cols راست)
   ============================================================ */
.footer-main {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

/* ============================================================
   ستون چپ: برند
   ============================================================ */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.footer-logo-svg {
    color: var(--text);
    width: 180px;
    height: auto;
    transition: color 0.3s ease;
}

.footer-logo-svg path[fill="#002DF4"] {
    /* حلقه آبی لوگو در دارک مود روشن‌تر */
    fill: var(--accent);
}

.footer-desc {
    font-size: 0.82rem;
    line-height: 1.85;
    color: var(--text-muted);
    opacity: 0.75;
}

/* ============================================================
   لایسنس‌ها
   ============================================================ */
.footer-licenses {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.license-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line-border);
    background: var(--bg-card);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.license-item:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.license-item i {
    font-size: 1.3rem;
    color: var(--accent);
    opacity: 0.85;
}

.license-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.license-text strong {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text);
}

.license-text span {
    font-size: 0.6rem;
    opacity: 0.5;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-top: 6px;
}

/* ============================================================
   خبرنامه
   ============================================================ */
.footer-newsletter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    position: relative;
}

.footer-newsletter input {
    flex: 1;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--line-border);
    color: var(--text);
    padding: 12px 18px;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.8rem;
    border-radius: 999px;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.footer-newsletter input:focus {
    border-color: var(--accent);
}

.footer-newsletter input::placeholder {
    color: var(--text-muted);
    opacity: 0.55;
}

.footer-newsletter button {
    background: var(--accent);
    color: #0a0a0c;
    border: none;
    padding: 12px 26px;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.footer-newsletter button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.newsletter-msg {
    display: block;
    width: 100%;
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 6px;
    padding-left: 4px;
    min-height: 14px;
}

/* ============================================================
   ستون راست: ۵ گروه لینک
   ============================================================ */
.footer-cols {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    background-image: var(--footer-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 14px;
    letter-spacing: -0.2px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col a {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.7;
    transition: color 0.2s ease, opacity 0.2s ease;
    line-height: 1.5;
}

.footer-col a:hover {
    color: var(--accent);
    opacity: 1;
}

.footer-col a.active {
    color: var(--accent);
    opacity: 1;
    font-weight: 600;
}

/* ============================================================
   نوار پایین
   ============================================================ */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 20px;
}

.footer-bottom p {
    font-size: 1rem;
    opacity: 0.5;
    color: var(--text-muted);
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-theme-toggle {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 4px 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
}

.footer-theme-toggle:hover {
    opacity: 1;
    border-color: var(--accent);
}

.footer-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.footer-lang:hover { opacity: 1; }

.footer-lang select {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    transition: border-color 0.2s;
}

.footer-lang select:hover { border-color: var(--accent); }

.footer-lang select option {
    background: var(--bg);
    color: var(--text);
}

/* ============================================================
   Responsive — Tablet (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-cols {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px 20px;
    }
}

/* ============================================================
   Responsive — Mobile (max 768px)
   ============================================================ */
@media (max-width: 768px) {
    .footer {
        padding: 45px 0 25px;
    }

    .footer-main {
        gap: 32px;
        padding-bottom: 28px;
        margin-bottom: 20px;
    }

    .footer-logo-svg {
        width: 150px;
    }

    .footer-desc {
        font-size: 0.78rem;
        line-height: 1.75;
    }

    .footer-licenses {
        gap: 10px;
    }

    .license-item {
        padding: 8px 10px;
    }

    .license-item i {
        font-size: 1.1rem;
    }

    .footer-newsletter {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-newsletter input,
    .footer-newsletter button {
        width: 100%;
    }

    .footer-cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }

    .footer-col h4 {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .footer-col a {
        font-size: 0.74rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    .footer-actions {
        justify-content: center;
    }
}

/* ============================================================
   Responsive — Small mobile (max 480px)
   ============================================================ */
@media (max-width: 480px) {
    .footer {
        padding: 35px 0 20px;
    }

    .footer-logo-svg {
        width: 130px;
    }

    .footer-cols {
        grid-template-columns: 1fr 1fr;
        gap: 22px 12px;
    }

    .footer-col h4 {
        font-size: 0.76rem;
    }

    .footer-col a {
        font-size: 0.7rem;
    }

    .footer-newsletter input,
    .footer-newsletter button {
        font-size: 0.75rem;
        padding: 10px 16px;
    }
}

/* ============================================================
   FOOTER — full-width architectural line system
   Matches the landing page rails, section rules and grid cells.
   ============================================================ */
.footer {
    --footer-rail-x: max(28px, calc(50% - 612px));
    padding: 0;
    border-top: 1px solid var(--line-px);
    border-bottom: 1px solid var(--line-px);
    overflow: clip;
}

.footer::before,
.footer::after {
    content: '';
    position: absolute;
    inset-block: 0;
    width: 1px;
    background: var(--line-px);
    pointer-events: none;
    z-index: 0;
}

.footer::before { inset-inline-start: var(--footer-rail-x); }
.footer::after { inset-inline-end: var(--footer-rail-x); }

.footer .container {
    padding-top: 0;
    padding-bottom: 0;
}

.footer-main {
    position: relative;
    gap: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

.footer-main::before,
.footer-main::after {
    content: '';
    position: absolute;
    inset-inline: calc(-1 * var(--line-ext, 0px));
    height: 1px;
    background: var(--line-px);
    pointer-events: none;
}

.footer-main::before { inset-block-start: 0; }
.footer-main::after { inset-block-end: 0; }

.footer-brand {
    min-width: 0;
    /* Align the brand content with the 36px inset used inside page rails. */
    padding: 34px 28px 34px 36px;
    border-inline-end: 1px solid var(--line-strong);
}

.footer-cols {
    min-width: 0;
    gap: 0;
    padding: 0;
    border-inline-start: 0;
    position: relative;
}

.footer-col {
    min-width: 0;
    padding: 34px 16px;
    border-inline-end: 1px solid var(--line-strong);
    position: relative;
}

.footer-col:last-child { border-inline-end: 0; }

.footer-col h4 {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 0;
}

.footer-col ul { gap: 9px; }

.footer-bottom {
    position: relative;
    min-height: 72px;
    padding: 18px 0;
    margin: 0;
}

.footer-bottom::before {
    content: '';
    position: absolute;
    inset-inline: calc(-1 * var(--line-ext, 0px));
    inset-block-start: 0;
    height: 1px;
    background: var(--line-px);
}

.footer-logo,
.footer-desc,
.footer-licenses,
.footer-note,
.footer-newsletter { max-width: 100%; }

@media (max-width: 1024px) {
    .footer-main { grid-template-columns: 1fr; }

    .footer-brand {
        padding: 28px 36px;
        border-inline-end: 0;
        border-bottom: 1px solid var(--line-strong);
    }

    .footer-cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-inline-start: 1px solid var(--line-strong);
    }

    .footer-col {
        border-bottom: 1px solid var(--line-strong);
    }
}

@media (max-width: 768px) {
    .footer {
        --footer-rail-x: max(12px, calc(50% - 628px));
    }

    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .footer-col {
        padding: 22px 14px;
        border-inline-end: 1px solid var(--line-strong);
    }

    .footer-col:nth-child(2n) { border-inline-end: 0; }
    .footer-brand { padding: 24px 14px; }
    .footer-bottom { padding: 18px 12px; }
}

@media (max-width: 480px) {
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-col { padding: 18px 10px; }
}
