/* =================================
   FOOTER COMPONENT - темний дизайн
   4 стовпчики, форма консультації, акордеон на mobile
   ================================= */

/* ===== FOOTER BASE ===== */
.main-footer {
    background: #1a1a1a;
    color: #888888;
    padding: 0px 0 15px;
    border-top: 3px solid var(--color-brand-orange);
    position: relative;
    z-index: var(--z-content-base, 10);
}

/* Global .container { margin-top: 60px } is for fixed header clearance — not for footer */
.main-footer .container {
    margin-top: 0;
}

/* Footer не повинен перекривати модальні вікна */
/* Модальні вікна мають position: fixed + z-index: 10002-10003, тому автоматично вище */
body.modal-open .main-footer {
    z-index: var(--z-content-base);
}

/* ===== FOOTER CONTENT GRID ===== */
.footer-content {
    display: grid;
    grid-template-columns: 1fr 0.70fr 1fr 1fr 1.7fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* ===== FOOTER SECTION ===== */
.footer-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-brand-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 5px;
}

/* ===== FOOTER LINKS ===== */
.footer-link {
    display: block;
    font-size: 16px;
    color: #aaaaaa;
    text-decoration: none;
    transition: all var(--transition-normal) var(--easing-default);
    position: relative;
    padding-left: 0;
    padding-bottom: 5px;
    line-height: 1.6;
}

.footer-link:hover {
    color: var(--color-brand-orange);
    padding-left: 5px;
}

.footer-link::before {
    content: '›';
    position: absolute;
    left: -10px;
    opacity: 0;
    transition: all var(--transition-normal) var(--easing-default);
    color: var(--color-brand-orange);
}

.footer-link:hover::before {
    opacity: 1;
    left: -5px;
}

/* ===== FOOTER SOCIAL MEDIA ===== */
.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #aaaaaa;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transition: all var(--transition-normal) var(--easing-default);
    text-decoration: none;
}

.footer-social-link:hover {
    color: var(--color-brand-orange);
    background: rgba(230, 81, 0, 0.1);
    transform: translateY(-2px);
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
}

/* ===== FOOTER CONTACTS ===== */
.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contact-link {
    display: block;
    font-size: 16px;
    color: var(--color-white);
    text-decoration: none;
    transition: color var(--transition-normal) var(--easing-default);
    font-weight: 500;
    padding-bottom: 5px;
}

.footer-contact-link:hover {
    color: var(--color-brand-orange);
}

.footer-contact-text {
    display: block;
    font-size: 15px;
    color: #888888;
    margin-bottom: 16px;
}

/* ===== FOOTER FORM ===== */
.footer-form-section {
    gap: 8px;
}

.footer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-form .form-group {
    margin-bottom: 0;
}

.footer-form .form-label {
    display: block;
    font-size: 14px;
    color: #d0d0d0;
    margin-bottom: 6px;
    font-weight: 500;
}

.footer-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-normal) var(--easing-default);
    border-radius: 0;
}

.footer-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.footer-input:focus {
    outline: none;
    border-color: var(--color-brand-orange);
    background: rgba(255, 255, 255, 0.08);
}

.footer-input.error {
    border-color: var(--color-brand-orange);
}

.footer-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #888888;
    cursor: pointer;
    line-height: 1.4;
}

.footer-checkbox input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.footer-checkbox span {
    flex: 1;
}

.footer-policy-link {
    color: var(--color-brand-orange);
    text-decoration: underline;
    transition: opacity var(--transition-fast) var(--easing-default);
}

.footer-policy-link:hover {
    opacity: 0.8;
}

.footer-submit-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
}

/* ===== FOOTER IMPRESSUM (юр. дані трейдера) ===== */
.footer-impressum {
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-impressum p {
    font-size: 12px;
    color: #b0b0b0;
    line-height: 1.7;
    flex-wrap: wrap;
}

.footer-impressum-dot {
    padding: 0 6px;
    color: #888888;
}

.footer-impressum-link,
button.footer-cookie-settings-btn {
    color: #d0d0d0;
    -webkit-text-fill-color: #d0d0d0;
    text-decoration: underline;
    background: none;
    border: none;
    font: inherit;
    font-size: inherit;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: color var(--transition-fast) var(--easing-default);
}

.footer-impressum-link:hover,
button.footer-cookie-settings-btn:hover {
    color: var(--color-brand-orange);
    -webkit-text-fill-color: var(--color-brand-orange);
}

/* ===== FOOTER BOTTOM ===== */
.footer-bottom {
    padding-top: 15px;
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #888888;
    line-height: 1.6;
}

.footer-bottom p:last-child {
    margin-bottom: 0;
}

/* ===== MOBILE ACCORDION (hidden on desktop) ===== */
.footer-accordion-toggle {
    display: none;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 1199px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .footer-section:nth-child(4),
    .footer-form-section {
        grid-column: 1 / -1;
    }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Форма завжди видима на мобільній версії */
    .footer-form-section {
        order: -1;
        margin-bottom: var(--space-md);
        padding-bottom: var(--space-md);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Акордеон для інших секцій */
    .footer-section:not(.footer-form-section) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-section:not(.footer-form-section) h3 {
        position: relative;
        padding: 16px 0;
        margin-bottom: 0;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .footer-section:not(.footer-form-section) h3::after {
        content: '+';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 24px;
        font-weight: 400;
        color: var(--color-brand-orange);
        transition: transform var(--transition-normal) var(--easing-default);
    }

    .footer-section:not(.footer-form-section).footer-accordion-active h3::after {
        content: '−';
    }

    /* Контент акордеону */
    .footer-section:not(.footer-form-section) .footer-accordion-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }

    .footer-section:not(.footer-form-section).footer-accordion-active .footer-accordion-content {
        max-height: 1000px;
        padding-bottom: 16px;
    }

    /* Всі посилання та контент всередину обгортки */
    .footer-section:not(.footer-form-section) .footer-link,
    .footer-section:not(.footer-form-section) .footer-social,
    .footer-section:not(.footer-form-section) .footer-contacts {
        /* Ці елементи обгорнуті в .footer-accordion-content через JS */
    }

    .footer-section h3 {
        font-size: 18px;
    }

    .footer-link {
        font-size: 16px;
        padding: 6px 0;
    }

    .footer-social {
        margin-top: 12px;
    }

    .footer-social-link {
        width: 36px;
        height: 36px;
    }

    .footer-contacts {
        margin-top: 12px;
        padding-top: 12px;
    }

    .footer-contact-link,
    .footer-contact-text {
        font-size: 13px;
    }

    .footer-form .form-label {
        font-size: 15px;
    }

    .footer-input {
        font-size: 16px;
        /* iOS Safari: 16px запобігає zoom */
        padding: 14px 16px;
    }

    .footer-checkbox {
        font-size: 15px;
    }

    .footer-submit-btn {
        font-size: 16px;
        padding: 14px 24px;
    }

    .footer-bottom {
        padding-top: 12px;
        text-align: center;
    }

    .footer-bottom p {
        font-size: 11px;
        line-height: 1.5;
    }

    .footer-impressum {
        padding-top: 12px;
    }

    .footer-impressum p {
        font-size: 11px;
        line-height: 1.6;
    }

    .footer-impressum-link {
        font-size: 11px;
    }
}

/* ===== iOS SAFARI OPTIMIZATIONS ===== */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 767px) {
        .footer-input {
            /* Запобігаємо zoom на iOS */
            font-size: 16px;
        }
    }
}


/* Shared lead fields inside dark footer chrome */
.footer-form .lead-form-input,
.footer-form .form-input,
.footer-form .form-textarea,
.footer-form select.lead-form-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f2f2f2;
}

.footer-form .lead-form-input::placeholder,
.footer-form .form-input::placeholder,
.footer-form .form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.footer-form .lead-form-input:focus,
.footer-form .form-input:focus,
.footer-form .form-textarea:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--color-brand-orange, #E65100);
    outline: none;
    box-shadow: none;
}

.footer-form .lead-form-checkbox,
.footer-form .lead-form-expect {
    color: #a8a8a8;
}

.footer-form .lead-form-telegram__wrap {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-form .lead-form-telegram__prefix {
    color: rgba(255, 255, 255, 0.55);
}

.footer-form .lead-form-telegram__input,
.footer-form .lead-form-telegram__input.form-input,
.footer-form .lead-form-telegram__input.lead-form-input {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: #f2f2f2;
    box-shadow: none !important;
}

.footer-form .lead-form-telegram__wrap:focus-within {
    border-color: var(--color-brand-orange, #E65100);
    background: rgba(255, 255, 255, 0.09);
}

.footer-form .lead-form-telegram__input.form-input:focus,
.footer-form .lead-form-telegram__input.lead-form-input:focus {
    background: transparent !important;
    background-color: transparent !important;
}

.footer-form .lead-form-contact-rule--error {
    color: #ff8a65;
}
