/* ОСНОВНЫЕ СТИЛИ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    min-height: 100vh;
    padding: 15px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* ШАПКА */
header {
    background: linear-gradient(to right, #2c3e50, #3498db);
    color: white;
    padding: 25px 30px;
    text-align: center;
    border-bottom: 4px solid #f39c12;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ПАНЕЛЬ ЯЗЫКОВ */
.language-bar {
    background: #f8f9fa;
    padding: 12px 30px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.lang-btn {
    padding: 6px 12px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: #e3f2fd;
}

.lang-btn.active {
    background: #3498db;
    color: white;
}

/* ВКЛАДКИ */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 3px solid #3498db;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 18px 10px;
    background: transparent;
    border: none;
    border-right: 1px solid #dee2e6;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.tab-btn.active {
    background: #3498db;
    color: white;
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #f39c12;
}

/* СОДЕРЖИМОЕ ВКЛАДОК */
.tab-content {
    display: none;
    padding: 25px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
}

/* СЕКЦИИ ФОРМ */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: #3498db;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

/* ФОРМЫ */
.form-group {
    margin-bottom: 20px;
    max-width: 500px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* РАДИО-КНОПКИ */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.radio-label:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    border-radius: 50%;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #3498db;
    background: #3498db;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.radio-text strong {
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 4px;
}

.radio-hint {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ЧЕКБОКСЫ */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 500;
    color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #3498db;
    border-color: #3498db;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label:hover .checkbox-custom {
    border-color: #3498db;
}

.checkbox-text {
    color: #2c3e50;
}

/* ПРЕДВАРИТЕЛЬНЫЙ РАСЧЁТ */
.preliminary-result {
    margin-top: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #f39c12;
}

.preliminary-result h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.result-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.result-item {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.result-item span {
    color: #6c757d;
    font-size: 0.95rem;
}

.result-item strong {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-item.highlight {
    background: #fff3cd;
    border-color: #ffc107;
    border-width: 2px;
}

.result-item.highlight strong {
    color: #e74c3c;
    font-size: 1.2rem;
}

/* ИНФО-БОКС */
.info-box {
    background: #e8f4fc;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    max-width: 600px;
}

.info-box h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.info-box p {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* ИКОНКА ПОДСКАЗКИ */
.help-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 11px;
    margin-left: 5px;
    cursor: help;
    vertical-align: middle;
    font-weight: bold;
}

/* ИТОГОВАЯ СМЕТА */
.summary-panel {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 25px;
    margin-top: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.summary-panel h2 {
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    padding-bottom: 12px;
    font-size: 1.4rem;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.total-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.total-item {
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 4px solid #f39c12;
}

.total-item span:first-child {
    color: #e0e0e0;
    font-weight: 500;
}

.total-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #f39c12;
    text-align: right;
}

.total-item.highlight {
    background: rgba(243, 156, 18, 0.2);
    border-left-color: #f39c12;
}

.total-item.highlight .total-value {
    color: #fff;
    font-size: 1.6rem;
}

.summary-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.action-btn {
    padding: 10px 20px;
    background: #f39c12;
    color: #2c3e50;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.action-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.action-btn.danger {
    background: #e74c3c;
    color: white;
}

.action-btn.danger:hover {
    background: #c0392b;
}

/* КНОПКИ НАВИГАЦИИ */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.nav-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    min-width: 140px;
    justify-content: center;
}

.nav-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.prev-btn {
    background: #7f8c8d;
}

.prev-btn:hover {
    background: #6c7b7d;
}

.next-btn {
    background: #27ae60;
}

.next-btn:hover {
    background: #219653;
}

/* Для первой вкладки - только кнопка "Далее" справа */
#tab1 .nav-buttons {
    justify-content: flex-end;
}

/* Для последней вкладки - только кнопка "Назад" слева */
#tab4 .nav-buttons {
    justify-content: space-between;
}

/* ПОДВАЛ */
footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.85rem;
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
}

.copyright {
    margin-top: 5px;
    opacity: 0.7;
    font-size: 0.8rem;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .tab-btn {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding: 15px 10px;
    }
    
    .tab-content {
        padding: 20px 15px;
    }
    
    .result-box {
        grid-template-columns: 1fr;
    }
    
    .total-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-actions {
        flex-direction: column;
    }
    
    .action-btn, .nav-btn {
        width: 100%;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    #tab1 .nav-buttons,
    #tab4 .nav-buttons {
        justify-content: stretch;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .tab-content h2 {
        font-size: 1.3rem;
    }
    
    .form-group {
        max-width: 100%;
    }
    
    .language-bar {
        justify-content: center;
    }
    
    .radio-label {
        padding: 10px;
    }
    
    .total-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .total-value {
        align-self: flex-end;
    }
}