:root {
    --fill: #82f16c;
    --track: #eef0f2;
    --thumb: #ffffff;

    --track-height: 48px;
    --thumb-size: 44px;
    --radius: 29px;
    --shadow: 0 1px 0 rgba(255, 255, 255, .7),
        inset 0 3px 10px rgba(0, 0, 0, .06),
        0 1px 0 rgba(255, 255, 255, .6);
}

.confirmslider {
    margin-top: 10px;
    position: relative;
    width: 320px;
    height: var(--track-height);
    background: var(--track);
    border-radius: 30px;
    box-shadow: var(--shadow);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    /* prevent scroll hijack on mobile */
    overflow: hidden;
    z-index: 1;
}

.confirmslider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: var(--fill);
    border-radius: var(--radius);
    transition: width .2s ease;
}

.confirmslider-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-weight: 600;
    pointer-events: none;
}

/* THUMB (draggable knob) */
.confirmslider-thumb {
    position: absolute;
    top: 50%;
    left: 2px;
    transform: translate(0, -50%);
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 50%;
    background: var(--thumb);
    cursor: grab;
    z-index: 2;
    /* keep above text/fill */
    box-shadow:
        0 6px 16px rgba(0, 0, 0, .18),
        inset 0 1px 0 rgba(255, 255, 255, .9),
        inset 0 -2px 6px rgba(0, 0, 0, .05);
    transition: left .2s ease;
    touch-action: none;
    /* allow drag gesture */
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.confirmslider-thumb:active {
    cursor: grabbing;
}

/* COMPLETED STATE */
.confirmslider.completed .confirmslider-fill {
    width: 100% !important;
}

.confirmslider.completed .confirmslider-text {
    color: #1f2937;
}

.confirmslider.completed .confirmslider-thumb {
    left: calc(100% - var(--thumb-size) - 2px) !important;
}

/* ACCESSIBILITY FOCUS */
.confirmslider:focus-visible {
    outline: 3px solid rgba(88, 140, 28, .35);
    outline-offset: 6px;
}

.confirmslider * {
    pointer-events: auto !important;
    /* reset any theme-wide PE:none */
}

/* Only the overlays should ignore touches so the knob/pill get the events */
.confirmslider .confirmslider-fill,
.confirmslider .confirmslider-text {
    pointer-events: none !important;
}
