﻿/* ── Outer layout ────────────────────────────────────────────────────────── */
.resurs-ribbon {
    display: flex;
    min-height: 588px;
    border-radius: 16px;
    overflow: hidden;
    font-family: 'Instrument Sans', 'DM Sans', sans-serif;
}

/* ── Left panel ──────────────────────────────────────────────────────────── */
.resurs-ribbon__left {
    flex: 0 0 50%;
    background: #f5f5f2;
    display: flex;
    align-items: center;
}

.resurs-ribbon__left-inner {
    padding: 3rem 3.5rem;
}

.resurs-ribbon__heading {
    font-size: clamp(1.75rem, 3vw, 2.6rem);
    font-weight: 700;
    color: #0f1a0f;
    line-height: 1.15;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

.resurs-ribbon__body {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.65;
    margin: 0 0 2rem;
    max-width: 320px;
}

.resurs-ribbon__logo {
    height: 34px;
    width: auto;
}

/* ── Right panel ─────────────────────────────────────────────────────────── */
.resurs-ribbon__right {
    flex: 1;
    background: #1e3a1e;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 3rem;
    /* Progress bar anchored here so it sits at the very bottom of the green panel */
    position: relative;
    overflow: hidden;
}

.resurs-ribbon__widget {
    width: 100%;
    max-width: 500px;
    /* NO overflow:hidden here — pills must not be clipped */
}

/* ── Slider rows ─────────────────────────────────────────────────────────── */
.rs-slider-row {
    margin-bottom: 5rem;
}

.rs-track-outer {
    position: relative;
}

/* Pill handle — sits on the track at the fill boundary */
.rs-pill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: #0f1a0f;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.4rem .7rem;
    border-radius: 5px 0px 5px 5px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    z-index: 3;
    transition: left 0.05s;
    text-align: center;
}

/* Amount range input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 15px;
    border-radius: 8px;
    background: linear-gradient( to right, #00c800 var(--pct, 40%), rgba(255,255,255,0.2) var(--pct, 40%) );
    outline: none;
    cursor: pointer;
    display: block;
}

    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 0;
        height: 0;
        opacity: 0;
    }

    input[type="range"]::-moz-range-thumb {
        width: 0;
        height: 0;
        opacity: 0;
        border: none;
    }

/* ── Months range input (hidden thumb, draggable) ───────────────────────── */
.months-range-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 15px;
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
    outline: none;
    cursor: pointer;
    display: block;
}

    .months-range-input::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 0;
        height: 0;
        opacity: 0;
    }

    .months-range-input::-moz-range-thumb {
        width: 0;
        height: 0;
        opacity: 0;
        border: none;
    }

/* ── Months disabled hatch overlay ──────────────────────────────────────── */
.rs-months-hatch {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    border-radius: 8px 0 0 8px;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='rgba(255%2C255%2C255%2C0.07)'/%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='%231e3a1e' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: 8px 8px;
    background-repeat: repeat;
}

/* ── Month tick marks ────────────────────────────────────────────────────── */
.rs-track-outer--months {
    position: relative;
}

.rs-months-ticks {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

    .rs-months-ticks .rs-tick {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 2px;
        transform: translateX(-50%);
        background: repeating-linear-gradient( to bottom, #1e3a1e 0px, #1e3a1e 3px, transparent 3px, transparent 6px );
    }

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.rs-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem 1rem;
    margin: 4.5rem 0 4rem;
    transition: opacity 0.2s;
}

.rs-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center
}

.rs-stat__label {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.rs-stat__value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

/* ── CTA ─────────────────────────────────────────────────────────────────── */
.rs-cta-wrap {
    display: flex;
    justify-content: center;
}

.rs-cta {
    display: inline-block;
    background: #00c800;
    color: #0f1a0f;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.9rem 2.75rem;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: background 0.15s, transform 0.1s;
}

    .rs-cta:hover {
        background: #00df00;
        transform: translateY(-1px);
    }

.rs-error {
    color: #f87171;
    font-size: 0.82rem;
    margin-top: 0.75rem;
    text-align: center;
}

/* ── Loading: fade content ───────────────────────────────────────────────── */
.rs-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.resurs-ribbon__widget.is-loading .rs-content {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
/* Anchored to .resurs-ribbon__right (position:relative, overflow:hidden)    */
/* so it sits at the very bottom of the green panel, never over the button   */
.rs-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.resurs-ribbon__widget.is-loading ~ .rs-progress-bar,
.resurs-ribbon__right:has(.resurs-ribbon__widget.is-loading) .rs-progress-bar {
    opacity: 1;
}

/* Animated sweep */
.rs-progress-bar__fill {
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: #00c800;
    border-radius: 2px;
    animation: rs-progress-sweep 1.2s ease-in-out infinite paused;
}

.resurs-ribbon__right:has(.resurs-ribbon__widget.is-loading) .rs-progress-bar__fill {
    animation-play-state: running;
}

@keyframes rs-progress-sweep {
    0% {
        left: -40%;
    }

    100% {
        left: 100%;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .resurs-ribbon {
        flex-direction: column;
    }

    .resurs-ribbon__left {
        flex: none;
    }

    .resurs-ribbon__left-inner {
        padding: 2rem 1.5rem;
    }

    .resurs-ribbon__right {
        padding: 2rem 1.5rem;
    }

    .rs-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.rs-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

    .rs-modal-backdrop.is-open {
        opacity: 1;
        pointer-events: all;
    }

.rs-modal {
    background: #1e3a1e;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    transform: translateY(12px);
    transition: transform 0.2s ease;
    color: #fff;
}

.rs-modal-backdrop.is-open .rs-modal {
    transform: translateY(0);
}

.rs-modal__close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

    .rs-modal__close:hover {
        color: #fff;
    }

.rs-modal__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
}

.rs-modal__subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin: 0 0 1.75rem;
}

.rs-modal__field {
    margin-bottom: 1.25rem;
}

    .rs-modal__field label {
        display: block;
        font-size: 0.8rem;
        color: rgba(255,255,255,0.6);
        margin-bottom: 0.4rem;
        letter-spacing: 0.03em;
    }

.rs-required {
    color: #f87171;
}

.rs-modal__field input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    color: #fff;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

    .rs-modal__field input::placeholder {
        color: rgba(255,255,255,0.3);
    }

    .rs-modal__field input:focus {
        border-color: #00c800;
    }

.rs-field-error {
    display: block;
    font-size: 0.78rem;
    color: #f87171;
    margin-top: 0.3rem;
}

    .rs-field-error[hidden] {
        display: none;
    }

.rs-modal__apply-error {
    font-size: 0.82rem;
    color: #f87171;
    margin: 0 0 1rem;
    text-align: center;
}

    .rs-modal__apply-error[hidden] {
        display: none;
    }

.rs-modal__submit {
    width: 100%;
    background: #00c800;
    color: #0f1a0f;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: background 0.15s, opacity 0.15s;
    margin-top: 0.5rem;
}

    .rs-modal__submit:hover {
        background: #00df00;
    }

    .rs-modal__submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

@media (max-width: 480px) {
    .rs-modal {
        margin: 1rem;
        padding: 2rem 1.25rem;
    }
}
