/* Общие стили */
:root {
    --bg: #eef1f5;
    --panel: #ffffff;
    --accent: #e67e22;
    --accent-hover: #d35400;
    --text: #2c3e50;
    --text-secondary: #5a6b7a;
    --border: #c2c9d1;
    --border-light: #dcdfe6;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --radius: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: auto;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: auto;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', 'Arial', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    font-size: 15px;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.calculator {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
    flex: 1;
}

.calculator {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 15px;
    flex-wrap: wrap;
}

.header h2 {
    font-weight: 600;
    font-size: 1.6em;
    margin: 0;
    color: var(--text);
}

.tabs {
    display: flex;
    gap: 0;
}

.tab {
    padding: 8px 22px;
    background: #e9ecef;
    border: 1px solid var(--border);
    border-bottom: none;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    margin-right: -1px;
}

.tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.param-row {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
}

.param-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85em;
    text-transform: uppercase;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.slider-container input[type="range"] {
    flex: 1;
    min-width: 0;
    height: 6px;
    -webkit-appearance: none;
    background: #d9dde3;
    border: 1px solid #b0b7c0;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--accent);
    cursor: pointer;
}

.num-input {
    width: 90px;
    min-width: 90px;
    flex-shrink: 0;
    padding: 8px 10px;
    background: #f9fafb;
    border: 1px solid var(--border);
    text-align: center;
    color: var(--text);
    font-size: 0.95em;
    font-weight: 500;
    box-sizing: border-box;
}

.num-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
}

select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95em;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6b7a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    box-sizing: border-box;
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

.expanded-toggle {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.expanded-params {
    display: none;
    padding-top: 20px;
    border-top: 2px solid var(--border-light);
    margin-top: 15px;
}

.expanded-params.active {
    display: block;
}

.expanded-params label {
    margin-top: 18px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.checkbox-group label {
    line-height: 1.2;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
}

.btn {
    padding: 12px 28px;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn:hover {
    background: #d35400;
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f0f2f5;
}

.results {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.card {
    flex: 1;
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
}

.card h3 {
    margin: 0 0 15px;
    font-size: 1.3em;
    color: var(--text);
    font-weight: 600;
}

.price-range {
    font-size: 1.9em;
    font-weight: 700;
    color: var(--accent);
    margin: 15px 0;
    line-height: 1.2;
}

.fuel-level {
    color: #4a5560;
    margin: 10px 0 5px;
    font-size: 0.95em;
}

.savings {
    color: #27ae60;
    font-weight: 600;
    font-size: 0.9em;
    margin-top: 12px;
    background: #eafaf1;
    padding: 6px;
    border: 1px solid #b7dfc5;
}

.actions {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 480px;
    box-sizing: border-box;
}

.request-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px;
    margin-bottom: 20px;
}

.request-form-grid .full-width {
    grid-column: 1 / -1;
}

.request-form-grid input,
.request-form-grid textarea {
    width: 100%;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95em;
    font-family: inherit;
    box-sizing: border-box;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.modal-buttons .btn {
    flex: 1;
    padding: 12px 0;
    font-size: 0.9em;
}

.error-message {
    background: #fff5f5;
    color: #cc0000;
    padding: 15px;
    border: 1px solid #ff9999;
    margin-top: 20px;
}

/* ===== АДАПТИВНОСТЬ ДЛЯ ВСЕХ УСТРОЙСТВ ===== */

/* Планшеты горизонтальные и небольшие ноутбуки */
@media (max-width: 1024px) {
    .calculator {
        padding: 20px 15px;
    }
    .header h2 {
        font-size: 1.4em;
    }
    .price-range {
        font-size: 1.5em;
    }
    .results {
        gap: 15px;
    }
}

/* Планшеты вертикальные */
@media (max-width: 900px) {
    body {
    display: block;
    height: auto;
}
.calculator {
    flex: none;
}
    .calculator {
        padding: 15px 12px;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header h2 {
        font-size: 1.3em;
        margin-bottom: 8px;
    }
    .tabs {
        width: 100%;
    }
    .tab {
        flex: 1;
        text-align: center;
    }
    .results {
        gap: 10px;
    }
    .card {
        padding: 15px 10px;
    }
    .price-range {
        font-size: 1.3em;
    }
}

/* Телефоны горизонтальные и большие телефоны */
@media (max-width: 768px) {
    body {
    display: block;
    height: auto;
}
.calculator {
    flex: none;
}
    html, body {
        height: auto;
        min-height: auto;
    }
    .calculator {
        padding: 10px 6px;
    }
    .header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    .header h2 {
        font-size: 1.1em;
    }
    .tab {
        padding: 6px 8px;
        font-size: 0.75em;
    }
    .param-row {
        padding: 10px 6px;
        margin-bottom: 6px;
    }
    .param-row label {
        font-size: 0.7em;
    }
    .slider-container {
        gap: 6px;
    }
    .num-input {
        width: 55px;
        min-width: 55px;
        padding: 6px 2px;
        font-size: 0.75em;
    }
    select {
        max-width: 100%;
        font-size: 0.8em;
        padding: 6px 20px 6px 6px;
    }
    .btn {
        padding: 8px 10px;
        font-size: 0.78em;
        width: 100%;
    }
    .results {
        flex-direction: column;
        gap: 6px;
        margin-top: 10px;
    }
    .card {
        padding: 10px 6px;
    }
    .card h3 {
        font-size: 0.95em;
        margin-bottom: 6px;
    }
    .price-range {
        font-size: 1.1em;
        margin: 6px 0;
    }
    .fuel-level {
        font-size: 0.75em;
    }
    .savings {
        font-size: 0.72em;
    }
    .actions {
        flex-direction: column;
        gap: 6px;
        margin-top: 10px;
    }
    .actions .btn {
        width: 100%;
    }
    .modal-content {
        width: 95%;
        padding: 12px 8px;
    }
    .request-form-grid {
        grid-template-columns: 1fr;
    }
    .modal-buttons {
        flex-direction: row;
    }
    .modal-buttons .btn {
        font-size: 0.75em;
        padding: 8px 0;
    }
    .checkbox-group {
        margin: 5px 0;
        gap: 5px;
    }
    .checkbox-group label {
        font-size: 0.75em;
    }
    .expanded-params {
        padding-top: 10px;
        margin-top: 8px;
    }
    .expanded-params label {
        margin-top: 8px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    body {
    display: block;
    height: auto;
}
.calculator {
    flex: none;
}
    .calculator {
        padding: 6px 4px;
    }
    .header h2 {
        font-size: 1em;
    }
    .tab {
        padding: 5px 4px;
        font-size: 0.7em;
    }
    .param-row {
        padding: 8px 4px;
        margin-bottom: 4px;
    }
    .num-input {
        width: 48px;
        min-width: 48px;
        font-size: 0.7em;
    }
    .price-range {
        font-size: 1em;
    }
    .btn {
        font-size: 0.72em;
        padding: 7px 8px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 360px) {
    body {
    display: block;
    height: auto;
}
.calculator {
    flex: none;
}
    .header h2 {
        font-size: 0.9em;
    }
    .tab {
        font-size: 0.65em;
    }
    .num-input {
        width: 42px;
        min-width: 42px;
        font-size: 0.65em;
    }
    select {
        font-size: 0.7em;
    }
    .price-range {
        font-size: 0.9em;
    }
}