* {
    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: 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: 15px;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    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: 12px;
    color: #e94560;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 3px;
    font-size: 0.8rem;
    color: #555;
    font-weight: 500;
}

input[type="number"],
input[type="text"],
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,
input[type="text"]: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;
}

select option {
    background: #fff;
    color: #333;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #888;
}

.card-image {
    text-align: center;
    margin-bottom: 14px;
}

.card-image img {
    max-width: 100%;
    max-height: 140px;
    border-radius: 10px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 8px;
    border: 1px solid #e8e8e8;
}

/* Button */
.btn-calc {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e94560, #c73e54);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 10px 0 20px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

.btn-calc:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(233, 69, 96, 0.4);
}

/* Results */
.results {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #e94560;
    margin-top: 15px;
}

.results h2 {
    text-align: center;
    margin-bottom: 16px;
    color: #333;
    font-size: 1.3rem;
}

.results-section {
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.result-item {
    background: #fff;
    padding: 12px;
    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.7rem;
    color: #666;
    margin-bottom: 3px;
}

.result-item strong {
    display: block;
    font-size: 0.95rem;
    color: #333;
}

.result-item.highlight strong {
    color: #e94560;
    font-size: 1.1rem;
}

/* Info list */
.info-list {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.compact {
    padding: 8px 14px;
}

.info-row span {
    color: #555;
    font-size: 0.85rem;
}

.info-row strong {
    color: #333;
    font-size: 0.9rem;
    text-align: right;
}

/* Total box */
.total-box {
    margin-top: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border: 2px solid #e94560;
    border-radius: 12px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-row span {
    font-size: 1rem;
    color: #555;
    font-weight: 500;
}

.total-row strong {
    font-size: 1.4rem;
    color: #e94560;
}

/* Info Tabs */
.info-tabs {
    margin-top: 30px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    background: #fafafa;
}

.tab-button {
    padding: 12px 20px;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.tab-button:hover {
    color: #e94560;
    background: rgba(233, 69, 96, 0.04);
}

.tab-button.active {
    color: #e94560;
    border-bottom-color: #e94560;
    background: #fff;
}

.tab-panel {
    padding: 20px;
}

.tab-panel.hidden {
    display: none;
}

.tab-panel h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    font-size: 1.05rem;
}

.tab-panel p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.tab-panel ol,
.tab-panel ul {
    padding-left: 20px;
    color: #555;
    line-height: 1.7;
    font-size: 0.9rem;
}

.tab-panel li {
    margin-bottom: 8px;
}

.tab-panel code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #c73e54;
}

.tab-panel hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 16px 0;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Footer */
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;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        padding: 14px;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .total-row strong {
        font-size: 1.1rem;
    }
}
