/* Redesign of the lower parameter form (База…Тип строения). Additive only —
   no ids/classes used by JS are renamed. Load AFTER calculator-addons.css. 
 */

#inputSection .calc-section {
    border: 1.5px solid var(--c-border, #e2e8f0);
    border-radius: 0;
    margin: 0;
    background: var(--c-surface, #fff);
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    overflow: hidden;
    transition: box-shadow .18s, border-color .18s;
}
#inputSection .calc-section:hover { box-shadow: 0 4px 14px rgba(15,23,42,.07); }

#inputSection .calc-section-toggle {
    padding: 15px 18px;
    gap: 12px;
    background: #dbeaf9c7;
}
#inputSection .calc-section-toggle::before {
    content: "";
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    background: var(--c-accent-lt, #eef4ff);
}
#inputSection [data-sec="sec-base"]::before      { content: "📍"; }
#inputSection [data-sec="sec-geo"]::before       { content: "📐"; }
#inputSection [data-sec="sec-struct"]::before    { content: "🧱"; }
#inputSection [data-sec="sec-eng"]::before       { content: "⚡"; }
#inputSection [data-sec="sec-extras"]::before    { content: "➕"; }
#inputSection [data-sec="sec-warn"]::before      { content: "⚠️"; background: #fff3cd; }
#inputSection [data-sec="sec-docs"]::before      { content: "📄"; }
#inputSection [data-sec="sec-notinc"]::before    { content: "🚫"; background: #f1f5f9; }
#inputSection [data-sec="sec-objtype"]::before   { content: "🏗️"; }

#inputSection .calc-section-label {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: var(--c-text, #0f172a) !important;
}
#inputSection .calc-section-chev { margin-left: auto; font-size: 14px; }
#inputSection .calc-section-body { padding: 6px 20px 20px; }

/* field grid rhythm */
#inputSection .fgrid-2,
#inputSection .fgrid-3 { gap: 14px 16px; }

/* Раздел База: Регион и Материал стен — каждый на своей строке,
   не в 2 колонки (scoped через #sec-base, другие .fgrid-2 не затронуты) 
 */
#sec-base.calc-section-body > .fgrid-2 { grid-template-columns: 1fr; }
#inputSection .fgroup { gap: 6px; }
#inputSection .fgroup label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-muted, #64748b);
}
#inputSection .fgroup label::before { margin-right: 5px; }
#inputSection label[for="regionCoef"]::before             { content: "🌍"; }
#inputSection label[for="area"]::before                   { content: "📏"; }
#inputSection label[for="floors"]::before                 { content: "🏢"; }
#inputSection label[for="ceilings"]::before                { content: "↕️"; }
#inputSection label[for="foundation"]::before              { content: "🧱"; }
#inputSection label[for="roof"]::before                    { content: "🏠"; }
#inputSection label[for="windows"]::before                 { content: "🪟"; }
#inputSection label[for="pack"]::before                    { content: "📦"; }
#inputSection label[for="finishing"]::before                { content: "🎨"; }
#inputSection label[for="fnd_waterproofing"]::before        { content: "💧"; }
#inputSection label[for="fnd_insulation"]::before            { content: "❄️"; }
#inputSection label[for="plinth_finish"]::before            { content: "🧱"; }
#inputSection label[for="wall_insulation"]::before           { content: "🧊"; }
#inputSection label[for="wall_exterior_finish"]::before      { content: "🎨"; }
#inputSection label[for="roof_covering"]::before             { content: "🏚️"; }
#inputSection label[for="roof_insulation"]::before           { content: "❄️"; }
#inputSection label[for="heating"]::before                  { content: "🔥"; }
#inputSection label[for="vent"]::before                     { content: "🌬️"; }
#inputSection label[for="reserve"]::before                  { content: "🛡️"; }
#inputSection label[for="terrace"]::before                  { content: "🚪"; }
#inputSection label[for="garage"]::before                   { content: "🚗"; }
#inputSection label[for="design"]::before                   { content: "📐"; }
#inputSection label[for="supervision"]::before               { content: "👁️"; }
#inputSection label[for="obj_building_type"]::before         { content: "🏗️"; }
#inputSection label[for="obj_building_subtype"]::before       { content: "🏗️"; }
#inputSection label[for="obj_building_technology"]::before    { content: "🏗️"; }
#inputSection label[for="otherExtra"]::before                { content: "💳"; }

/* inputs / selects */
#inputSection select,
#inputSection input[type="number"],
#inputSection input[type="text"] {
    height: 42px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 10px;
    background: var(--c-surface2, #f8fafc);
}
#inputSection select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 34px;
}
#inputSection select:hover,
#inputSection input:hover { background-color: var(--c-surface, #fff); }
#inputSection select:focus,
#inputSection input:focus { background-color: var(--c-surface, #fff); }

/* subgroup dividers (extras / structural details) */
#inputSection .calc-subhead {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-accent, #2563eb);
    margin: 18px 0 6px;
    padding-top: 12px;
    border-top: 1px dashed var(--c-border, #e2e8f0);
}
#inputSection .calc-subhead:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* warn note */
#inputSection .calc-warn-note {
    background: #fffaf0;
    border: 1px solid #fcd9a8;
    border-radius: 10px;
    padding: 12px 14px;
    color: #92400e;
}

/* checklists (documents / not included) */
#inputSection .calc-check-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#inputSection .calc-check-list li {
    padding: 9px 12px !important;
    background: var(--c-surface2, #f8fafc);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 9px;
    line-height: 1.5;
}
#inputSection .calc-check-list.muted li { background: #f4f4f5; }

/* toggle rows a touch bigger for tap targets */
#inputSection .calc-toggle-row { padding: 11px 14px; border-radius: 10px; }

@media (max-width: 520px) {
    #inputSection .calc-section-body { padding: 6px 14px 16px; }
    #inputSection .calc-section-toggle { padding: 13px 14px; }
}

/* ===== Фикс "белой вспышки" тумблеров (wasteToggle и др.) при тапе на мобильном =====
   Причина: мобильный WebKit/Chrome по умолчанию рисует полупрозрачную
   бело-серую подсветку (-webkit-tap-highlight-color) поверх всего label
   на время :active — она видна как "белым при нажатии", а не сам чекбокс.
   Плюс явно фиксируем background чекбокса на :active/:focus, чтобы никакой
   нативный вид не проступал ни на одном движке. 
 */
#inputSection .calc-toggle-row,
#inputSection .calc-toggle-row * {
    -webkit-tap-highlight-color: transparent;
}
#inputSection .calc-toggle-row input[type="checkbox"],
#inputSection .calc-toggle-row input[type="checkbox"]:active,
#inputSection .calc-toggle-row input[type="checkbox"]:focus {
    background: var(--c-border2, #cbd5e1);
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#inputSection .calc-toggle-row input[type="checkbox"]:checked,
#inputSection .calc-toggle-row input[type="checkbox"]:checked:active,
#inputSection .calc-toggle-row input[type="checkbox"]:checked:focus {
    background: var(--c-accent, #2563eb);
}
#inputSection .calc-toggle-row:focus-within {
    box-shadow: 0 0 0 3px var(--c-accent-glow, rgba(37,99,235,.18));
    border-radius: 8px;
}

/* ===== Карточка "Материал стен" в разделе База =====
   Показывает, что уже выбрано на Шаге 1 (карточки типов дома выше),
   вместо того чтобы это было видно только по спрятанному select'у. 
 */
#inputSection .calc-wallpick-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-muted, #64748b);
    margin: 14px 0 6px;
}
#inputSection .calc-wallpick {
    border: 1.5px dashed var(--c-border, #e2e8f0);
    border-radius: 12px;
    background: var(--c-surface2, #f8fafc);
    min-height: 64px;
    display: flex;
    align-items: center;
    transition: border-color .18s, background .18s;
}
#inputSection .calc-wallpick.is-filled {
    border-style: solid;
    border-color: var(--c-accent, #2563eb);
    background: var(--c-surface, #fff);
}
#inputSection .calc-wallpick-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    width: 100%;
    font-size: 13px;
    color: var(--c-muted, #64748b);
}
#inputSection .calc-wallpick-empty-ico { font-size: 18px; flex: 0 0 auto; }
#inputSection .calc-wallpick-choose,
#inputSection .calc-wallpick-change {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-accent, #2563eb);
    text-decoration: none;
    white-space: nowrap;
}
#inputSection .calc-wallpick-choose:hover,
#inputSection .calc-wallpick-change:hover { text-decoration: underline; }
#inputSection .calc-wallpick-filled {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    width: 100%;
}
#inputSection .calc-wallpick-thumb {
    width: 48px; height: 48px;
    flex: 0 0 48px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--c-accent-lt, #eef4ff);
    border: 1.5px solid var(--c-border, #e2e8f0);
}
#inputSection .calc-wallpick-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
#inputSection .calc-wallpick-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 10px;
    min-width: 0;
}
#inputSection .calc-wallpick-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text, #0f172a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
