/* ================================
   Страница калькулятора
   ================================ */

.calculator-page {
    padding: 60px 0;
    background: #f8f9fa;
}

.calculator-header {
    max-width: 600px;
    margin: 0 auto 40px auto;
    text-align: center;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.page-description {
    font-size: 15px;
    color: #666;
}

/* ================================
   Загрузочный экран
   ================================ */

.calculator-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #e0e0e0;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.calculator-loading p {
    color: #666;
    font-size: 14px;
}

/* ================================
   Экран успеха
   ================================ */

.success-message {
    text-align: center;
    padding: 60px 30px;
    background: #fff;
    border-radius: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px auto;
}

.success-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.success-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.btn {
    padding: 12px 28px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #2a2a3e;
}

/* ================================
   Вкладки
   ================================ */

.tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.tab-button {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-button:hover {
    border-color: #1a1a2e;
}

.tab-button.tab-active {
    border-color: #1a1a2e;
    background: #1a1a2e;
    color: #fff;
}

/* ================================
   Вскрытие с подсказкой
   ================================ */

.autopsy-section {
    margin-bottom: 30px;
}

.autopsy-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.autopsy-header .section-subtitle {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.help-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.help-btn:hover {
    color: #1a1a2e;
}

.help-btn svg {
    width: 18px;
    height: 18px;
}

.autopsy-help,
.info-box-help {
    background: #f8f9fa;
    border-left: 3px solid #1a1a2e;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.autopsy-help p,
.info-box-help p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.autopsy-help p:last-child,
.info-box-help p:last-child {
    margin-bottom: 0;
}

.autopsy-help strong,
.info-box-help strong {
    color: #1a1a2e;
}

.autopsy-options {
    display: flex;
    gap: 12px;
    max-width: 400px;
}

.autopsy-option {
    flex: 1;
    display: block;
    cursor: pointer;
}

.autopsy-option input[type="radio"] {
    display: none;
}

.autopsy-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
}

.autopsy-option:hover .autopsy-card {
    border-color: #1a1a2e;
}

.autopsy-option input[type="radio"]:checked + .autopsy-card {
    border-color: #1a1a2e;
    background: #1a1a2e;
    color: #fff;
}

.autopsy-name {
    font-weight: 600;
    font-size: 14px;
}

.autopsy-price {
    font-weight: 600;
    font-size: 15px;
}

.autopsy-time {
    font-size: 12px;
    opacity: 0.7;
}

/* ================================
   Инфо-блок (документы о родстве)
   ================================ */

.info-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-box-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.info-box-icon {
    width: 20px;
    height: 20px;
    color: #1a1a2e;
    flex-shrink: 0;
}

.info-box-text {
    color: #333;
    font-size: 14px;
    margin: 0;
    flex: 1;
}

.info-box-help-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.info-box-help-btn:hover {
    color: #1a1a2e;
}

.info-box-help-btn svg {
    width: 18px;
    height: 18px;
}

/* ================================
   Услуги - карточки категорий
   ================================ */

.services-section {
    margin-bottom: 30px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.category-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.category-card:hover {
    border-color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: #f0f1f3;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.category-icon svg {
    width: 24px;
    height: 24px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.category-services {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.service-option {
    display: block;
    cursor: pointer;
}

.service-option input {
    display: none;
}

.service-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.service-option:hover .service-option-content {
    background: #f8f9fa;
}

.service-option input:checked + .service-option-content {
    background: #1a1a2e;
    color: #fff;
}

.service-check {
    width: 18px;
    height: 18px;
    min-width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ccc;
    border-radius: 4px;
    color: transparent;
    transition: all 0.2s ease;
}

.service-check svg {
    width: 10px;
    height: 10px;
}

.service-option input:checked + .service-option-content .service-check {
    border-color: #fff;
    color: #fff;
}

.service-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.service-price {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.9;
    color: #1a1a2e;
}

.service-option input:checked + .service-option-content .service-price {
    opacity: 1;
    color: #fff;
}

/* ================================
   Итого
   ================================ */

.total-section {
    margin-bottom: 30px;
}

.total-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 600px;
    margin: 0 auto;
}

.total-services-list {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.total-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.total-service-name {
    color: #666;
    flex: 1;
}

.total-service-price {
    color: #1a1a2e;
    font-weight: 500;
    margin-left: 20px;
}

.total-service-check {
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.total-label {
    font-size: 15px;
    color: #666;
}

.total-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.total-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 12px 0;
}

.total-final {
    padding-top: 16px;
}

.total-final .total-label {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.total-final .total-price {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

.package-name-display {
    background: #f0f1f3;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
}

.package-name-display h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

/* ================================
   Форма заявки
   ================================ */

.form-section {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    border: 1px solid #e0e0e0;
    max-width: 600px;
    margin: 0 auto;
}

.form-row {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #1a1a2e;
}

.form-input.input-error {
    border-color: #dc3545;
}

.form-input::placeholder {
    color: #999;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.error-message {
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
    display: block;
}

.error-box {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.error-box p {
    margin: 0;
    font-size: 13px;
}

.submit-button {
    width: 100%;
    padding: 16px 32px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.submit-button:hover:not(:disabled) {
    background: #2a2a3e;
    transform: translateY(-2px);
}

.submit-button.submit-disabled,
.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ================================
   Пакеты услуг
   ================================ */

.packages-section {
    margin-bottom: 50px;
}

.packages-header {
    text-align: center;
    margin-bottom: 40px;
}

.packages-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.packages-subtitle {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.package-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.package-card:hover {
    border-color: #1a1a2e;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.package-card.popular {
    border-color: #1a1a2e;
    border-width: 3px;
}

.package-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #1a1a2e;
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.package-icon {
    width: 56px;
    height: 56px;
    background: #f0f1f3;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.package-icon svg {
    width: 28px;
    height: 28px;
}

.package-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.package-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.package-price {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.package-price-note {
    font-size: 14px;
    color: #999;
    font-weight: 400;
}

.package-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    flex: 1;
}

.package-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.package-feature-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    color: #28a745;
}

.package-button {
    width: 100%;
    padding: 14px;
    background: #fff;
    border: 2px solid #1a1a2e;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.package-button:hover {
    background: #1a1a2e;
    color: #fff;
}

.package-button.selected {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

.package-button.selected:hover {
    background: #dc3545;
    border-color: #dc3545;
}

/* ================================
   Разделитель секций
   ================================ */

.section-divider {
    margin: 60px 0;
    text-align: center;
    position: relative;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
}

.section-divider-text {
    display: inline-block;
    background: #f8f9fa;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    position: relative;
    z-index: 1;
}

.section-divider-subtitle {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

/* ================================
   Чекбокс согласия на ПДн
   ================================ */

.consent-row {
    margin-bottom: 20px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.consent-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #1a1a2e;
}

.consent-text {
    flex: 1;
}

.consent-link {
    color: #1a1a2e;
    text-decoration: none;
    border-bottom: 1px dashed #1a1a2e;
}

.consent-link:hover {
    border-bottom-style: solid;
}

/* ================================
   Адаптив
   ================================ */

@media (max-width: 1024px) {
    .packages-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
    }

    .autopsy-options {
        flex-direction: column;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .total-content,
    .form-section {
        padding: 20px;
    }
    
    .info-box {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-box-content {
        width: 100%;
    }

    .packages-title {
        font-size: 24px;
    }
    
    .package-price {
        font-size: 24px;
    }

    .section-divider {
        margin: 40px 0;
    }
    
    .section-divider-text {
        font-size: 14px;
        padding: 0 16px;
    }

    .consent-label {
        flex-direction: row;
        align-items: flex-start;
    }

    .selected-package-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .selected-package-price {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .tablets-header,
    .tablets-columns {
        grid-template-columns: 1fr;
    }
    
    .tablets-column-header {
        margin-bottom: 8px;
    }
}
