/* calc/assets/css/calculators/emergency_fund.css */

:root {
    --accent-emerald: #059669;
    --accent-emerald-light: #ECFDF5;
    --gradient-emerald-card: linear-gradient(135deg, #059669 0%, #047857 100%);
    --text-on-emerald: #ffffff;
    
    /* Цвета шкалы */
    --scale-danger: #EF4444; /* Red */
    --scale-warning: #F59E0B; /* Amber */
    --scale-safe: #10B981; /* Emerald */
}

.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: 900px) { .calc-grid { grid-template-columns: 1.2fr 0.8fr; } }

/* --- Inputs --- */
.input-block-title {
    font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-secondary); margin-bottom: 16px; font-weight: 700;
}

.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: 14px; padding-right: 40px;
    font-size: 16px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: all 0.2s;
    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); }
.suffix { position: absolute; right: 16px; color: var(--text-secondary); pointer-events: none; font-size: 14px; }
.helper-text { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }

.soft-divider-small { border: none; height: 1px; background: #F3F4F6; margin: 24px 0; }

/* --- Карточка результата --- */
.card--emerald { background: var(--gradient-emerald-card); color: var(--text-on-emerald); border: none; }
.card--emerald h2 { color: rgba(255,255,255,0.8); font-size: 14px; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.05em; }

.result-main { display: flex; align-items: baseline; gap: 8px; margin: 12px 0; }
.result-value { font-size: 64px; font-weight: 800; line-height: 1; }
.result-unit { font-size: 24px; font-weight: 600; opacity: 0.8; }
.result-sub { font-size: 15px; opacity: 0.9; font-weight: 500; background: rgba(0,0,0,0.1); padding: 8px 12px; border-radius: 8px; display: inline-block; }

.summary-divider { height: 1px; background: rgba(255,255,255,0.2); margin: 24px 0; }

/* --- Killer Feature: Survival Gauge --- */
.survival-gauge-wrapper { margin-bottom: 24px; }
.gauge-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; opacity: 0.9; }

.survival-track {
    position: relative; height: 12px; width: 100%; border-radius: 6px; 
    background: rgba(0,0,0,0.2); margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.survival-bar {
    height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, #FCD34D 0%, #34D399 100%);
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s;
    position: relative;
    /* Если мало (красный) - меняем JS'ом цвет или через классы, здесь базовый градиент */
}

/* Маркеры на шкале */
.track-mark {
    position: absolute; top: 14px; transform: translateX(-50%);
    font-size: 10px; opacity: 0.6; font-weight: 700;
}
.track-mark::before {
    content: ''; position: absolute; top: -14px; left: 50%; width: 1px; height: 12px; background: rgba(255,255,255,0.3);
}

.gauge-legend { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.7; margin-top: 20px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Цели */
.goals-box {
    background: rgba(255,255,255,0.1); padding: 16px; border-radius: 12px; font-size: 14px;
}
.goal-row { display: flex; justify-content: space-between; margin-bottom: 8px; opacity: 0.9; }
.goal-row strong { font-size: 16px; }
.goal-gap { 
    margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.15); 
    font-size: 13px; color: #fff; font-weight: 600; 
}
#gap-val { color: #FCD34D; }

/* --- ИНФОРМАЦИОННЫЙ БЛОК (Emerald Theme) --- */
.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; }
.small-heading { margin-top: 40px; margin-bottom: 16px; font-size: 20px; }

.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; }
.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }
.small-heading .header-icon { width: 40px; height: 40px; }
.small-heading .header-icon svg { width: 20px; height: 20px; }

.emerald-icon svg { color: var(--accent-emerald); }
.blue-icon svg { color: #2563EB; }
.red-icon svg { color: #E11D48; }

.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: 0 4px 20px rgba(0, 0, 0, 0.03); border-radius: 24px; padding: 24px; transition: all 0.3s; display: flex; flex-direction: column; }
.formula-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08); }

.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-emerald { background: var(--accent-emerald); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: inline-block; }
.badge-dark { background: #1F2937; color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: inline-block; }

.math-expression { background: var(--accent-emerald-light); border: 1px solid #D1FAE5; padding: 12px 16px; border-radius: 12px; font-weight: 700; color: #059669; 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 Emerald Style */
.faq-emerald-style .faq-item { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-emerald-style .faq-item[open] { border-color: var(--accent-emerald); box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15); }
.faq-emerald-style summary.faq-question { padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; position: relative; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-emerald-style summary.faq-question:hover { background-color: #F9FAFB; }
.faq-emerald-style .faq-item[open] summary.faq-question { color: #047857; background: var(--accent-emerald-light); }
.faq-question::after { content: '+'; font-size: 20px; color: var(--text-secondary); font-weight: 400; line-height: 1; }
.faq-question .icon-plus { display: none; }
.faq-emerald-style .faq-item[open] summary.faq-question::after { content: '−'; color: #047857; }
.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; }
}