/* calc/assets/css/calculators/mortgage-early-payoff.css */

:root {
    --mortgage-primary: #1D4ED8; /* Насыщенный синий */
    --mortgage-bg: #EFF6FF;      /* Светло-синий фон */
    --mortgage-success: #10B981; /* Зеленый для выгоды */
    --mortgage-accent: #F59E0B;  /* Желтый для акцентов */
    
    /* Цвета графика */
    --bar-principal: #93C5FD;
    --bar-interest: #FCA5A5;
    --bar-saved: #34D399;
}

/* --- ВЕРХНЯЯ ЧАСТЬ (КАЛЬКУЛЯТОР) --- */
.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; font-size: 16px; }

.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 992px) { .calc-grid { grid-template-columns: 1fr 1fr; } }

.form-divider { border: none; height: 1px; background: #E5E7EB; margin: 24px 0; }

/* Инпуты */
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.label-with-icon { display: flex; align-items: center; gap: 6px; color: var(--mortgage-primary) !important; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input {
    width: 100%; padding: 14px 16px; padding-right: 48px;
    font-size: 16px; font-weight: 600; font-family: inherit;
    border: 1px solid #D1D5DB; border-radius: 12px;
    transition: all 0.2s; outline: none;
}
.input-wrapper input:focus { border-color: var(--mortgage-primary); box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.1); }
.currency, .suffix { position: absolute; right: 16px; color: var(--text-secondary); font-weight: 600; pointer-events: none; }
.text-accent { color: var(--mortgage-primary); }

.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.highlight-group { background: var(--mortgage-bg); padding: 16px; border-radius: 16px; border: 1px dashed #BFDBFE; }
.helper-text { font-size: 12px; color: #6B7280; margin-top: 8px; line-height: 1.4; }

/* Сегмент контрол (Радио) */
.segment-control { display: flex; gap: 8px; background: #F3F4F6; padding: 4px; border-radius: 12px; }
.segment-item { flex: 1; position: relative; }
.segment-item input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.segment-box {
    display: flex; align-items: center; justify-content: center;
    padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
    color: #6B7280; transition: all 0.2s; cursor: pointer; text-align: center;
}
.segment-item input:checked + .segment-box { background: #fff; color: var(--mortgage-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* Правая карточка результатов */
.mortgage-result-card { background: #fff; border: 2px solid var(--mortgage-bg); padding: 32px; }
@media (min-width: 992px) { .sticky-card { position: sticky; top: 24px; } }

.result-header { text-align: center; margin-bottom: 32px; }
.result-header h2 { font-size: 18px; color: #6B7280; margin: 0 0 12px 0; }
.main-profit { display: flex; flex-direction: column; align-items: center; }
.main-profit span { font-size: 42px; font-weight: 800; color: var(--mortgage-success); line-height: 1.1; letter-spacing: -1px; }
.main-profit small { font-size: 14px; font-weight: 600; color: #6B7280; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.badge-time-saved { 
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 16px; background: #ECFDF5; color: #047857; 
    padding: 8px 16px; border-radius: 99px; font-size: 14px; font-weight: 500;
    border: 1px solid #A7F3D0;
}

/* KILLER FEATURE: Stacked Bars */
.visual-comparison { margin-bottom: 32px; background: #F9FAFB; padding: 20px; border-radius: 16px; }
.visual-title { font-size: 13px; font-weight: 700; color: #374151; margin: 0 0 16px 0; text-transform: uppercase; }

.bar-row { margin-bottom: 16px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #6B7280; margin-bottom: 6px; }
.active-label { color: #111827; }
.text-success { color: var(--mortgage-success); }

.stacked-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; background: #E5E7EB; width: 100%; }
.bar-segment { display: flex; align-items: center; justify-content: center; overflow: hidden; transition: width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); }
.seg-val { font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; padding: 0 4px; opacity: 0.9; }

.principal { background: var(--bar-principal); }
.interest { background: var(--bar-interest); }
.success-bg { background: #F87171; }
.saved { background: repeating-linear-gradient(45deg, var(--bar-saved), var(--bar-saved) 10px, #10B981 10px, #10B981 20px); }

/* Итоги под графиком */
.summary-divider { height: 1px; background: #E5E7EB; margin: 24px 0; }
.details-list { display: flex; flex-direction: column; gap: 12px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px dashed #E5E7EB; font-size: 14px; color: #4B5563; }
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-row strong { font-size: 16px; font-weight: 700; color: #111827; }
.text-base { color: #111827 !important; }

/* --- НИЖНЯЯ ЧАСТЬ (ИНФОРМАЦИЯ, СТАТЬЯ, FAQ, SEO) --- */

.info-wrapper { padding: 60px 0; margin-top: 40px; border-top: 1px solid #E5E7EB; }

/* Авторский бейдж (E-E-A-T) */
.author-badge {
    display: flex; align-items: center; gap: 16px; margin-bottom: 32px; 
    padding: 16px 20px; background: #F8FAFC; border-radius: 12px; border: 1px solid #E2E8F0;
}
.author-avatar {
    width: 44px; height: 44px; background: var(--mortgage-primary); color: #fff; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    font-size: 20px; flex-shrink: 0; /* ИСПРАВЛЕНИЕ: запрещаем сжатие аватарки */
}
.author-info { display: flex; flex-direction: column; min-width: 0; }
.author-name { font-size: 14px; font-weight: 600; color: #111827; line-height: 1.4; }
.author-date { font-size: 12px; color: #6B7280; margin-top: 4px; }

/* Заголовки с иконками */
.icon-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.3; letter-spacing: -0.02em; }
.header-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); flex-shrink: 0; margin-top: -4px; font-size: 24px; }

.blue-icon { color: var(--mortgage-primary); }
.green-icon { color: var(--mortgage-success); }
.yellow-icon { color: var(--mortgage-accent); }
.red-icon { color: #EF4444; }

.small-heading { margin-top: 48px; margin-bottom: 16px; font-size: 20px; }
.small-heading .header-icon { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }

.intro-text { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }

/* Секция Формул */
.formulas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px; }
.formula-card { background: #fff; border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-soft); border-radius: 24px; padding: 24px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; flex-direction: column; }
.formula-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: rgba(29, 78, 216, 0.1); }
.formula-header { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.formula-card h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }

.badge-blue { background: var(--mortgage-primary); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }
.badge-green { background: var(--mortgage-success); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }

.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.6; font-weight: 500; }
.math-expression { background: var(--mortgage-bg); border: 1px dashed #BFDBFE; padding: 16px; border-radius: 12px; font-weight: 700; color: var(--mortgage-primary); text-align: center; margin-bottom: 16px; font-size: 16px; font-family: 'Courier New', Courier, monospace; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 48px 0; }

/* Статья */
.calc-description p { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 20px; }
.calc-description strong { color: var(--text-primary); font-weight: 700; }

/* SEO Таблица */
.seo-table-wrapper { overflow-x: auto; margin-bottom: 40px; background: #fff; border-radius: 16px; border: 1px solid #E5E7EB; box-shadow: var(--shadow-soft); }
.seo-table { width: 100%; border-collapse: collapse; min-width: 400px; text-align: left; }
.seo-table th { background: #F9FAFB; padding: 16px 20px; font-size: 13px; font-weight: 700; color: #6B7280; text-transform: uppercase; border-bottom: 1px solid #E5E7EB; }
.seo-table td { padding: 16px 20px; font-size: 15px; border-bottom: 1px solid #F3F4F6; color: #374151; }
.seo-table tr:last-child td { border-bottom: none; }

/* HowTo Шаги */
.howto-section { margin-top: 40px; }
.howto-step { display: flex; gap: 16px; margin-bottom: 24px; background: #fff; padding: 20px; border-radius: 16px; border: 1px solid #E5E7EB; transition: box-shadow 0.2s; }
.howto-step:hover { box-shadow: var(--shadow-soft); }
.step-num { width: 32px; height: 32px; background: var(--mortgage-bg); color: var(--mortgage-primary); font-weight: 800; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.step-content h4 { margin: 0 0 8px 0; font-size: 16px; color: #111827; }
.step-content p { margin: 0; font-size: 14px; color: #6B7280; line-height: 1.6; }

/* FAQ Секция */
.faq-section .faq-item { background: #fff; border: 1px solid #E5E7EB; border-radius: 16px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-section .faq-item:hover { border-color: #D1D5DB; }
.faq-section .faq-item[open] { border-color: var(--mortgage-primary); box-shadow: 0 4px 20px rgba(29, 78, 216, 0.08); }
summary.faq-question { padding: 20px 24px; cursor: pointer; font-weight: 600; color: var(--text-primary); font-size: 16px; list-style: none; position: relative; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-section .faq-item[open] summary.faq-question { color: var(--mortgage-primary); background: var(--mortgage-bg); border-bottom: 1px solid #BFDBFE; }
.faq-question::after { content: '+'; font-size: 24px; color: var(--text-secondary); font-weight: 400; line-height: 1; transition: transform 0.3s; }
.faq-section .faq-item[open] summary.faq-question::after { content: '−'; color: var(--mortgage-primary); }
.faq-answer, .faq-item div[itemprop="text"] { padding: 24px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; background: #fff; }
.faq-answer p { margin: 0; }

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 900px) {
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; }
    .icon-heading { font-size: 20px; gap: 12px; }
    .header-icon { width: 40px; height: 40px; font-size: 20px; }
    .formula-card { padding: 20px; }
    .howto-step { padding: 16px; gap: 12px; }
    summary.faq-question { padding: 16px 20px; font-size: 15px; }
    .faq-answer, .faq-item div[itemprop="text"] { padding: 20px; }
}

@media (max-width: 480px) {
    /* Исправление карточки автора на узких экранах */
    .author-badge {
        align-items: flex-start;
        padding: 12px;
        gap: 12px;
    }
    .author-avatar {
        width: 36px; height: 36px; font-size: 16px;
    }
}