footer {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-top: 2px solid #bae6fd;
    color: var(--text-muted);
    padding: 60px 0 40px;
    margin-top: 3rem;
    flex-shrink: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    align-items: start;
}

.footer-section h3 {
    margin-bottom: 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #0284c7;
}

.footer-section h3::after {
    content: "";
    display: block;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    margin-top: 8px;
    margin-bottom: 16px;
}

.footer-section>p {
    color: #475569;
    font-size: 0.875rem;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links-list li {
    margin-bottom: 0;
}

.footer-links-list a {
    color: #475569;
    font-size: 0.875rem;
    border-left: 2px solid transparent;
    padding-left: 0;
    transition: color 0.2s ease, border-color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}

.footer-links-list a:hover {
    color: #0284c7;
    border-left-color: #06b6d4;
    padding-left: 8px;
}

.footer-about-text {
    text-align: justify;
    line-height: 1.8;
    font-size: 0.875rem;
    color: #475569;
}

.footer-social-links {
    margin-top: 1.1rem;
    justify-content: flex-start;
}

.copyright {
    text-align: center;
    margin-top: 0;
    padding: 16px;
    border-top: 1px solid #bae6fd;
    background: #e0f2fe;
    color: #64748b;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-brand {
    font-weight: 700;
    color: #0284c7;
}

.cookie-notice {
    margin-top: 4px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.cookie-notice a {
    color: #64748b;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.cookie-notice a:hover {
    color: #0284c7;
}

.newsletter-form {
    display: flex;
}

.newsletter-form input {
    padding: 10px 16px;
    width: 100%;
    border: 1px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    background: #fff;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.newsletter-form input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.newsletter-form button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s ease;
    white-space: nowrap;
}

.newsletter-form button:hover {
    filter: brightness(1.1);
}

#newsletter-msg {
    display: none;
    margin-top: 0.75rem;
    color: var(--success-color);
    font-weight: 500;
}

.newsletter-subscribed-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f6fbf8;
    border: 1px solid #c3e6d1;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.newsletter-check-icon {
    font-size: 1.4rem;
    color: #22a06b;
    flex-shrink: 0;
}

.newsletter-subscribed-title {
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    font-size: 0.92rem;
}

.newsletter-subscribed-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.2rem 0 0;
    word-break: break-all;
}

.newsletter-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.25rem;
}

.newsletter-unsubscribe-btn,
.newsletter-back-btn {
    background: none;
    border: none;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-style: dotted;
    transition: color 0.2s;
}

.newsletter-unsubscribe-btn {
    color: var(--text-muted);
}

.newsletter-unsubscribe-btn:hover {
    color: #c0392b;
}

.newsletter-back-btn {
    color: var(--text-muted);
}

.newsletter-back-btn:hover {
    color: var(--text-color);
}

#newsletter-unsub-msg {
    display: none;
    margin-top: 0.5rem;
}

#newsletter-subscribed-state {
    display: none;
}

@media (max-width: 1024px) {
    .newsletter-form {
        max-width: 100%;
    }

    .newsletter-form input {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    footer {
        padding: 40px 0 24px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .footer-about-text {
        text-align: justify;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input {
        border-radius: 8px;
        border-right: 1px solid #e2e8f0;
        width: 100%;
        box-sizing: border-box;
        min-height: 44px;
    }

    .newsletter-form button {
        border-radius: 8px;
        width: 100%;
        margin-top: 8px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        gap: 1.5rem;
        padding: 0 0.75rem;
    }

    .footer-section h3 {
        font-size: 0.8rem;
    }
}

[dir="rtl"] .newsletter-form input {
    border-right: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 4px 4px 0;
}

[dir="rtl"] .newsletter-form button {
    border-radius: 4px 0 0 4px;
}

@media (max-width: 768px) {
    [dir="rtl"] .newsletter-form input {
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        border-radius: 6px;
    }

    [dir="rtl"] .newsletter-form button {
        border-radius: 6px;
    }
}

@media (min-width: 1440px) {
    .footer-content {
        max-width: 1380px;
    }

    .footer-content>.footer-section:nth-child(2) {
        padding-inline-start: 2rem;
    }
}

@media (min-width: 1920px) {
    .footer-content {
        max-width: 1700px;
    }
}

@media (min-width: 2560px) {
    .footer-content {
        max-width: 2200px;
    }
}

/* ── Dark mode overrides ─────────────────────────────────────────────────── */
/* CSS-only fallback: system dark preference before JS sets data-theme */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) footer {
        background: #0f172a;
        border-top-color: #1e293b;
    }

    :root:not([data-theme="light"]) .footer-section h3 {
        color: #60a5fa;
    }

    :root:not([data-theme="light"]) .footer-section>p,
    :root:not([data-theme="light"]) .footer-about-text {
        color: #94a3b8;
    }

    :root:not([data-theme="light"]) .footer-links-list a {
        color: #94a3b8;
    }

    :root:not([data-theme="light"]) .copyright {
        background: #0f172a;
        border-top-color: #1e293b;
        color: #64748b;
    }

    :root:not([data-theme="light"]) .newsletter-form input {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    :root:not([data-theme="light"]) .newsletter-subscribed-panel {
        background: #1e293b;
        border-color: #334155;
    }
}

[data-theme="dark"] footer {
    background: #0f172a;
    border-top-color: #1e293b;
}

[data-theme="dark"] .footer-section h3 {
    color: #60a5fa;
}

[data-theme="dark"] .footer-section>p,
[data-theme="dark"] .footer-about-text {
    color: #94a3b8;
}

[data-theme="dark"] .footer-links-list a {
    color: #94a3b8;
}

[data-theme="dark"] .footer-links-list a:hover {
    color: #60a5fa;
    border-left-color: #06b6d4;
}

[data-theme="dark"] .copyright {
    background: #0f172a;
    border-top-color: #1e293b;
    color: #64748b;
}

[data-theme="dark"] .newsletter-form input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .newsletter-form input:focus {
    border-color: #06b6d4;
}

[data-theme="dark"] .newsletter-subscribed-panel {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .cookie-notice a {
    color: #64748b;
}

[data-theme="dark"] .cookie-notice a:hover {
    color: #60a5fa;
}