/**
 * БезШтрафа.рф — Стили для инструментов (калькуляторы, словарь, чек-лист)
 * Цвета: primary #e63946, success #2a9d8f, warning #e9c46a
 */

/* =============================================
   Общие стили инструментов
   ============================================= */
.tool-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, #fdf2f3 0%, #fff 100%);
}

.tool-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.tool-hero__subtitle {
    font-size: 1.125rem;
    color: #555;
    max-width: 640px;
}

/* =============================================
   Калькулятор
   ============================================= */
.calculator {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin: 2rem 0;
}

.calculator__title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
}

.calculator__group {
    margin-bottom: 1.5rem;
}

.calculator__label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.625rem;
}

/* Radio-группа */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.radio-group__item {
    position: relative;
}

.radio-group__item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-group__label {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #444;
    transition: all 0.2s ease;
    background: #fff;
    user-select: none;
}

.radio-group__label:hover {
    border-color: #e63946;
    color: #e63946;
}

.radio-group__item input[type="radio"]:checked + .radio-group__label {
    border-color: #e63946;
    background: #fdf2f3;
    color: #e63946;
    font-weight: 600;
}

.radio-group__item input[type="radio"]:focus-visible + .radio-group__label {
    outline: 2px solid #e63946;
    outline-offset: 2px;
}

/* Checkbox-стиль переключатель */
.toggle-group {
    display: flex;
    gap: 0.625rem;
}

.toggle-group__item {
    position: relative;
}

.toggle-group__item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-group__label {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #444;
    transition: all 0.2s ease;
    user-select: none;
}

.toggle-group__label:hover {
    border-color: #e63946;
}

.toggle-group__item input[type="radio"]:checked + .toggle-group__label--yes {
    border-color: #e63946;
    background: #fdf2f3;
    color: #e63946;
}

.toggle-group__item input[type="radio"]:checked + .toggle-group__label--no {
    border-color: #2a9d8f;
    background: #eaf7f5;
    color: #2a9d8f;
}

/* Range / Число */
.calculator__range-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calculator__range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
}

.calculator__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e63946;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(230, 57, 70, 0.3);
}

.calculator__range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e63946;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(230, 57, 70, 0.3);
}

.calculator__range-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
}

/* =============================================
   Результат калькулятора
   ============================================= */
.calculator__result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fdf2f3 0%, #fff5f5 100%);
    border-radius: 12px;
    border: 1px solid rgba(230, 57, 70, 0.15);
}

.calculator__result-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row__label {
    font-size: 0.9375rem;
    color: #555;
    flex: 1;
    padding-right: 1rem;
}

.result-row__value {
    font-size: 1rem;
    font-weight: 700;
    color: #e63946;
    white-space: nowrap;
}

.result-row--total {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e63946;
    border-bottom: none;
}

.result-row--total .result-row__label {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
}

.result-row--total .result-row__value {
    font-size: 1.5rem;
    color: #e63946;
}

/* =============================================
   Таблицы
   ============================================= */
.tool-table-wrap {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.tool-table thead {
    background: #1a1a2e;
    color: #fff;
}

.tool-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.tool-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
    color: #333;
}

.tool-table tbody tr:hover {
    background: #fdf2f3;
}

.tool-table tbody tr:last-child td {
    border-bottom: none;
}

/* =============================================
   FAQ секция (wrapper only — component styles in main.css)
   ============================================= */
.faq-section {
    padding: 3rem 0;
}

.faq-section__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
}

/* =============================================
   SEO-текст
   ============================================= */
.seo-text {
    padding: 2.5rem 0;
}

.seo-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.seo-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.seo-text p {
    font-size: 1rem;
    color: #444;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.seo-text ul,
.seo-text ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.seo-text li {
    font-size: 1rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 0.375rem;
}

/* =============================================
   CTA-блок
   ============================================= */
.tool-cta {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
    border-radius: 16px;
    margin: 2.5rem 0;
}

.tool-cta__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.tool-cta__text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.tool-cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tool-cta .btn--white {
    background: #fff;
    color: #e63946;
}

.tool-cta .btn--white:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =============================================
   Словарь
   ============================================= */
.slovar-search {
    position: relative;
    max-width: 560px;
    margin: 1.5rem 0 2rem;
}

.slovar-search__input {
    width: 100%;
    padding: 0.875rem 1.25rem 0.875rem 3rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}

.slovar-search__input:focus {
    border-color: #e63946;
}

.slovar-search__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.slovar-search__results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.slovar-search__results.active {
    display: block;
}

.slovar-search__result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f5f5f5;
}

.slovar-search__result-item:last-child {
    border-bottom: none;
}

.slovar-search__result-item:hover {
    background: #fdf2f3;
}

.slovar-search__result-en {
    font-weight: 600;
    color: #1a1a2e;
}

.slovar-search__result-ru {
    color: #2a9d8f;
    font-weight: 500;
}

.slovar-search__result-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: #eaf7f5;
    color: #2a9d8f;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Алфавитный указатель */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 12px;
}

.alphabet-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a2e;
    text-decoration: none;
    transition: all 0.2s ease;
}

.alphabet-nav__link:hover,
.alphabet-nav__link.active {
    background: #e63946;
    color: #fff;
}

.alphabet-nav__link--disabled {
    color: #ccc;
    pointer-events: none;
}

/* Словарная группа */
.slovar-group {
    margin-bottom: 2rem;
}

.slovar-group__letter {
    font-size: 2rem;
    font-weight: 800;
    color: #e63946;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #e63946;
    margin-bottom: 1rem;
    display: inline-block;
}

.slovar-table {
    width: 100%;
    border-collapse: collapse;
}

.slovar-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9375rem;
}

.slovar-table tr:hover {
    background: #fdf2f3;
}

.slovar-table .slovar-en {
    font-weight: 600;
    color: #1a1a2e;
    width: 30%;
}

.slovar-table .slovar-ru {
    color: #333;
}

.slovar-table .slovar-note {
    color: #2a9d8f;
    font-size: 0.8125rem;
    font-weight: 500;
    width: 15%;
    text-align: right;
}

/* =============================================
   Чек-лист (опросник)
   ============================================= */
.checklist {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin: 2rem 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Прогресс-бар */
.checklist__progress {
    margin-bottom: 2rem;
}

.checklist__progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.checklist__progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
}

.checklist__progress-bar {
    width: 100%;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.checklist__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e63946, #c1121f);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Вопрос */
.checklist__question {
    display: none;
    animation: fadeInUp 0.35s ease;
}

.checklist__question.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checklist__question-number {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #e63946;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.checklist__question-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

/* Кнопки ответов */
.checklist__answers {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.checklist__answer-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.875rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.checklist__answer-btn:hover {
    border-color: #e63946;
    color: #e63946;
}

.checklist__answer-btn.selected {
    border-color: #e63946;
    background: #fdf2f3;
    color: #e63946;
}

.checklist__answer-btn--yes:hover,
.checklist__answer-btn--yes.selected {
    border-color: #e63946;
    background: #fdf2f3;
    color: #e63946;
}

.checklist__answer-btn--no:hover,
.checklist__answer-btn--no.selected {
    border-color: #2a9d8f;
    background: #eaf7f5;
    color: #2a9d8f;
}

/* Навигация */
.checklist__nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.checklist__nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.checklist__nav-btn--back {
    background: #f5f5f5;
    color: #555;
}

.checklist__nav-btn--back:hover {
    background: #e8e8e8;
}

.checklist__nav-btn--back:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.checklist__nav-btn--next {
    background: #e63946;
    color: #fff;
}

.checklist__nav-btn--next:hover {
    background: #c1121f;
}

.checklist__nav-btn--next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Результат чек-листа */
.checklist__result {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.checklist__result.active {
    display: block;
}

.checklist__result-header {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.checklist__result-header--high {
    background: linear-gradient(135deg, #fdf2f3, #ffe0e3);
}

.checklist__result-header--medium {
    background: linear-gradient(135deg, #fef9ec, #fff3d0);
}

.checklist__result-header--low {
    background: linear-gradient(135deg, #eaf7f5, #d4f0ec);
}

.checklist__result-header--safe {
    background: linear-gradient(135deg, #eaf7f5, #d4f0ec);
}

.checklist__result-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.checklist__result-level {
    font-size: 1.5rem;
    font-weight: 800;
}

.checklist__result-level--high {
    color: #e63946;
}

.checklist__result-level--medium {
    color: #e9a100;
}

.checklist__result-level--low {
    color: #2a9d8f;
}

.checklist__result-level--safe {
    color: #2a9d8f;
}

.checklist__result-score {
    font-size: 0.9375rem;
    color: #555;
    margin-top: 0.25rem;
}

/* План действий */
.action-plan {
    margin: 1.5rem 0;
}

.action-plan__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.action-plan__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.action-plan__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9375rem;
    color: #333;
    line-height: 1.5;
}

.action-plan__item:last-child {
    border-bottom: none;
}

.action-plan__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.125rem;
}

.action-plan__icon--urgent {
    background: #e63946;
}

.action-plan__icon--warning {
    background: #e9c46a;
}

.action-plan__icon--ok {
    background: #2a9d8f;
}

/* Штраф в результате */
.checklist__result-fine {
    text-align: center;
    padding: 1.25rem;
    background: #fdf2f3;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.checklist__result-fine-label {
    font-size: 0.875rem;
    color: #555;
    margin-bottom: 0.25rem;
}

.checklist__result-fine-value {
    font-size: 2rem;
    font-weight: 800;
    color: #e63946;
}

/* CTA кнопки результата */
.checklist__result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.checklist__result-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.checklist__result-actions .btn--primary {
    background: #e63946;
    color: #fff;
}

.checklist__result-actions .btn--primary:hover {
    background: #c1121f;
}

.checklist__result-actions .btn--outline {
    background: #fff;
    color: #e63946;
    border: 2px solid #e63946;
}

.checklist__result-actions .btn--outline:hover {
    background: #fdf2f3;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .tool-hero h1 {
        font-size: 1.5rem;
    }

    .calculator {
        padding: 1.25rem;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-group__label {
        width: 100%;
        justify-content: center;
    }

    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .result-row__value {
        align-self: flex-end;
    }

    .result-row--total {
        flex-direction: row;
        align-items: center;
    }

    .tool-table {
        font-size: 0.8125rem;
    }

    .tool-table th,
    .tool-table td {
        padding: 0.625rem;
    }

    .slovar-table .slovar-en {
        width: 40%;
    }

    .slovar-table .slovar-note {
        display: none;
    }

    .alphabet-nav__link {
        width: 30px;
        height: 30px;
        font-size: 0.8125rem;
    }

    .checklist {
        padding: 1.25rem;
    }

    .checklist__question-text {
        font-size: 1.125rem;
    }

    .checklist__answers {
        flex-direction: column;
    }

    .checklist__answer-btn {
        min-width: auto;
    }

    .tool-cta {
        padding: 2rem 1.25rem;
    }

    .tool-cta__title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .tool-hero {
        padding: 2rem 0 1.5rem;
    }

    .tool-hero h1 {
        font-size: 1.25rem;
    }

    .calculator__result {
        padding: 1rem;
    }

    .result-row--total .result-row__value {
        font-size: 1.25rem;
    }
}
