/* =========================================================================
   Стили нового калькулятора кредитов (страница /calculadora/).
   Разметка: /scrs/templates/_components/footer-calc-new.twig
   Скрипты:  /js/footer-calc.js

   ВСЁ ЗАСКОУПЛЕНО под .footer-calc-wrap-calc (в т.ч. CSS-переменные),
   чтобы не пересекаться с классами и переменными остального сайта.
   ========================================================================= */

.footer-calc-wrap-calc {
    /* Палитра — только внутри виджета */
    --bg-body-calc:        #f8fafc;
    --bg-card-calc:        #ffffff;
    --bg-dark-calc:        #0f172a;
    --bg-dark-card-calc:   #1e293b;
    --bg-slate-50-calc:    #f8fafc;
    --bg-slate-100-calc:   #f1f5f9;

    --primary-calc:        #0284c7;
    --primary-hover-calc:  #0369a1;
    --primary-light-calc:  #e0f2fe;
    --primary-border-calc: #bae6fd;

    --text-main-calc:      #0f172a;
    --text-muted-calc:     #64748b;
    --text-light-calc:     #94a3b8;
    --text-white-calc:     #ffffff;

    --border-color-calc:   #e2e8f0;
    --border-dark-calc:    #334155;

    --success-calc:        #10b981;
    --success-bg-calc:     rgba(16,185,129,0.15);
    --danger-calc:         #f43f5e;
    --danger-bg-calc:      rgba(244,63,94,0.15);

    --warning-bg-calc:     #fffbeb;
    --warning-border-calc: #fde68a;
    --warning-text-calc:   #78350f;

    --radius-sm-calc: 8px;
    --radius-md-calc: 12px;
    --radius-lg-calc: 16px;
    --radius-xl-calc: 24px;

    --shadow-sm-calc:   0 1px 3px rgba(0,0,0,0.05);
    --shadow-md-calc:   0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg-calc:   0 10px 25px -5px rgba(0,0,0,0.12), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-glow-calc: 0 0 20px rgba(2,132,199,0.25);

    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main-calc);
    line-height: 1.5;
    box-sizing: border-box;
}

.footer-calc-wrap-calc *,
.footer-calc-wrap-calc *::before,
.footer-calc-wrap-calc *::after {
    box-sizing: border-box;
}

/* ============================== Grid ============================== */
.simulator-grid-calc {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .simulator-grid-calc {
        grid-template-columns: 7fr 5fr;
    }
}

/* ============================== Card ============================== */
.card-calc {
    background-color: var(--bg-card-calc);
    border-radius: var(--radius-xl-calc);
    border: 1px solid var(--border-color-calc);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm-calc);
}

@media (min-width: 768px) {
    .card-calc {
        padding: 2rem;
    }
}

.card-header-calc {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color-calc);
}

.card-title-calc {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.card-title-icon-calc {
    color: var(--primary-calc);
    font-size: 1.1rem;
    line-height: 1;
}

.currency-tag-calc {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    background-color: var(--primary-light-calc);
    color: var(--primary-hover-calc);
    border: 1px solid var(--primary-border-calc);
    border-radius: 6px;
}

/* ============================== Form group ============================== */
.form-group-calc {
    margin-bottom: 1.5rem;
}

.form-label-row-calc {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-label-calc {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.form-label-sm-calc {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted-calc);
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================== Type selector ============================== */
.type-selector-grid-calc {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .type-selector-grid-calc {
        grid-template-columns: 1fr 1fr;
    }
}

.btn-type-calc {
    padding: 0.875rem;
    text-align: left;
    border-radius: var(--radius-md-calc);
    border: 2px solid var(--border-color-calc);
    background-color: var(--bg-card-calc);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: inherit;
}

.btn-type-calc:hover {
    border-color: #cbd5e1;
}

.btn-type-calc.active-calc {
    border-color: var(--primary-calc);
    background-color: var(--primary-light-calc);
}

.btn-type-title-calc {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-main-calc);
}

.btn-type-sub-calc {
    font-size: 0.75rem;
    color: var(--text-muted-calc);
}

/* ============================== Value display boxes ============================== */
.input-display-box-calc {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--bg-slate-100-calc);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm-calc);
    border: 1px solid var(--border-color-calc);
}

.input-display-box-calc span {
    color: var(--text-muted-calc);
    font-weight: 600;
}

.input-display-box-calc input {
    width: 7rem;
    font-weight: 700;
    color: var(--text-main-calc);
    background: transparent;
    border: none;
    outline: none;
    text-align: right;
    font-size: 0.95rem;
    font-family: inherit;
}

.value-highlight-calc {
    font-weight: 700;
    color: var(--primary-hover-calc);
    font-size: 1rem;
}

/* ============================== Range slider ============================== */
.footer-calc-wrap-calc input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.footer-calc-wrap-calc input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: var(--primary-calc);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.footer-calc-wrap-calc input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--primary-hover-calc);
}

.footer-calc-wrap-calc input[type=range]::-moz-range-thumb {
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: var(--primary-calc);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.range-labels-calc {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light-calc);
    margin-top: 0.35rem;
}

/* ============================== Rate box ============================== */
.rate-box-calc {
    padding: 1rem;
    background-color: var(--bg-slate-50-calc);
    border-radius: var(--radius-md-calc);
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rate-box-calc input {
    width: 4.5rem;
    padding: 0.35rem 0.5rem;
    text-align: right;
    font-weight: 700;
    color: var(--text-main-calc);
    background-color: var(--bg-card-calc);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

/* ============================== Options / checkboxes ============================== */
.options-container-calc {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color-calc);
}

.checkbox-card-calc {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border-radius: var(--radius-md-calc);
    border: 1px solid var(--border-color-calc);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.checkbox-card-calc:hover {
    background-color: var(--bg-slate-50-calc);
}

.checkbox-card-calc input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-calc);
    cursor: pointer;
}

.checkbox-info-calc {
    font-size: 0.75rem;
}

.checkbox-title-calc {
    font-weight: 700;
    color: var(--text-main-calc);
    display: block;
}

.checkbox-desc-calc {
    color: var(--text-muted-calc);
}

/* ============================== Summary column ============================== */
.summary-column-calc {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-card-calc {
    background-color: var(--bg-dark-calc);
    color: var(--text-white-calc);
    padding: 1.5rem;
    border-radius: var(--radius-xl-calc);
    border: 1px solid var(--border-dark-calc);
    box-shadow: var(--shadow-lg-calc);
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .summary-card-calc {
        padding: 2rem;
    }
}

.summary-card-header-calc {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-light-calc);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-dark-calc);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-secure-calc {
    font-size: 0.75rem;
    font-weight: 400;
    color: #34d399;
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============================== Breakdown ============================== */
.breakdown-list-calc {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-size: 0.875rem;
}

.breakdown-row-calc {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breakdown-label-calc {
    color: var(--text-light-calc);
}

.breakdown-value-calc {
    font-weight: 600;
    color: #e2e8f0;
}

.breakdown-row-calc.tax-row-calc {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-dark-calc);
    font-size: 0.75rem;
}

.tax-value-calc {
    color: #fbbf24;
    font-weight: 600;
}

/* ============================== Status box ============================== */
.status-box-calc {
    margin-top: 1.5rem;
    padding: 0.875rem;
    border-radius: var(--radius-md-calc);
    background-color: var(--bg-dark-card-calc);
    border: 1px solid var(--border-dark-calc);
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.status-icon-calc {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 700;
}

.status-icon-calc.success-calc {
    background-color: var(--success-bg-calc);
    color: #34d399;
}

.status-icon-calc.danger-calc {
    background-color: var(--danger-bg-calc);
    color: var(--danger-calc);
}

.status-text-title-calc {
    font-size: 0.75rem;
    font-weight: 700;
}

.status-text-desc-calc {
    font-size: 0.75rem;
    color: var(--text-light-calc);
}

/* ============================== Total ============================== */
.total-container-calc {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-dark-calc);
}

.total-label-calc {
    font-size: 0.75rem;
    color: var(--text-light-calc);
    margin-bottom: 0.25rem;
}

.total-amount-calc {
    font-size: 2.25rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.due-date-row-calc {
    font-size: 0.75rem;
    color: var(--text-light-calc);
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
}

/* ============================== CTA button ============================== */
.btn-cta-calc {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.95rem;
    background-color: var(--primary-calc);
    color: var(--text-white-calc);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: var(--radius-md-calc);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(2,132,199,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-cta-calc:visited {
    color: var(--text-white-calc);
}

.btn-cta-calc:hover {
    background-color: var(--primary-hover-calc);
    color: var(--text-white-calc);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(2,132,199,0.5);
}

/* ============================== Warning banner ============================== */
.warning-banner-calc {
    background-color: var(--warning-bg-calc);
    border: 1px solid var(--warning-border-calc);
    border-radius: var(--radius-lg-calc);
    padding: 1rem;
    color: var(--warning-text-calc);
    font-size: 0.75rem;
    line-height: 1.4;
    display: flex;
    gap: 0.75rem;
}

.warning-banner-calc > span:first-child {
    color: #d97706;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* ============================== Helper ============================== */
.hidden-calc {
    display: none !important;
}

/* =========================================================================
   Стили таблицы графика платежей (raschet_table), которая приезжает по AJAX
   в контейнер #fc-schedule-container-calc. Классы .raschet_table/.razchet-1-table
   не имеют суффикса -calc, потому что приходят в готовом HTML из raschet-new.php
   (эту разметку не переписываем — она общая с legacy raschet.php).
   ========================================================================= */

/* Заголовок над таблицей */
#fc-schedule-container-calc .section__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 24px 0 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
#fc-schedule-container-calc .section__header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}
#fc-schedule-container-calc .section__header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
#fc-schedule-container-calc .section__header_margin-bottom_0 {
    margin-bottom: 0;
}

/* Обёртка со скроллом на мобилках */
#fc-schedule-container-calc .raschet_table {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    padding: 4px;
    margin-top: 8px;
    -webkit-overflow-scrolling: touch;
}

/* Сама таблица */
#fc-schedule-container-calc .razchet-1-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    color: #1f2937;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Заголовок таблицы */
#fc-schedule-container-calc .razchet-1-table tr.theadd td {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 14px;
    text-align: center;
    border: none;
    position: sticky;
    top: 0;
    z-index: 1;
}
#fc-schedule-container-calc .razchet-1-table tr.theadd td:first-child { border-top-left-radius:  8px; }
#fc-schedule-container-calc .razchet-1-table tr.theadd td:last-child  { border-top-right-radius: 8px; }

/* Обычные строки */
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td {
    padding: 12px 14px;
    text-align: right;
    border: none !important;
    border-bottom: 1px solid #eef2f7 !important;
    vertical-align: middle;
    background: transparent;
}
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:first-child {
    text-align: center;
    font-weight: 700;
    color: #0284c7;
    width: 60px;
}
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:nth-child(2) {
    text-align: center;
    color: #475569;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:nth-child(3) {
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:nth-child(4),
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:nth-child(5),
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:nth-child(6),
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:nth-child(7) {
    font-variant-numeric: tabular-nums;
    color: #475569;
}
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td:last-child {
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
}

/* Зебра */
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1:nth-child(even) td {
    background: #fafbfc;
}
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1:nth-child(even) td:last-child {
    background: #f1f5f9;
}

/* Hover */
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1:hover td {
    background: #e0f2fe !important;
    transition: background 0.12s ease;
}

/* Последняя строка — без нижней рамки */
#fc-schedule-container-calc .razchet-1-table tr.some-tr-1:last-child td {
    border-bottom: none !important;
}

/* Всплывающий комментарий по комиссиям/страховке */
#fc-schedule-container-calc .razchet-1-table .raschet_credit_table {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    background: #fff4e5;
    color: #92400e;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Мобилка */
@media (max-width: 640px) {
    #fc-schedule-container-calc .section__header h2 { font-size: 1.1rem; }
    #fc-schedule-container-calc .razchet-1-table    { font-size: 0.82rem; }
    #fc-schedule-container-calc .razchet-1-table tr.theadd td,
    #fc-schedule-container-calc .razchet-1-table tr.some-tr-1 td { padding: 9px 10px; }
}

/* =========================================================================
   Небольшой отступ и стилизация заголовка над списком офферов (Vue el-table).
   ========================================================================= */
#fc-kredits-container-calc .text_title {
    margin: 20px 0 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}
