/* ============================================================
   Универсальный стиль калькуляторов web-calculator.ru
   Подключается на всех новых страницах-калькуляторах.
   Использует дизайн-токены сайта (redesign.css).
   Namespace: .wc
   ============================================================ */

.wc { width: 100%; max-width: 560px; margin: 0 auto; }

.wc__form { display: flex; flex-direction: column; gap: 14px; }

.wc__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.wc__row--col { flex-direction: column; align-items: stretch; }

.wc__label {
    flex: 0 0 auto;
    min-width: 150px;
    font-size: 15px;
    color: var(--main-color, #000);
    font-weight: 500;
}
.wc__row--col .wc__label { min-width: 0; margin-bottom: 2px; }

.wc__control { display: flex; align-items: center; gap: 8px; flex: 1 1 160px; }

.wc__input,
.wc__select {
    height: 48px;
    padding: 8px 16px;
    font-size: 16px;
    font-family: 'Unbounded', sans-serif;
    color: #000;
    background: #fff;
    border: 1px solid #DDD;
    border-radius: 16px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s ease-in-out;
    width: 100%;
    min-width: 0;
}
.wc__input:focus,
.wc__select:focus { border-color: #000; }
.wc__input--invalid { border-color: #d32f2f; background: #fff5f5; }
.wc__input--sm { width: 90px; flex: 0 0 90px; }
.wc__select { cursor: pointer; font-size: 12px; padding-right: 36px; }
.wc__select--auto { width: auto; flex: 0 0 auto; min-width: 90px; }

/* radio / checkbox группы */
.wc__radios { display: flex; flex-direction: column; gap: 8px; flex: 1 1 200px; }
.wc__radios--row { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
.wc__radio,
.wc__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
    line-height: 1.3;
}
.wc__radio input,
.wc__check input { width: 18px; height: 18px; margin: 0; cursor: pointer; flex: 0 0 auto; }

/* подсказка под полем */
.wc__hint { font-size: 12px; color: #777; flex-basis: 100%; }

/* кнопки */
.wc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}
.wc__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    box-sizing: border-box;
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.15;
    cursor: pointer;
    border-radius: 16px;
    border: 1px solid #DDD;
    min-width: 0;
    text-align: center;
    transition: all .2s ease-in-out;
}
.wc__btn--primary { background: #000; color: #fff; border-color: #000; }
.wc__btn--primary:hover { background: #333; }
.wc__btn--secondary { background: #fff; color: #000; }
.wc__btn--secondary:hover { background: #f1f1f1; }

/* ошибка */
.wc__error {
    display: none;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 14px;
    font-size: 14px;
}
.wc__error.is-visible { display: block; }

/* результат */
.wc__result {
    border: 1px solid #DDDDDD;
    border-radius: 14px;
    margin-top: 18px;
    padding: 16px;
    background: #fafafa;
}
.wc__result[hidden] { display: none; }
.wc__result-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.wc__result-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 16px;
    border-bottom: 1px dashed #e3e3e3;
}
.wc__result-row:last-child { border-bottom: none; }
.wc__result-row b { font-weight: 700; }
.wc__result-main {
    font-size: 20px;
    font-weight: 700;
    margin-top: 6px;
}
.wc__result-main span { color: #014cfe; }

/* блок пошагового решения */
.wc__steps { margin-top: 14px; font-size: 15px; line-height: 1.6; }
.wc__steps ol { padding-left: 22px; }
.wc__steps li { margin: 4px 0; }

/* инлайновая дробь в решении */
.wc-frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; margin: 0 3px; }
.wc-frac span { display: block; padding: 0 4px; }
.wc-frac span:first-child { border-bottom: 1px solid #000; }

/* таблица (матрицы, конвертеры со списком) */
.wc__table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.wc__table th, .wc__table td { border: 1px solid #e0e0e0; padding: 8px 10px; text-align: left; }
.wc__table th { background: #f5f5f5; font-weight: 600; }

/* сетка матрицы */
.wc-matrix { display: inline-grid; gap: 6px; margin: 6px 0; }
.wc-matrix input { width: 56px; height: 40px; text-align: center; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }

/* мобайл */
@media (max-width: 560px) {
    .wc__label { min-width: 120px; font-size: 14px; }
    .wc__btn { flex: 1 1 auto; min-width: 0; padding: 0 14px; }
    .wc__result-row { font-size: 15px; }
    .wc__result-main { font-size: 18px; }
}
@media (max-width: 400px) {
    .wc__row { gap: 6px; }
    .wc__label { flex-basis: 100%; min-width: 0; }
}
