/* --- Стили для Кирпича (Brick Theme) --- */
:root {
    --accent-brick: #EA580C; /* Orange 600 */
    --accent-brick-light: #FFEDD5;
    --gradient-brick-card: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
}

.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; } }

/* Inputs */
.calc-inputs { gap: 16px; }
.input-group { margin-bottom: 16px; }

/* Улучшенный заголовок с кнопкой */
.label-row { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 8px; 
}
.label-row label { margin-bottom: 0; font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* Кнопка "Сложить стены" */
.btn-text {
    background: none; border: none; padding: 0;
    color: var(--accent-brick); font-size: 12px; font-weight: 600;
    cursor: pointer; text-decoration: none; border-bottom: 1px dashed rgba(234, 88, 12, 0.4);
    transition: all 0.2s;
}
.btn-text:hover { color: #C2410C; border-bottom-color: #C2410C; }

/* FIX стрелок */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper input {
    width: 100%; padding: 14px 16px; 
    font-size: 18px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s;
    font-family: var(--font-main);
}
.input-wrapper input:focus { border-color: var(--accent-brick); box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15); }

.suffix { 
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); pointer-events: none; font-size: 14px; 
}
.helper-text { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.mt-2 { margin-top: 8px; }

.divider { border-top: 1px solid #E5E7EB; margin: 24px 0; }

/* Калькулятор стен (Wall Calc) */
.wall-calc-box {
    background: #FFF7ED; /* Очень светлый оранжевый */
    border: 1px solid #FED7AA;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.wall-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.wall-row input {
    width: 100%; padding: 8px 12px; font-size: 14px;
    border: 1px solid #E5E7EB; border-radius: 8px; outline: none;
    background: #fff;
}
.wall-row input:focus { border-color: var(--accent-brick); }
.wall-del {
    color: #EF4444; font-size: 18px; cursor: pointer; padding: 4px; line-height: 1;
}

.btn-add-wall {
    width: 100%; padding: 8px; background: #fff;
    border: 1px dashed #D1D5DB; border-radius: 8px;
    color: var(--text-secondary); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-add-wall:hover { border-color: var(--accent-brick); color: var(--accent-brick); background: #fff; }


/* Select Custom */
.calc-select {
    width: 100%; padding: 14px 16px;
    font-size: 16px; font-weight: 500; color: var(--text-primary);
    border: 1px solid #E5E7EB; border-radius: 12px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 16px center;
    appearance: none; -webkit-appearance: none; cursor: pointer;
}
.calc-select:focus { border-color: var(--accent-brick); outline: none; }

/* Grid Radio (Толщина) */
.radio-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-option { cursor: pointer; }
.radio-option input { display: none; }
.radio-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 1px solid #E5E7EB; border-radius: 10px; padding: 10px;
    transition: all 0.2s; background: #fff; height: 100%; text-align: center;
}
.radio-card strong { font-size: 14px; color: var(--text-primary); margin-bottom: 2px; }
.radio-card span { font-size: 11px; color: var(--text-secondary); }

.radio-option input:checked + .radio-card {
    border-color: var(--accent-brick); background: var(--accent-brick-light);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.15);
}
.radio-option input:checked + .radio-card strong { color: #C2410C; }

/* Mode Switcher */
.mode-switcher {
    display: flex; background: #F3F4F6; padding: 4px;
    border-radius: 12px; margin-bottom: 24px; gap: 4px;
}
.mode-btn {
    flex: 1; padding: 10px 4px; border: none; background: transparent;
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    border-radius: 8px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.mode-btn.active { background: #fff; color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* Counter Mini */
.counter-mini {
    display: flex; align-items: center; background: #fff;
    border: 1px solid #E5E7EB; border-radius: 10px; overflow: hidden; height: 48px;
}
.cnt-btn {
    width: 40px; height: 100%; border: none; background: #F9FAFB;
    cursor: pointer; font-weight: bold; color: var(--text-secondary); font-size: 18px;
}
.cnt-btn:hover { background: #E5E7EB; color: var(--text-primary); }
.counter-mini input {
    width: 100%; height: 100%; text-align: center; border: none; 
    font-weight: 600; font-size: 16px; outline: none; padding: 0;
}

/* Результаты (Brick Card) */
.card--brick { background: var(--gradient-brick-card); color: #fff; border: none; }
.card--brick h2 { color: rgba(255,255,255,0.95); margin-bottom: 20px; font-size: 16px; }
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

.big-result {
    font-size: 56px; font-weight: 800; line-height: 1; margin-bottom: 24px;
    display: flex; align-items: baseline; gap: 12px; white-space: nowrap;
}
.big-result small { font-size: 24px; font-weight: 600; opacity: 0.8; }

.visual-stack {
    display: flex; align-items: center; gap: 16px; 
    background: rgba(255,255,255,0.15); padding: 12px 16px; border-radius: 12px;
    margin-bottom: 24px; backdrop-filter: blur(4px);
}
.stack-icon { font-size: 24px; }
.stack-info { display: flex; flex-direction: column; }
.stack-info span { font-size: 12px; opacity: 0.9; }
.stack-info strong { font-size: 18px; }

.summary-divider { height: 1px; background: rgba(255,255,255,0.2); margin: 24px 0; }

.details-list { display: flex; flex-direction: column; gap: 12px; }
.detail-row {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.2); 
    padding-bottom: 10px; font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row strong { font-size: 16px; font-weight: 700; }

.tip-box {
    font-size: 13px; line-height: 1.5; color: #ffffff !important;
    background: rgba(0, 0, 0, 0.3) !important; padding: 16px; border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15); margin-top: 24px;
}
.tip-box p { margin: 0; color: #ffffff !important; }

/* --- НОВЫЕ ИНФОРМАЦИОННЫЕ БЛОКИ (Адаптация под Brick/Orange) --- */

.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;
}

.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }

/* Цвета иконок */
.blue-icon svg { color: #2563EB; }
.orange-icon svg { color: #EA580C; } /* Brick Accent */
.green-icon svg { color: #10B981; }
.red-icon svg { color: #EF4444; }

/* Маленькие подзаголовки */
.small-heading {
    margin-top: 40px;
    margin-bottom: 16px;
    font-size: 20px;
}
.small-heading .header-icon { width: 40px; height: 40px; }
.small-heading .header-icon svg { width: 20px; height: 20px; }

.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;
    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); }

/* Вертикальный хедер (бейдж сверху) */
.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: #2563EB; 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-green {
    background: #10B981; color: #fff;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: inline-block;
}

.formula-card p {
    font-size: 14px; color: var(--text-secondary);
    margin: 0; line-height: 1.5; font-weight: 500;
}

.formula-card small {
    display: block; margin-top: 12px; font-size: 12px; color: var(--text-secondary); opacity: 0.7;
}

.math-expression {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--accent-brick); /* Brick Accent */
    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 (Новый стиль под Brick) */
.faq-section .faq-item {
    background: #fff; border: 1px solid #E5E7EB;
    border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; transition: all 0.2s ease;
}

.faq-section .faq-item[open] {
    border-color: var(--accent-brick); 
    box-shadow: 0 4px 20px rgba(234, 88, 12, 0.1); /* Brick Shadow */
}

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;
}

summary.faq-question:hover { background-color: #F9FAFB; }

.faq-section .faq-item[open] summary.faq-question {
    color: var(--accent-brick);
    background: var(--accent-brick-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-section .faq-item[open] summary.faq-question::after {
    content: '−'; color: var(--accent-brick);
}

.faq-answer {
    padding: 20px; color: var(--text-secondary);
    line-height: 1.6; font-size: 15px;
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 900px) {
    /* Сетка в 1 колонку */
    .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; }
}