/**
 * Калькулятор платежей и график выплат (Swiss Private Banking Canon 2026 / Apple & T-Bank)
 * 102-ФЗ: Полная прозрачность ПСК, отсутствие скрытых комиссий, компактный 1-экранный модуль
 */

/* Секция калькулятора — благородный офф-вайт фон #FAF9F6, компактные отступы для 1 экрана */
#calculator.section-calculator {
    padding: clamp(20px, 2.5vw, 26px) 0 !important;
    background-color: #FAF9F6 !important;
    position: relative;
    overflow: hidden;
}

#calculator.section-calculator::before,
#calculator.section-calculator::after {
    display: none !important;
}

#calculator .container {
    position: relative;
    z-index: 1;
    max-width: 1120px !important;
    margin: 0 auto !important;
    padding-left: clamp(14px, 2vw, 20px) !important;
    padding-right: clamp(14px, 2vw, 20px) !important;
    box-sizing: border-box !important;
}

/* Компактная шапка секции */
#calculator .calc-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 12px !important;
}

/* Никаких чипов — строгая институциональная надпись */
#calculator .calc-sub-headline {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
    display: inline-block;
}

#calculator .section__title {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: clamp(20px, 2.2vw, 26px) !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 3px !important;
}

#calculator .section__subtitle {
    font-size: clamp(12px, 1.2vw, 14px) !important;
    color: #64748B !important;
    line-height: 1.35 !important;
    margin: 0 auto !important;
    max-width: 660px !important;
}

/* Главная подложка калькулятора — чисто белый #FFFFFF с тонкой каймой */
#calculator .calculator.calculator--tbank-v2 {
    background: #FFFFFF !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.05) !important;
    padding: clamp(14px, 1.8vw, 18px) !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* Двухколоночная сетка: левая (параметры) и правая (результат) */
#calculator .calculator__grid {
    display: grid !important;
    grid-template-columns: 1.05fr 0.95fr !important;
    gap: 18px !important;
    align-items: stretch !important;
}

#calculator .calculator__inputs {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

/* Сегментированный стрип схемы погашения прямо в левой колонке */
#calculator .calc-scheme-strip-box {
    background: transparent;
    padding: 0;
    margin-bottom: 1px;
}

#calculator .calc-scheme-strip {
    display: flex;
    width: 100%;
    background: #F1F5F9;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    box-sizing: border-box;
}

#calculator .calc-scheme-tab {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    text-align: center;
}

#calculator .calc-scheme-tab:hover {
    color: #0F172A;
}

#calculator .calc-scheme-tab.is-active {
    background: #FFFFFF !important;
    color: #0F172A !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

#calculator .calc-scheme-tab__title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

#calculator .calc-scheme-tab__desc {
    font-size: 11px;
    font-weight: 500;
    color: #64748B;
    line-height: 1;
}

#calculator .calc-scheme-hint {
    font-size: 11px;
    color: #64748B;
    margin: 5px 0 0;
    line-height: 1.3;
}

/* Компактные поля со слайдерами (бегунками) */
#calculator .calc-field {
    background: #F8FAFC !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    border-radius: 9px !important;
    padding: 9px 12px !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background 0.2s ease;
}

#calculator .calc-field:hover,
#calculator .calc-field:focus-within {
    border-color: rgba(5, 150, 105, 0.3) !important;
    background: #FFFFFF !important;
}

#calculator .calc-field__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

#calculator .calc-field label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

#calculator .calc-value {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    letter-spacing: -0.02em;
    line-height: 1;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Слайдеры: мягкий трек #E2E8F0, изумрудный бегунок #059669 */
#calculator input[type="range"].calc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: #E2E8F0 !important;
    outline: none;
    margin: 4px 0;
    cursor: pointer;
    border: none !important;
    box-shadow: none !important;
}

#calculator input[type="range"].calc-slider::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background: #E2E8F0 !important;
    border: none !important;
    box-shadow: none !important;
}

#calculator input[type="range"].calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #059669 !important;
    border: 3px solid #FFFFFF !important;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3) !important;
    cursor: pointer;
    margin-top: -6.5px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#calculator input[type="range"].calc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.45) !important;
}

#calculator input[type="range"].calc-slider::-moz-range-track {
    height: 5px;
    border-radius: 999px;
    background: #E2E8F0 !important;
    border: none !important;
}

#calculator input[type="range"].calc-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #059669 !important;
    border: 3px solid #FFFFFF !important;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3) !important;
    cursor: pointer;
}

#calculator .calc-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 500;
    color: #94A3B8;
    margin-top: 2px;
}

/* Индикативная рыночная строка */
#calculator .calc-market-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 7px;
    font-size: 11px;
    color: #64748B;
    margin-top: 1px;
}

#calculator .calc-market-bar strong {
    color: #0F172A;
}

#calculator .calc-market-bar__sep {
    color: #CBD5E1;
}

/* Правая колонка: Карточка результата (Apple / T-Bank эстетика) */
#calculator .calc-result-card {
    background: #FAFAFA !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 11px !important;
    padding: 13px 15px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}

/* Строка доверия — чистый текст без чипсов и цветных пилюль */
#calculator .calc-trust-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 8px;
    line-height: 1.2;
}

#calculator .calc-result-payment {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    margin-bottom: 9px;
}

#calculator .calc-result-payment__label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #64748B;
    margin-bottom: 2px;
}

#calculator .calc-result-payment__value {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: clamp(24px, 2.5vw, 29px) !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    line-height: 1.1;
    letter-spacing: -0.025em;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

#calculator .calc-result-payment__sub {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #64748B;
    margin-top: 2px;
}

/* Сводка параметров — компактный леджер */
#calculator .calc-result-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

#calculator .calc-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    line-height: 1.3;
}

#calculator .calc-metric-row__label {
    color: #64748B;
}

#calculator .calc-metric-row__val {
    font-weight: 600;
    color: #0F172A;
    text-align: right;
}

/* CTA Кнопка: Зафиксировать расчет параметров (высота 46px) */
#calculator .calc-btn-fix {
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    background: #059669 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px !important;
}

#calculator .calc-btn-fix:hover {
    background: #047857 !important;
    box-shadow: 0 3px 12px rgba(5, 150, 105, 0.3) !important;
    transform: translateY(-1px);
}

#calculator .calc-btn-fix:active {
    transform: translateY(0);
}

#calculator .calc-cta-note {
    font-size: 10px;
    color: #64748B;
    text-align: center;
    margin-top: 5px;
    line-height: 1.3;
}

/* График платежей (аккордеон) */
#calculator .calc-schedule-zone {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

#calculator .calc-schedule-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 9px;
    background: #FFFFFF;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

#calculator .calc-schedule-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

#calculator .calc-schedule-btn__arrow {
    font-size: 8px;
    transition: transform 0.2s ease;
}

#calculator .calc-schedule-btn.is-open .calc-schedule-btn__arrow {
    transform: rotate(180deg);
}

#calculator .calc-table-container {
    margin-top: 8px;
    padding: 8px;
    background: #FFFFFF;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

#calculator .calc-table-title {
    font-size: 11px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 5px;
}

#calculator .calc-table-scroll {
    max-height: 190px;
    overflow-y: auto;
}

#calculator .calc-payments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

#calculator .calc-payments-table th,
#calculator .calc-payments-table td {
    padding: 4px 5px;
    text-align: right;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

#calculator .calc-payments-table th:first-child,
#calculator .calc-payments-table td:first-child {
    text-align: left;
}

#calculator .calc-payments-table th {
    font-weight: 600;
    color: #64748B;
    background: #F1F5F9;
    position: sticky;
    top: 0;
    z-index: 1;
}

#calculator .calc-payments-table td {
    color: #0F172A;
    font-variant-numeric: tabular-nums;
}

/* Компактная сноска внизу */
#calculator .calculator__note {
    margin-top: 10px !important;
    font-size: 11px !important;
    color: #64748B !important;
    line-height: 1.4 !important;
}

/* Адаптивность для мобильных экранов */
@media (max-width: 860px) {
    #calculator .calculator__grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    #calculator .calc-market-bar {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: flex-start;
    }

    #calculator .calc-market-bar__sep {
        display: none;
    }
}

@media (max-width: 640px) {
    #calculator.section-calculator {
        padding: 20px 0 !important;
    }

    #calculator .calculator.calculator--tbank-v2 {
        padding: 12px 10px !important;
        border-radius: 12px !important;
    }

    #calculator .calc-value {
        font-size: 16px !important;
    }

    #calculator .calc-result-payment__value {
        font-size: 24px !important;
    }

    #calculator .calc-field {
        padding: 9px 10px !important;
    }

    #calculator .calc-result-card {
        padding: 12px 10px !important;
    }

    #calculator .calc-scheme-tab {
        padding: 5px 6px;
    }

    #calculator .calc-scheme-tab__title {
        font-size: 11px;
    }

    #calculator .calc-scheme-tab__desc {
        font-size: 10px;
    }
}

