* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: #333;
    padding: 15px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 15px;
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(90deg, #e94560, #c73e54);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

header p {
    color: #666;
    font-size: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: #e94560;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 0;
}

.form-row + .form-row,
.form-group + .form-group {
    margin-top: 10px;
}

/* Подзаголовок секции внутри карточки */
.card-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e94560;
    margin: 14px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0e0e0;
}

/* Разделитель секций */
.section-divider {
    border: 0;
    border-top: 1px solid #e0e0e0;
    margin: 14px 0;
}

/* Подсказка-ссылка */
.link-hint {
    margin-top: 8px;
    font-size: 0.85rem;
}
.link-hint a {
    color: #e94560;
    text-decoration: underline;
}

/* Чекбокс в форме */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e94560;
    flex-shrink: 0;
}
.form-checkbox label {
    margin: 0;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Группа кнопок */
.btn-group {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}
.btn-group .btn-primary {
    flex: 1;
}
.btn-group .btn-primary.btn-secondary {
    flex: 0.5;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.form-row .form-group {
    display: flex;
    flex-direction: column;
}

/* Label внутри ряда — фиксированная высота под 2 строки для ровного выравнивания */
.form-row label {
    min-height: 2em;
    line-height: 1.2;
}

.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 3px;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

input[type="number"],
select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fafafa;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #e94560;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

input:disabled {
    opacity: 0.5;
    background: #e8e8e8;
    cursor: not-allowed;
}

input[readonly] {
    background: #e8e8e8;
    cursor: default;
}

select option {
    background: #fff;
    color: #333;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-group.compact {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.checkbox-label:hover,
.radio-label:hover {
    background: rgba(233, 69, 96, 0.05);
}

.checkbox-label input,
.radio-label input {
    width: 16px;
    height: 16px;
    accent-color: #e94560;
}

.small-input {
    width: 70px !important;
    padding: 6px 8px !important;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-group.compact {
    gap: 10px;
}

.radio-group.compact .radio-label {
    font-size: 0.85rem;
}

.info-card {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border: 1px solid #ffe0e0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.compact {
    padding: 6px 0;
}

.info-row span {
    color: #666;
    font-size: 0.85rem;
}

.info-row strong {
    color: #e94560;
    font-size: 0.95rem;
}

.results {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #e94560;
    margin-top: 16px;
}

.results h2 {
    text-align: center;
    margin-bottom: 16px;
    color: #333;
    font-size: 1.3rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.result-item {
    background: #fff;
    padding: 14px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: #fafafa;
    transform: scale(1.02);
}

.result-item.highlight {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-color: #e94560;
    border-width: 2px;
}

.result-item span {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

.result-item strong {
    display: block;
    font-size: 1.1rem;
    color: #333;
}

.result-item.highlight strong {
    color: #e94560;
    font-size: 1.3rem;
}

footer {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    color: #888;
    font-size: 0.85rem;
}

footer a {
    color: #e94560;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Preview */
.preview-hint {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.preview-box {
    width: 100%;
    max-width: 280px;
    height: 140px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tank-preview {
    position: relative;
    transition: all 0.3s ease;
}

.tank-preview.top {
    width: 100px;
    height: 60px;
    border: 3px solid #e94560;
    border-top: none;
    background: rgba(233, 69, 96, 0.05);
    position: relative;
}

.tank-preview.top::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: -3px;
    right: -3px;
    height: 3px;
    background: #10b981;
}

.tank-preview.side {
    width: 100px;
    height: 60px;
    border: 3px solid #e94560;
    border-bottom: none;
    background: rgba(233, 69, 96, 0.05);
    position: relative;
}

.tank-preview.side::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #10b981;
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #e94560, #c73e54);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Results content (detailed) */
.results-content {
    font-size: 0.92rem;
    line-height: 1.7;
}

#detailsCard .results-content {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 8px;
}

.results-content .placeholder {
    color: #888;
    text-align: center;
    padding: 30px 0;
}

.results-content h3 {
    color: #e94560;
    font-size: 0.95rem;
    margin-top: 14px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.results-content h3:first-child {
    margin-top: 0;
}

.results-content p {
    color: #333;
    padding: 2px 0;
    margin: 0;
}

.results-content .dim {
    color: #888;
    font-size: 0.85rem;
}

.full-width {
    grid-column: 1 / -1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-content.animate {
    animation: fadeIn 0.3s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-row {
        flex-direction: row;
        gap: 8px;
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .radio-group.compact {
        gap: 10px;
    }

    .checkbox-group.compact {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Scrollbar стилизация */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
