
:root {
    
    --primary: #4e91fd;
    --primary-dark: #9f7af6;
    /* --primary: #3B82F6;
    --primary-dark: #8B5CF6; */
    --secondary: #7ba3d1;
    --bg: #f5f8fc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(91, 141, 196, 0.08);
    --glow: rgba(91, 141, 196, 0.25);
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 45px;
    box-shadow: 
        0 20px 60px rgba(91, 141, 196, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    position: relative;
    overflow: visible;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 24px;
}

.card:hover::before {
    opacity: 1;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    /* background: linear-gradient(90deg, #4a72b5, #5b8dc4, #7ba3d1); */
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    z-index: 0;
    border-radius: 24px 24px 0 0;
}

.card > * {
    position: relative;
    z-index: 1;
}

.section-title {
    /* font-family: 'Sora', sans-serif; */
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 30px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
    box-shadow: 0 0 20px var(--glow);
}

.option-group {
    margin-bottom: 35px;
    animation: slideIn 0.6s ease-out backwards;
}

.option-group:nth-child(1) { animation-delay: 0.1s; }
.option-group:nth-child(2) { animation-delay: 0.2s; }
.option-group:nth-child(3) { animation-delay: 0.3s; }
.option-group:nth-child(4) { animation-delay: 0.4s; }
.option-group:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.option-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-option {
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-option label {
    display: block;
    padding: 14px 24px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    user-select: none;
    position: relative;
    text-align: center;
}

.radio-option input[type="radio"]:checked + label {
    /* background: linear-gradient(135deg, #5b8dc4, #4a72b5); */
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: #5b8dc4;
    color: white;
    transform: translateY(-2px);
    box-shadow: 
        0 10px 30px rgba(91, 141, 196, 0.25),
        0 5px 15px rgba(74, 114, 181, 0.15);
}

.radio-option label:hover {
    border-color: #5b8dc4;
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(91, 141, 196, 0.15);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-option {
    position: relative;
}

.checkbox-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkbox-option label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    position: relative;
    user-select: none;
}

.checkbox-option label::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-right: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: white;
    position: relative;
}

.checkbox-option input[type="checkbox"]:checked + label::before {
    background: var(--primary);
    /* background: linear-gradient(135deg, var(--primary), var(--primary-dark)); */
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--glow);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.checkbox-option input[type="checkbox"]:checked + label {
    border-color: var(--primary);
    background: rgba(91, 141, 196, 0.05);
    box-shadow: 0 5px 20px rgba(91, 141, 196, 0.12);
}

.checkbox-option label:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 5px 20px rgba(91, 141, 196, 0.08);
    background: white;
}

.checkbox-option .price-tag {
    margin-left: auto;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 25px;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 16px;
    font-size: 1rem;
    /* font-family: 'DM Sans', sans-serif; */
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
    color: var(--text);
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 141, 196, 0.1), 0 0 30px rgba(91, 141, 196, 0.12);
    background: white;
}

/* Slider styles */
.slider-container {
    padding: 20px 0;
}

.slider-value {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    /* font-family: 'Sora', sans-serif; */
}

.slider-wrapper {
    position: relative;
    padding: 0;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #e2e8f0 0%, #e2e8f0 100%);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    /* background: linear-gradient(135deg, #4a72b5, #5b8dc4); */
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(91, 141, 196, 0.4);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(91, 141, 196, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4a72b5, #5b8dc4);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(91, 141, 196, 0.4);
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(91, 141, 196, 0.5);
}

.slider-labels {
    display: block;
    margin-top: 12px;
    padding: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    position: relative;
    height: 20px;
}

.slider-labels span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Точное выравнивание меток с учетом положения thumb */
.slider-labels span:nth-child(1) { left: 2%; }
.slider-labels span:nth-child(2) { left: 16.66%; }
.slider-labels span:nth-child(3) { left: 33.33%; }
.slider-labels span:nth-child(4) { left: 50%; }
.slider-labels span:nth-child(5) { left: 66.67%; }
.slider-labels span:nth-child(6) { left: 83.33%; }
.slider-labels span:nth-child(7) { left: 98%; }


/* Специальные стили для ползунка с 13 значениями (сотрудники) */
.slider-labels.employees-labels span:nth-child(1) { left: 2%; }
.slider-labels.employees-labels span:nth-child(2) { left: 8.33%; }
.slider-labels.employees-labels span:nth-child(3) { left: 16.67%; }
.slider-labels.employees-labels span:nth-child(4) { left: 25%; }
.slider-labels.employees-labels span:nth-child(5) { left: 33.33%; }
.slider-labels.employees-labels span:nth-child(6) { left: 41.67%; }
.slider-labels.employees-labels span:nth-child(7) { left: 50%; }
.slider-labels.employees-labels span:nth-child(8) { left: 58.33%; }
.slider-labels.employees-labels span:nth-child(9) { left: 66.67%; }
.slider-labels.employees-labels span:nth-child(10) { left: 75%; }
.slider-labels.employees-labels span:nth-child(11) { left: 83.33%; }
.slider-labels.employees-labels span:nth-child(12) { left: 91.67%; }
.slider-labels.employees-labels span:nth-child(13) { left: 98%; }

.slider-labels.payments-labels span:nth-child(1) { left: 2%; }
.slider-labels.payments-labels span:nth-child(2) { left: 21%; }
.slider-labels.payments-labels span:nth-child(3) { left: 40%; }
.slider-labels.payments-labels span:nth-child(4) { left: 60%; }
.slider-labels.payments-labels span:nth-child(5) { left: 79%; }
.slider-labels.payments-labels span:nth-child(6) { left: 98%; }


.result-card {
    /* background: linear-gradient(135deg, #4a72b5 0%, #5b8dc4 50%, #7ba3d1 100%); */
    /* background: linear-gradient(135deg, var(--primary), var(--primary-dark)); */
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 24px;
    padding: 45px;
    color: white;
    box-shadow: 
        0 20px 60px rgba(91, 141, 196, 0.2),
        0 10px 30px rgba(74, 114, 181, 0.12);
    border: none;
    position: sticky;
    top: 20px;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
    overflow: hidden;
    z-index: 0;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(91, 141, 196, 0.1), rgba(123, 163, 209, 0.05));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.result-card:hover::before {
    opacity: 1;
}

.result-card::after {
    display: none;
}

.result-card > * {
    position: relative;
    z-index: 1;
}

.result-card .section-title {
    color: white;
    margin-bottom: 35px;
}

.result-card .section-title::before {
    background: var(--secondary);
}

.price-display {
    text-align: center;
    margin: 40px 0;
    padding: 35px 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.price-label {
    font-size: 0.85rem;
    opacity: 0.95;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.price-amount {
    /* font-family: "Open Sans", sans-serif; */
    font-size: 3.9rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.price-period {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 12px;
    font-weight: 500;
}

.breakdown {
    margin-top: 30px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    opacity: 0.95;
    font-weight: 400;
}

.breakdown-value {
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

.cta-button {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #fff, #e0e7ff);
    color: var(--primary);
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* font-family: 'Sora', sans-serif; */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 30px;
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(255, 255, 255, 0.3);
}

.cta-button:active {
    transform: translateY(-1px);
}

.note {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.7;
    opacity: 0.95;
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

@media (max-width: 968px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .result-card {
        position: static;
        z-index: auto;
    }

    .card {
        padding: 30px;
        z-index: auto;
    }

    .price-amount {
        font-size: 3.2rem;
    }
}

@media (max-width: 640px) {
    .card {
        padding: 25px;
    }

    .result-card {
        padding: 30px;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-option label {
        width: 100%;
        text-align: center;
    }

    .price-amount {
        font-size: 2.8rem;
    }
    .result-card .section-title {
        margin-bottom: 0px;
    }    
    h2 {
        padding: 0 0 0vh;
    }    
}