/* ===== СБРОС И БАЗА ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3E77D4;
    --primary-light: #5B8FE8;
    --primary-dark: #2C5FB3;
    --primary-bg: #EEF4FD;
    --accent: #FF6B35;
    --accent-light: #FF8F5E;
    --accent-bg: #FFF5F0;
    --black: #212121;
    --gray-800: #424242;
    --gray-600: #757575;
    --gray-400: #BDBDBD;
    --gray-200: #E5E7EB;
    --gray-100: #F5F5F5;
    --gray-50: #FAFAFA;
    --white: #FFFFFF;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 40px rgba(33, 33, 33, 0.06), 0 2px 8px rgba(33, 33, 33, 0.04);
    --shadow-lg: 0 24px 60px rgba(33, 33, 33, 0.1), 0 6px 16px rgba(33, 33, 33, 0.05);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ФОН С ВОЛНАМИ ===== */
.calc-wrapper {
    font-family: 'Montserrat', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Волна 1 — большая синяя */
.calc-wrapper::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    height: 900px;
    background: radial-gradient(ellipse 70% 60% at 50% 70%, 
        rgba(62, 119, 212, 0.15) 0%, 
        rgba(62, 119, 212, 0.10) 25%, 
        rgba(62, 119, 212, 0.05) 50%,
        rgba(62, 119, 212, 0.02) 70%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 50%;
    animation: wave1 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Волна 2 — оранжевая, смещена влево */
.calc-wrapper::after {
    content: '';
    position: absolute;
    top: -20%;
    left: 20%;
    width: 800px;
    height: 700px;
    background: radial-gradient(ellipse 60% 50% at 50% 70%, 
        rgba(255, 107, 53, 0.12) 0%, 
        rgba(255, 107, 53, 0.08) 30%, 
        rgba(255, 107, 53, 0.03) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 50%;
    animation: wave2 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Волна 3 — дополнительный слой, справа */
.calc-bg-waves {
    position: absolute;
    top: -25%;
    right: 15%;
    width: 900px;
    height: 800px;
    pointer-events: none;
    z-index: 0;
}

.calc-bg-waves::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 55% 45% at 40% 65%, 
        rgba(62, 119, 212, 0.10) 0%, 
        rgba(62, 119, 212, 0.06) 20%,
        rgba(255, 107, 53, 0.04) 45%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 50%;
    animation: wave3 12s ease-in-out infinite;
}

.calc-bg-waves::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse at center, 
        rgba(62, 119, 212, 0.08) 0%, 
        rgba(62, 119, 212, 0.03) 40%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 50%;
    animation: wave4 7s ease-in-out infinite;
}

@keyframes wave1 {
    0%, 100% { 
        transform: translateX(-50%) scale(1);
        opacity: 0.9;
    }
    30% { 
        transform: translateX(-50%) scale(1.2);
        opacity: 1;
    }
    60% { 
        transform: translateX(-48%) scale(1.05);
        opacity: 0.7;
    }
    85% {
        transform: translateX(-52%) scale(1.15);
        opacity: 0.85;
    }
}

@keyframes wave2 {
    0%, 100% { 
        transform: scale(1) translate(0, 0);
        opacity: 0.8;
    }
    25% { 
        transform: scale(1.15) translate(-30px, 20px);
        opacity: 1;
    }
    50% { 
        transform: scale(0.95) translate(20px, -15px);
        opacity: 0.6;
    }
    75% { 
        transform: scale(1.1) translate(-15px, 10px);
        opacity: 0.9;
    }
}

@keyframes wave3 {
    0%, 100% { 
        transform: scale(1) translate(0, 0);
        opacity: 0.7;
    }
    20% { 
        transform: scale(1.2) translate(-40px, 30px);
        opacity: 1;
    }
    45% { 
        transform: scale(0.9) translate(25px, -20px);
        opacity: 0.5;
    }
    70% { 
        transform: scale(1.15) translate(-20px, 15px);
        opacity: 0.85;
    }
}

@keyframes wave4 {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: scale(1.3);
        opacity: 0.9;
    }
}

/* Контейнер калькулятора */
.calc-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(62, 119, 212, 0.10), 0 4px 16px rgba(33, 33, 33, 0.06);
    padding: 44px 40px;
    overflow: hidden;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.calc-container:hover {
    box-shadow: 0 30px 80px rgba(62, 119, 212, 0.15), 0 8px 24px rgba(33, 33, 33, 0.08);
    transform: translateY(-2px);
}

/* Контейнер калькулятора — поверх волн */
.calc-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(62, 119, 212, 0.08), 0 4px 16px rgba(33, 33, 33, 0.04);
    padding: 44px 40px;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.calc-container:hover {
    box-shadow: 0 30px 70px rgba(62, 119, 212, 0.12), 0 8px 20px rgba(33, 33, 33, 0.06);
}

.calc-container {
    width: 100%;
    max-width: 640px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.calc-container:hover {
    box-shadow: 0 30px 70px rgba(62, 119, 212, 0.12), 0 8px 20px rgba(33, 33, 33, 0.06);
}

/* Декоративная полоса */
.calc-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
}

/* ===== HEADER ===== */
.calc-header {
    text-align: center;
    margin-bottom: 40px;
}

.calc-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 14px;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.calc-container:hover .calc-logo {
    transform: translateY(-3px);
}

.calc-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.calc-subtitle {
    font-size: 15px;
    color: var(--gray-600);
    font-weight: 400;
    line-height: 1.6;
}

/* ===== ФОРМА ===== */
.calc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    letter-spacing: 0.2px;
}

.label-icon {
    width: 17px;
    height: 17px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ===== SELECT ===== */
.select-wrapper {
    position: relative;
    width: 100%;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 14px 44px 14px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--black);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

.form-select:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(62, 119, 212, 0.1);
    background: var(--white);
}

.form-select:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background: var(--gray-100);
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
    transition: transform var(--transition), color var(--transition);
}

.select-wrapper:focus-within .select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--primary);
}

/* Разблокировка второго селекта */
#service-group {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#service-group.is-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ===== РЕЗУЛЬТАТ ===== */
.calc-result {
    margin-bottom: 28px;
}

.result-inner {
    padding: 24px;
    border-radius: var(--radius);
    background: var(--gray-50);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.result-inner.has-result {
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--accent-bg) 100%);
    border: 1.5px solid var(--primary);
    animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% { 
        border-color: var(--primary);
        box-shadow: 0 0 0 0 rgba(62, 119, 212, 0.08), inset 0 0 0 0 rgba(62, 119, 212, 0.02);
    }
    50% { 
        border-color: var(--accent);
        box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.04), inset 0 0 0 0 rgba(255, 107, 53, 0.03);
    }
}

.result-placeholder {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-400);
    font-size: 15px;
    font-weight: 500;
}

.result-icon-svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.result-value {
    text-align: center;
    width: 100%;
}

.result-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.result-amount {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1.2px;
    transition: all 0.3s ease;
}

.result-amount.individual {
    font-size: 30px;
    background: linear-gradient(135deg, var(--accent) 0%, #E55A2B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-sub {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 6px;
    font-weight: 500;
}

/* ===== КОНТАКТНАЯ ФОРМА ===== */
.calc-contact {
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.contact-label .label-icon {
    width: 15px;
    height: 15px;
}

.contact-input {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--black);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition);
}

.contact-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.contact-input:hover {
    border-color: var(--primary-light);
}

.contact-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(62, 119, 212, 0.08);
}

.contact-input.error {
    border-color: #EF4444;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
}

/* ===== КНОПКА ===== */
.btn-order {
    width: 100%;
    padding: 16px 28px;
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-order::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(62, 119, 212, 0.3);
}

.btn-order:hover::after {
    opacity: 1;
}

.btn-order:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(62, 119, 212, 0.25);
}

.btn-order:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-order:hover .btn-icon {
    transform: translateY(-2px);
}

/* Индикатор загрузки на кнопке */
.btn-order.is-loading .btn-text {
    visibility: hidden;
}

.btn-order.is-loading .btn-icon {
    display: none;
}

.btn-spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}

.btn-order.is-loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.order-message {
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 500;
    min-height: 20px;
    transition: all 0.3s ease;
}

.order-message.success {
    color: var(--primary);
}

.order-message.error {
    color: #EF4444;
}

/* ===== DISCLAIMER ===== */
.calc-disclaimer {
    text-align: center;
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 400;
    line-height: 1.6;
    padding: 0 8px;
    margin-top: 4px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 600px) {
    .calc-container {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .calc-header h2 {
        font-size: 22px;
    }

    .calc-subtitle {
        font-size: 14px;
    }

    .form-select {
        font-size: 14px;
        padding: 12px 40px 12px 14px;
    }

    .contact-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-amount {
        font-size: 34px;
    }

    .result-amount.individual {
        font-size: 26px;
    }

    .btn-order {
        font-size: 16px;
        padding: 14px 20px;
    }
}

@media (max-width: 380px) {
    .calc-container {
        padding: 20px 14px;
    }

    .calc-header h2 {
        font-size: 19px;
    }

    .result-amount {
        font-size: 28px;
    }

    .result-amount.individual {
        font-size: 22px;
    }
}

/* Чекбоксы */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #FAFAFA;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 14px;
    transition: border-color 0.2s ease;
}

.checkbox-group:focus-within {
    border-color: #3E77D4;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #212121;
    padding: 4px 2px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #BDBDBD;
    border-radius: 6px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #3E77D4;
    border-color: #3E77D4;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    display: block;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px; /* лёгкая корректировка по вертикали */
}

.checkbox-label:hover input[type="checkbox"] {
    border-color: #3E77D4;
}

.result-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}

.service-tag {
    display: inline-block;
    background: rgba(62, 119, 212, 0.08);
    color: #3E77D4;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== ВИДЕО-ИКОНКА В КЕЙСАХ ===== */
.checkbox-text {
    flex: 1;
}

.video-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.video-icon-link:hover {
    background: rgba(62, 119, 212, 0.1);
    transform: scale(1.1);
}

.video-icon-link:active {
    transform: scale(0.95);
}

.video-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.video-icon circle {
    transition: fill 0.2s ease;
}

.video-icon-link:hover .video-icon circle {
    fill: rgba(62, 119, 212, 0.2);
}

/* Адаптив для видео-иконки */
@media (max-width: 400px) {
    .video-icon-link {
        width: 24px;
        height: 24px;
    }
    .video-icon {
        width: 20px;
        height: 20px;
    }
}

/* ===== КРЕСТИК УДАЛЕНИЯ В ТЕГЕ ===== */
.service-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(62, 119, 212, 0.08);
    color: #3E77D4;
    padding: 5px 8px 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.service-tag:hover {
    background: rgba(62, 119, 212, 0.15);
}

.tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(62, 119, 212, 0.1);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tag-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    transform: scale(1.1);
}

.tag-remove:active {
    transform: scale(0.9);
}

.tag-remove-icon {
    width: 8px;
    height: 8px;
    color: #3E77D4;
    transition: color 0.2s ease;
}

.tag-remove:hover .tag-remove-icon {
    color: #EF4444;
}