/* --- Стили DTI Calculator (Emerald Theme) --- */
:root {
    --accent-emerald: #10B981;
    --accent-emerald-dark: #065F46;
    --accent-emerald-light: #ECFDF5;
    --gradient-emerald-card: linear-gradient(135deg, #34D399 0%, #059669 100%);
    
    /* Цвета спидометра */
    --gauge-green: #34D399;
    --gauge-yellow: #FBBF24;
    --gauge-red: #EF4444;

    /* Общие переменные */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --radius-lg: 16px;
    --font-main: 'Inter', sans-serif;
}

/* --- ГЛОБАЛЬНАЯ СТРУКТУРА --- */
.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* Сетка страницы */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.2fr 0.8fr; } }

/* --- ИНПУТЫ --- */
.calc-inputs { gap: 24px; }
.input-group { margin-bottom: 24px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper input {
    width: 100%; padding: 16px; padding-right: 40px;
    font-size: 18px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s; background: #fff;
    font-family: var(--font-main);
}
.input-wrapper input:focus { border-color: var(--accent-emerald); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.currency { position: absolute; right: 16px; color: var(--text-secondary); pointer-events: none; }
.divider { border: 0; border-top: 1px solid #E5E7EB; margin: 24px 0; }

/* --- СПИСОК ДОЛГОВ (АДАПТИВНЫЙ) --- */
.debt-row {
    display: grid;
    /* Desktop: Название | Платеж | Удалить */
    grid-template-columns: 1fr 120px 42px; 
    gap: 10px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
    align-items: center;
}

/* Мобильная версия списка (Плитка) */
@media (max-width: 600px) {
    .debt-row {
        grid-template-columns: 1fr 42px;
        grid-template-areas: 
            "name delete" 
            "price price";
        background: #F9FAFB; padding: 10px; border-radius: 12px;
        border: 1px solid #F3F4F6; gap: 8px;
    }
    .debt-name-wrap { grid-area: name; }
    .debt-price-wrap { grid-area: price; }
    .debt-delete-wrap { grid-area: delete; }
}

/* Элементы внутри строки */
.debt-row input { height: 46px; font-size: 15px; padding: 0 12px; }

.btn-icon-only {
    width: 100%; height: 46px; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
    color: #9CA3AF; cursor: pointer; transition: 0.2s;
}
.btn-icon-only:hover { color: #EF4444; background: #FEF2F2; border-color: #FECACA; }

.btn-add-row {
    width: 100%; padding: 14px;
    border: 2px dashed #E5E7EB; border-radius: 12px;
    background: transparent; color: var(--text-secondary);
    font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.2s;
}
.btn-add-row:hover { border-color: var(--accent-emerald); color: var(--accent-emerald); background: var(--accent-emerald-light); }

/* --- СПИДОМЕТР (CSS GAUGE) --- */
.card--emerald { background: var(--gradient-emerald-card); color: #fff; border: none; }
.card--emerald h2 { color: rgba(255,255,255,0.95); margin-bottom: 24px; text-align: center; }
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

.gauge-wrapper { 
    overflow: hidden; height: 120px; padding-top: 10px; 
    position: relative; width: 200px; margin: 0 auto; 
}

.gauge-body {
    background: conic-gradient(from 270deg, #6EE7B7 0%, #FCD34D 50%, #FCA5A5 100%);
    width: 200px; height: 200px; border-radius: 50%;
    position: relative; margin: 0 auto;
    /* Маска для создания дуги */
    mask-image: radial-gradient(transparent 65%, black 66%);
    -webkit-mask-image: radial-gradient(transparent 65%, black 66%);
}

.gauge-needle {
    position: absolute; bottom: 0; left: 50%;
    width: 4px; height: 100px; background: #fff;
    transform-origin: bottom center; transform: rotate(-90deg);
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 4px; z-index: 10; box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.gauge-needle::after { 
    content: ''; position: absolute; bottom: -6px; left: -6px; 
    width: 16px; height: 16px; background: #fff; border-radius: 50%; 
}

.gauge-labels { 
    display: flex; justify-content: space-between; 
    width: 220px; margin: -10px auto 0 auto; 
    font-size: 11px; opacity: 0.8; font-weight: 600; color: #fff; 
}
.gauge-value { text-align: center; margin-top: 10px; color: #fff; }
.gauge-value span { font-size: 42px; font-weight: 800; line-height: 1; display: block; }
.gauge-value small { font-size: 14px; opacity: 0.8; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }

/* --- КАРТОЧКА РЕЗУЛЬТАТА --- */
.result-status-box {
    background: rgba(255,255,255,0.2); border-radius: 12px; padding: 12px;
    text-align: center; font-size: 14px; font-weight: 600; margin-top: 16px; backdrop-filter: blur(4px);
}
.split-cost-box { background: #fff; border-radius: 12px; padding: 16px; color: var(--accent-emerald-dark); }
.split-label { font-size: 12px; color: var(--accent-emerald-dark); margin-bottom: 4px; text-transform: uppercase; font-weight: 700; opacity: 0.7; }
.split-value { font-size: 24px; font-weight: 800; }
.summary-divider { height: 1px; background: rgba(255,255,255,0.2); margin: 24px 0; }
.tip-box { font-size: 13px; opacity: 0.9; line-height: 1.5; }

/* --- НИЖНИЙ БЛОК (ПОЛНЫЙ КОД ИЗ FUEL.CSS) --- */
.info-wrapper { 
    padding: 60px 0 60px 0; margin-top: 60px; 
    border-top: 1px solid rgba(0,0,0,0.06); margin-bottom: 20px; 
}
.info-wrapper .container { max-width: 800px; margin: 0 auto; }

/* Заголовки с иконками */
.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; 
}

.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.04);
    flex-shrink: 0; margin-top: -4px;
}
.blue-icon svg { color: #2563EB; }
.green-icon svg { color: #10B981; }
.red-icon svg { color: #E11D48; }
.orange-icon svg { color: #F59E0B; }

.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: var(--radius-lg); 
    padding: 24px; display: flex; flex-direction: column; 
}
.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; }
.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500; }

.badge-blue { background: #2563EB; color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-green { background: #10B981; color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }

.math-expression { 
    background: #F9FAFB; border: 1px solid #E5E7EB; padding: 12px 16px; 
    border-radius: 12px; font-weight: 700; color: var(--accent-emerald-dark); 
    text-align: center; margin-bottom: 16px; font-size: 15px; 
}
.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: 24px; }
.calc-description strong { color: var(--text-primary); }

/* --- FAQ СТИЛИ (ACCORDION) --- */
.faq-fuel-style .faq-item { 
    background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; 
    margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; 
}
.faq-fuel-style .faq-item[open] { border-color: var(--accent-emerald); box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1); }

.faq-fuel-style summary.faq-question { 
    padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-primary); 
    list-style: none; display: flex; justify-content: space-between; align-items: center; 
}
.faq-fuel-style .faq-item[open] summary.faq-question { color: var(--accent-emerald); background: var(--accent-emerald-light); }

/* Иконка плюса/минуса */
.faq-question::after { content: '+'; font-size: 20px; color: var(--text-secondary); font-weight: 400; line-height: 1; }
.faq-fuel-style .faq-item[open] summary.faq-question::after { content: '−'; color: var(--accent-emerald); }

.faq-answer { padding: 20px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; }

/* --- АДАПТИВНОСТЬ НИЗА И ОБЩАЯ --- */
@media (max-width: 900px) {
    /* Формулы в одну колонку */
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    
    /* Уменьшение заголовков */
    .icon-heading { font-size: 20px; gap: 12px; margin-bottom: 20px; }
    .header-icon { width: 40px; height: 40px; border-radius: 12px; }
    .header-icon svg { width: 20px; height: 20px; }
    
    /* Карточки формул компактнее */
    .formula-card { padding: 24px; text-align: center; align-items: center; }
    .formula-header { align-items: center; width: 100%; }
    
    .math-expression { width: 100%; max-width: 300px; margin-left: auto; margin-right: auto; }
    .info-wrapper { margin-top: 40px; padding-top: 40px; }
    
    /* Спидометр чуть меньше */
    .gauge-wrapper { transform: scale(0.95); }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }