
/* ╔══════════════════════════════════════════════════════════╗
   ║         CALCULATOR SECTION — rz-* STYLE SYSTEM         ║
   ╚══════════════════════════════════════════════════════════╝ */

.rz-calc-wrapper {
    position: relative;
    padding: 80px 0;
    color: var(--rz-dark);
}

.rz-calc-wrapper *,
.rz-calc-wrapper *::before,
.rz-calc-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.rz-calc-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ═══════════════════ LAYOUT ═══════════════════ */
.rz-calc-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.rz-calc-form-area {
    flex: 1;
    min-width: 0;
}

/* ═══════════════════ GRID ═══════════════════ */
.rz-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ═══════════════════ CARD ═══════════════════ */
/* Наследует .rz-card — glassmorphism, glow, hover */

.rz-calc-card-inner {
    padding: 28px 24px !important;
}

.rz-calc-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.rz-calc-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--rz-accent);
    color: white;
    font-size: 14px;
    font-weight: 800;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--rz-transition);
}

.rz-calc-card:hover .rz-calc-num {
    transform: scale(1.1) rotate(-5deg);
}

.rz-calc-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rz-dark);
    line-height: 1.3;
    margin-bottom: 4px;
}

.rz-calc-card-desc {
    font-size: 12px;
    color: var(--rz-gray);
    line-height: 1.4;
}

/* ═══════════════════ OPTIONS ═══════════════════ */
.rz-calc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rz-calc-options--row {
    flex-direction: row;
    gap: 10px;
}

.rz-calc-options--row .rz-calc-option {
    flex: 1;
}

/* ─── Single option ─── */
.rz-calc-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--rz-light);
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--rz-transition);
    position: relative;
}

.rz-calc-option:hover {
    background: white;
    border-color: rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.rz-calc-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Checkbox box */
.rz-calc-option-box {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--rz-transition);
    background: white;
}

.rz-calc-check-icon {
    opacity: 0;
    transform: scale(0.5);
    transition: var(--rz-transition);
    color: white;
}

/* Radio box */
.rz-calc-option-box--radio {
    border-radius: 50%;
    position: relative;
}

.rz-calc-option-box--radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transform: scale(0);
    transition: var(--rz-transition);
}

/* ─── Checked states ─── */
.rz-calc-option input:checked ~ .rz-calc-option-box {
    border-color: var(--rz-success);
    background: var(--rz-success);
}

.rz-calc-option input:checked ~ .rz-calc-option-box .rz-calc-check-icon {
    opacity: 1;
    transform: scale(1);
}

.rz-calc-option input:checked ~ .rz-calc-option-box--radio::after {
    opacity: 1;
    transform: scale(1);
}

.rz-calc-option input:checked ~ .rz-calc-option-content {
    color: var(--rz-dark);
    font-weight: 600;
}

/* Вся строка при выборе */
.rz-calc-option:has(input:checked) {
    background: rgba(149, 193, 31, 0.06);
    border-color: rgba(149, 193, 31, 0.25);
}

/* Fallback для браузеров без :has() */
@supports not (selector(:has(*))) {
    .rz-calc-option input:checked ~ .rz-calc-option-content span {
        color: var(--rz-dark);
    }
}

/* Option content */
.rz-calc-option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--rz-gray);
    transition: var(--rz-transition);
}

.rz-calc-option-icon {
    color: var(--rz-primary);
    opacity: 0.5;
    transition: var(--rz-transition);
}

.rz-calc-option:hover .rz-calc-option-icon,
.rz-calc-option:has(input:checked) .rz-calc-option-icon {
    opacity: 1;
}

/* Compact (Да/Нет) */
.rz-calc-option--compact {
    padding: 14px 20px;
}

.rz-calc-option--compact .rz-calc-option-content span {
    font-size: 15px;
}

/* ═══════════════════ INPUT FIELD ═══════════════════ */
.rz-calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rz-calc-input-wrap {
    position: relative;
}

.rz-calc-input {
    width: 100%;
    padding: 16px 60px 16px 20px;
    border: 2px solid rgba(99, 102, 241, 0.12);
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    color: var(--rz-dark);
    background: var(--rz-light);
    transition: var(--rz-transition);
    font-family: inherit;
}

.rz-calc-input::placeholder {
    color: rgba(100, 116, 139, 0.4);
    font-weight: 500;
}

.rz-calc-input:focus {
    outline: none;
    border-color: var(--rz-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(88, 128, 192, 0.1);
}

.rz-calc-input-suffix {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--rz-gray);
    pointer-events: none;
}

.rz-calc-input-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--rz-gray);
    opacity: 0.7;
    padding-left: 4px;
}

.rz-calc-input-hint svg {
    flex-shrink: 0;
    color: var(--rz-primary);
    opacity: 0.5;
}

/* ═══════════════════ SIDEBAR ═══════════════════ */
.rz-calc-sidebar {
    position: sticky;
    top: 155px;
    flex-shrink: 0;
    width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rz-calc-result-glass {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--rz-radius);
    padding: 28px;
    box-shadow: var(--rz-shadow);
}

@supports (backdrop-filter: blur(10px)) {
    .rz-calc-result-glass {
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* ─── Price ─── */
.rz-calc-result-top {
    margin-bottom: 20px;
}

.rz-calc-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
}

.rz-calc-price-from {
    font-size: 14px;
    color: var(--rz-gray);
    font-weight: 500;
}

.rz-calc-price-value {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    transition: var(--rz-transition);
}

.rz-calc-price-currency {
    font-size: 20px;
    font-weight: 700;
    color: var(--rz-dark);
}

/* ─── Progress ─── */
.rz-calc-progress {
    margin-bottom: 20px;
}

.rz-calc-progress-bar {
    height: 4px;
    background: var(--rz-light);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.rz-calc-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--rz-primary), var(--rz-accent));
    border-radius: 2px;
    transition: width 0.4s ease;
}

.rz-calc-progress-text {
    font-size: 11px;
    color: var(--rz-gray);
}

/* ─── Details ─── */
.rz-calc-details {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.rz-calc-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rz-light);
}

.rz-calc-detail-row:last-child {
    border-bottom: none;
}

.rz-calc-detail-label {
    font-size: 13px;
    color: var(--rz-gray);
}

.rz-calc-detail-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--rz-dark);
    text-align: right;
    transition: var(--rz-transition);
}

/* ─── Divider ─── */
.rz-calc-sidebar-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--rz-success), rgba(149, 193, 31, 0.2));
    border-radius: 1px;
    margin-bottom: 20px;
}

/* ─── Send form ─── */
.rz-calc-send {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rz-calc-send-text {
    font-size: 13px;
    color: var(--rz-gray);
    line-height: 1.5;
}

.rz-calc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rz-calc-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--rz-gray);
}

.rz-calc-field-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--rz-dark);
    background: var(--rz-light);
    transition: var(--rz-transition);
    font-family: inherit;
}

.rz-calc-field-input::placeholder {
    color: rgba(100, 116, 139, 0.4);
}

.rz-calc-field-input:focus {
    outline: none;
    border-color: var(--rz-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(88, 128, 192, 0.08);
}

/* Submit */
.rz-calc-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(315deg, var(--green), var(--green-hover));
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--rz-transition);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    margin-top: 4px;
}

.rz-calc-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.rz-calc-submit svg {
    flex-shrink: 0;
}

.rz-calc-disclaimer {
    font-size: 11px;
    color: var(--rz-gray);
    text-align: center;
    line-height: 1.4;
    margin-bottom: 0px;
    
}

.rz-calc-disclaimer a {
    color: var(--rz-primary);
    text-decoration: none;
}

.rz-calc-disclaimer a:hover {
    text-decoration: underline;
}

/* ─── Bonus block ─── */
.rz-calc-bonus {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--rz-radius-sm);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.06);
}

@supports (backdrop-filter: blur(10px)) {
    .rz-calc-bonus {
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

.rz-calc-bonus-icon {
    width: 44px;
    height: 44px;
    background: var(--rz-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.rz-calc-bonus-content strong {
    display: block;
    font-size: 13px;
    color: var(--rz-dark);
    margin-bottom: 2px;
}

.rz-calc-bonus-phone {
    font-size: 16px;
    font-weight: 700;
    color: var(--rz-primary);
    text-decoration: none;
    transition: var(--rz-transition);
}

.rz-calc-bonus-phone:hover {
    color: var(--rz-accent);
}

/* ═══════════════════ ANIMATIONS ═══════════════════ */
.rz-calc-card {
    animation: rz-fadeIn 0.5s ease backwards;
}

.rz-calc-card:nth-child(1) { animation-delay: 0.05s; }
.rz-calc-card:nth-child(2) { animation-delay: 0.1s; }
.rz-calc-card:nth-child(3) { animation-delay: 0.15s; }
.rz-calc-card:nth-child(4) { animation-delay: 0.2s; }
.rz-calc-card:nth-child(5) { animation-delay: 0.25s; }
.rz-calc-card:nth-child(6) { animation-delay: 0.3s; }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 1100px) {
    .rz-calc-layout {
        flex-direction: column;
        gap: 24px;
    }

    .rz-calc-sidebar {
        position: static;
        width: 100%;
        flex-direction: row;
        gap: 20px;
    }

    .rz-calc-result-glass {
        flex: 1;
    }

    .rz-calc-bonus {
        flex: 0 0 auto;
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
        align-self: stretch;
    }
}

@media (max-width: 768px) {
    .rz-calc-wrapper {
        padding: 60px 0 40px;
    }

    .rz-calc-container {
        padding: 0 10px;
    }

    .rz-calc-grid {
        gap: 8px;
    }

    .rz-calc-card-inner {
        padding: 22px 18px !important;
    }

    .rz-calc-card-head {
        margin-bottom: 16px;
            flex-direction: column;
    }

    .rz-calc-num {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-radius: 8px;
    }

    .rz-calc-card-title {
        font-size: 14px;
    }

    .rz-calc-options--row {
        flex-direction: column;
    }

    /* Sidebar stacked */
    .rz-calc-sidebar {
        flex-direction: column;
    }

    .rz-calc-result-glass {
        padding: 22px 18px;
    }

    .rz-calc-price-value {
        font-size: 28px;
    }

    .rz-calc-option-icon {
    display: none;
}

    .rz-calc-bonus {
        flex-direction: row;
        text-align: left;
    }

    .rz-calc-submit {
        padding: 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .rz-calc-option {
        padding: 10px 12px;
        gap: 10px;
    }

    .rz-calc-option-content {
        font-size: 13px;
    }

    .rz-calc-input {
        padding: 14px 50px 14px 16px;
        font-size: 16px;
    }

    .rz-calc-field-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .rz-calc-price-value {
        font-size: 24px;
    }
}



/* Fallback для :has() */
.rz-calc-option--active {
    background: rgba(149, 193, 31, 0.06);
    border-color: rgba(149, 193, 31, 0.25);
}

.rz-calc-option--active .rz-calc-option-icon {
    opacity: 1;
}

/* ═══════════════════ ACTIVE STATES ═══════════════════ */

/* Fallback для :has() — active class из JS */
.rz-calc-option--active {
    background: rgba(149, 193, 31, 0.06);
    border-color: rgba(149, 193, 31, 0.25);
}

.rz-calc-option--active .rz-calc-option-icon {
    opacity: 1;
}

/* Заполненная карточка — тонкий индикатор */
.rz-calc-card--filled {
    border-color: rgba(149, 193, 31, 0.2) !important;
}

.rz-calc-card--filled .rz-calc-num {
    background: var(--rz-success);
}

/* Detail value — заполнено */
.rz-calc-detail-value--filled {
    color: var(--rz-dark) !important;
    font-weight: 700 !important;
}

/* ─── Price pulse при обновлении ─── */
@keyframes rz-calc-price-bump {
    0% { transform: scale(1); }
    30% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.rz-calc-price-value.rz-calc-price--updating {
    animation: rz-calc-price-bump 0.4s ease;
}

/* ─── Progress fill gradient при 100% ─── */
.rz-calc-progress-fill[style*="100%"] {
    background: linear-gradient(90deg, var(--rz-success), #059669);
}

/* ─── Submit button disabled state ─── */
.rz-calc-submit:disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ─── Card filled transition ─── */
.rz-calc-card--filled .rz-card-glow {
    opacity: 0.15 !important;
}

/* ─── Sidebar detail row transition ─── */
.rz-calc-detail-value {
    transition: color 0.3s ease, font-weight 0.3s ease;
}

/* ─── Mobile: sidebar floating при заполнении ─── */
@media (max-width: 768px) {
    .rz-calc-result-glass {
        transition: box-shadow 0.3s ease;
    }

    /* Когда прогресс > 0, подсвечиваем sidebar */
    .rz-calc-progress-fill:not([style*="width: 0"]) ~ .rz-calc-details {
        border-left: 3px solid var(--rz-success);
        padding-left: 12px;
    }
}