/* ===== RESET & VARIABLES ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent: #f59e0b;
    --dark: #1e293b;
    --gray: #64748b;
    --light-gray: #f1f5f9;
    --white: #ffffff;
    --success: #10b981;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark);
    background: #f8fafc;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4 {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== HEADER & FOOTER ===== */
.calc-header {
    background: white;
    padding: 12px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.calc-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-svg {
    width: 130px;
    height: 46px;
}

.header-phone a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--dark);
}

.calc-footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.5);
    padding: 24px 0;
    margin-top: auto;
    text-align: center;
    font-size: 13px;
}

/* ===== CALCULATOR WRAPPER ===== */
.calc-main {
    padding: 40px 0 60px;
    flex: 1;
}

.calc-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 640px) {
    .calc-wrapper {
        padding: 24px 16px;
    }
}

.calc-progress {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    transition: width 0.4s ease;
}

.calc-step-counter {
    text-align: center;
    font-size: 13px;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 28px;
    font-family: 'Montserrat', sans-serif;
}

/* ===== STEPS ===== */
.calc-steps {
    position: relative;
    min-height: 400px;
}

.calc-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.calc-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.step-desc {
    font-size: 15px;
    color: var(--gray);
    text-align: center;
    margin-bottom: 28px;
}

/* ===== OPTION CARDS ===== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.option-card {
    cursor: pointer;
    position: relative;
}

.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    text-align: center;
    height: 100%;
}

.card-content img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.card-label {
    padding: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--dark);
    line-height: 1.4;
}

.card-label small {
    display: block;
    font-size: 11px;
    color: var(--gray);
    font-weight: 500;
    margin-top: 4px;
}

.option-card:hover .card-content {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.option-card input:checked+.card-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.1));
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.option-card input:checked+.card-content .card-label {
    color: var(--primary);
}

/* ===== AREA CONTROL ===== */
.area-control {
    max-width: 500px;
    margin: 0 auto 30px;
    text-align: center;
}

.area-display {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 16px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 10px;
    outline: none;
    appearance: none;
    margin-bottom: 20px;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.area-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.area-input-wrap label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 600;
}

.area-input-wrap input {
    width: 80px;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.area-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== CHECKBOXES ===== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.check-card {
    cursor: pointer;
    position: relative;
}

.check-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-content {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.3s;
}

.check-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.check-info {
    flex: 1;
}

.check-info strong {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 2px;
}

.check-info span {
    font-size: 13px;
    color: var(--gray);
}

.qty-input {
    width: 70px;
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

.qty-input:focus {
    outline: none;
    border-color: var(--primary);
}

.check-card:hover .check-content {
    border-color: var(--primary-light);
    background: white;
}

.check-card input:checked+.check-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.1));
}

/* ===== BUTTONS ===== */
.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.btn-back,
.btn-next,
.btn-submit,
.btn-restart {
    padding: 14px 28px;
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-back {
    background: var(--light-gray);
    color: var(--gray);
}

.btn-back:hover {
    background: #e2e8f0;
    color: var(--dark);
}

.btn-next {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-next:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ИСПРАВЛЕННАЯ КНОПКА ОТПРАВКИ */
.btn-submit {
    width: 100%;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 56px;
    /* Жёсткие цвета, чтобы не зависеть от переменных */
    background: linear-gradient(135deg, #f59e0b, #d97706) !important; 
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; /* Тень для контраста */
    font-size: 16px !important;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.3s;
    border: none !important;
    box-shadow: 0 4px 15px rgba(245,158,11,0.4);
    margin-top: 16px;
    text-align: center !important;
    line-height: 1.4 !important;
}
.btn-submit:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(245,158,11,0.5); 
    filter: brightness(1.1);
}
.btn-submit:disabled { 
    opacity: 0.7; 
    cursor: not-allowed; 
    transform: none; 
    filter: grayscale(0.5);
}

.btn-restart {
    background: var(--light-gray);
    color: var(--dark);
    margin-top: 24px;
}

.btn-restart:hover {
    background: #e2e8f0;
}

/* ===== LEAD FORM ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    font-family: 'Montserrat', sans-serif;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 15px;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-note {
    text-align: center;
    font-size: 12px;
    color: var(--gray);
    margin-top: 12px;
}

.form-note a {
    color: var(--primary);
    text-decoration: underline;
}

.channel-select {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.channel-opt {
    cursor: pointer;
    flex: 1;
    min-width: 100px;
}

.channel-opt input {
    display: none;
}

.ch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    transition: all 0.3s;
    background: white;
}

.channel-opt input:checked+.ch-btn {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.ch-btn.telegram {
    border-color: #0088cc;
    color: #0088cc;
}

.channel-opt input:checked+.ch-btn.telegram {
    background: #0088cc;
    border-color: #0088cc;
    color: white;
}

.ch-btn.viber {
    border-color: #7360f2;
    color: #7360f2;
}

.channel-opt input:checked+.ch-btn.viber {
    background: #7360f2;
    border-color: #7360f2;
    color: white;
}

.ch-btn.call {
    border-color: var(--success);
    color: var(--success);
}

.channel-opt input:checked+.ch-btn.call {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* ===== PREVIEW & SUCCESS ===== */
.calc-preview {
    background: var(--light-gray);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed #cbd5e1;
}

.preview-row:last-of-type {
    border-bottom: none;
}

.preview-total {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--primary);
}

.preview-note {
    font-size: 12px;
    color: var(--gray);
    margin-top: 8px;
    font-style: italic;
}

.calc-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.success-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px 0;
}

.success-badges span {
    background: #ecfdf5;
    color: var(--success);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .step-title {
        font-size: 22px;
    }

    .area-display {
        font-size: 36px;
    }

    .channel-select {
        flex-direction: column;
    }

    .check-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .qty-input {
        width: 100%;
    }
}

.step-right-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
@media (max-width: 640px) { 
    .step-right-actions { width: 100%; align-items: stretch; } 
}

/* Кнопка "Не знаю, нужна консультация" */
.btn-consult {
    background: transparent;
    border: 2px dashed #cbd5e1;
    color: var(--gray);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1.4;
}
.btn-consult:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37,99,235,0.05);
}
/* ===== DISCOUNT HIGHLIGHT ===== */
.discount-highlight {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 12px;
    animation: pulseDiscount 2.5s infinite;
}
.discount-icon { font-size: 28px; flex-shrink: 0; }
.discount-text { display: flex; flex-direction: column; line-height: 1.4; }
.discount-text strong { color: #b45309; font-size: 15px; font-family: 'Montserrat', sans-serif; }
.discount-text span { font-size: 13px; color: #92400e; }

@keyframes pulseDiscount { 
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(245,158,11,0); } 
    50% { transform: scale(1.01); box-shadow: 0 4px 12px rgba(245,158,11,0.35); } 
}

@media (max-width: 480px) {
    .discount-highlight { flex-direction: column; text-align: center; gap: 8px; }
}