/* calc/assets/css/calculators/siding.css */

:root {
    --bg-forest-card: #F4F5F0; /* Soft Limestone/Alabaster */
    --text-forest-main: #2D3732; /* Dark Pine/Moss */
    --text-forest-muted: #6B7264; /* Muted Sage */
    
    /* Creative Accents: Forest & Timber */
    --accent-pine: #4F6352; /* Deep Pine Green */
    --accent-timber: #B07C4F; /* Warm Wood/Timber */
    --accent-pine-glow: rgba(79, 99, 82, 0.15);
    
    --border-forest: #E2E4DC; 
    --shadow-forest: 0 20px 40px -10px rgba(45, 55, 50, 0.1), 
                     0 0 15px rgba(0, 0, 0, 0.02);
}

/* =========================================
   ОСНОВНАЯ СЕТКА И КАРКАС
   ========================================= */
.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: 1fr 1fr; } }

.calc-inputs { gap: 16px; }
.group-title { font-size: 14px; font-weight: 800; color: var(--text-forest-main); margin: 0 0 12px 0; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #E2E4DC; padding-bottom: 8px;}

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); transition: color 0.3s;}

.input-wrapper { position: relative; display: flex; align-items: center; }
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 select,
.input-wrapper input {
    width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 600;
    border: 2px solid transparent; border-radius: 12px;
    background: #FFFFFF; border: 1px solid #E2E4DC; outline: none; transition: all 0.3s;
    font-family: inherit; color: var(--text-forest-main); appearance: none;
}
.input-wrapper select { cursor: pointer; }
.input-wrapper input:focus, .input-wrapper select:focus { 
    border-color: var(--accent-pine); 
    box-shadow: 0 0 0 4px var(--accent-pine-glow); 
}

.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.info-alert {
    display: flex; align-items: flex-start; gap: 12px;
    background: #EAF0EB; border: 1px solid #D1DED5;
    padding: 16px; border-radius: 12px; margin-top: 16px;
    color: var(--accent-pine); font-size: 13px; line-height: 1.5;
}
.info-alert svg { flex-shrink: 0; color: var(--accent-pine); margin-top: -2px; }
.hidden { display: none !important; }

/* =========================================
   ПРАВАЯ КАРТОЧКА (Forest & Timber Theme)
   ========================================= */
.card--forest-timber { 
    background: var(--bg-forest-card); 
    color: var(--text-forest-main); 
    border: 1px solid var(--border-forest); border-radius: 24px;
    box-shadow: var(--shadow-forest);
    overflow: hidden; padding: 32px 0 0 0; 
}
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

.forest-title { 
    color: var(--accent-timber); margin: 0 24px 16px; 
    font-size: 12px; text-align: center; 
    font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase;
}

/* ЗАЩИЩЕННЫЙ CANVAS CONTAINER */
.canvas-container-wrapper {
    width: 100%; height: 260px; max-width: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #FFFFFF; border-top: 1px solid var(--border-forest); border-bottom: 1px solid var(--border-forest);
    position: relative; overflow: hidden; box-sizing: border-box;
    /* Легкий градиент неба и земли на фоне */
    background-image: linear-gradient(180deg, #F0F4F8 0%, #FFFFFF 70%, #F4F5F0 100%);
}
#math-canvas { 
    display: block; width: 100%; height: 100%; max-width: 100%; box-sizing: border-box;
}
.chart-label { position: absolute; top: 12px; left: 16px; font-size: 11px; font-weight: 700; color: var(--accent-pine); text-transform: uppercase; letter-spacing: 0.05em; background: rgba(255,255,255,0.9); padding: 4px 8px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.05);}

/* Блок результатов */
.forest-display { 
    display: flex; flex-direction: column;
    padding: 24px; gap: 16px; background: #FFFFFF;
}
.math-result-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #F4F5F0; padding: 16px; border-radius: 16px;
    flex: 1; border: 1px solid var(--border-forest);
    box-sizing: border-box; text-align: center;
}
.highlight-box { border-color: #C3E0CA; background: #EAF0EB;}
.highlight-box .res-val { color: var(--accent-pine); }

/* Мини-сетка для комплектующих */
.accessories-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%;
}
.acc-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #FAFAFA; padding: 12px; border-radius: 12px; border: 1px solid #E2E4DC;
    text-align: center;
}
.acc-val { font-size: 24px; font-weight: 800; color: var(--accent-timber); line-height: 1; margin-bottom: 4px;}
.acc-label { font-size: 11px; color: var(--text-forest-muted); font-weight: 600; text-transform: uppercase; line-height: 1.3;}

.res-label { font-size: 12px; color: var(--text-forest-muted); font-weight: 700; text-transform: uppercase; margin-bottom: 8px;}
.res-val { font-size: 32px; font-weight: 800; color: var(--text-forest-main); font-variant-numeric: tabular-nums; line-height: 1;}
.res-val small { font-size: 16px; font-weight: 600; color: var(--text-forest-muted); }
.sub-val { font-size: 12px; color: var(--text-forest-muted); font-weight: 600; margin-top: 8px; background: rgba(0,0,0,0.03); padding: 4px 10px; border-radius: 6px;}

.error-msg {
    margin: 0 24px 24px; background: #FEF2F2; color: #E11D48;
    padding: 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
    border: 1px solid #FECDD3; text-align: center;
}

.forest-divider { height: 1px; background: var(--border-forest); margin: 0 24px; }

/* Детали */
.details-list { display: flex; flex-direction: column; background: transparent; margin: 0;}
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; font-size: 14px; border-bottom: 1px solid var(--border-forest); color: var(--text-forest-muted);}
.detail-row:last-child { border-bottom: none; }
.detail-row strong { font-size: 16px; font-weight: 700; color: var(--text-forest-main); }

/* =========================================
   SEO ИНФОБЛОКИ И ТАБЛИЦА
   ========================================= */
.info-wrapper { padding: 60px 0; margin-top: 60px; border-top: 1px solid rgba(0,0,0,0.06); margin-bottom: 20px; }
.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; }

.timber-icon svg { color: var(--accent-timber); }
.slate-icon svg { color: var(--text-forest-muted); }

.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; 
    width: 100%; box-sizing: border-box;
}
.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; display: flex; flex-direction: column; 
    min-width: 0; max-width: 100%; box-sizing: border-box;
}
.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-forest { background: #EAF0EB; color: #4F6352; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge-timber { background: #F8ECE1; color: #B07C4F; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; }

.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500; }

.math-expression { background: #FAFAFA; border: 1px solid #E2E8F0; padding: 12px 16px; border-radius: 12px; text-align: center; margin-bottom: 16px; max-width: 100%; overflow-x: auto; box-sizing: border-box; font-size: 18px;}
.math-expression::-webkit-scrollbar { display: none; }

/* ТАБЛИЦА */
.seo-table-container { background: #fff; border: 1px solid #E5E7EB; border-radius: 16px; padding: 24px; margin-bottom: 40px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.seo-table-container h3 { margin-top: 0; margin-bottom: 20px; color: var(--text-forest-main); font-size: 18px; }
.seo-table { width: 100%; border-collapse: collapse; text-align: left; }
.seo-table th { background: #F4F5F0; padding: 12px 16px; font-weight: 700; color: var(--text-forest-muted); border-bottom: 2px solid #E2E4DC; }
.seo-table td { padding: 16px; border-bottom: 1px solid #E2E4DC; color: var(--text-forest-main); font-weight: 500; }
.seo-table tr:last-child td { border-bottom: none; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 48px 0; }

/* FAQ */
.faq-section .faq-item { background: #fff; border: 1px solid #E2E4DC; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-section .faq-item[open] { border-color: var(--accent-pine); box-shadow: var(--shadow-forest); }
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; transition: background 0.2s; }
summary.faq-question:hover { background-color: #EAF0EB; }
.faq-section .faq-item[open] summary.faq-question { color: var(--accent-pine); background: #EAF0EB; }
.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-pine); }
.faq-answer, .faq-item div[itemprop="text"] { padding: 20px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; }

/* МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 900px) {
    .row-2-col { grid-template-columns: 1fr; }
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    .seo-table-container { padding: 16px; overflow-x: auto; }
    .seo-table th, .seo-table td { padding: 12px 10px; font-size: 14px; }
}