
/* =========================================
   PREMIUM RCM PILL TOGGLE
   Keeps existing HTML and functionality
========================================= */

.flip-switch-container {
    --switch-width: 380px;
    --switch-height: 50px;
    --active-color: #206685;
    --active-dark: #17a28b;
    --text-color: #263b35;
    --muted-color: #68776f;

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: auto;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

.flip-switch {
    position: relative;
    display: flex;
    align-items: center;
    width: var(--switch-width);
    height: var(--switch-height);
    padding: 5px;

    background: #f1f5f3;
    border: 1px solid #dce8e2;
    border-radius: 50px;

    box-shadow:
        0 3px 10px rgba(20, 65, 48, 0.06),
        inset 0 1px 2px rgba(20, 65, 48, 0.04);

    overflow: hidden;
    isolation: isolate;
}

/* Hide radio inputs without changing functionality */
.flip-switch input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Individual toggle options - normal is black */
.flip-switch .switch-button {
    position: relative;
    z-index: 2;

    flex: 1;
    height: 100%;
    min-width: 0;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 8px;
    margin: 0;

    border-radius: 50px;
    cursor: pointer;

    color: #000000;
    transition:
        color 0.25s ease,
        transform 0.25s ease;

    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Icons - normal is black */
.flip-switch .switch-button svg {
    flex-shrink: 0;
    width: 17px;
    height: 17px;

    color: #000000;
    fill: #000000;
    filter: none;
    transition: transform 0.25s ease, color 0.25s ease, fill 0.25s ease;
}

/* Labels - normal is black */
.flip-switch .switch-button span {
    color: #000000;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1px;
    line-height: 1.2;
    white-space: nowrap;
    transition: color 0.25s ease;
}

/* Hover */
.flip-switch .switch-button:hover svg {
    transform: scale(1.08);
    filter: none;
}

/* Sliding active pill */
.flip-switch .switch-card {
    position: absolute;
    z-index: 1;
    top: 5px;
    left: 5px;

    width: calc((100% - 10px) / 2);
    height: calc(100% - 10px);

    border-radius: 50px;
    transform: translateX(0);
    transform-style: flat;

    pointer-events: none;
    animation: none;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Remove old flip-card faces */
.flip-switch .card-face {
    display: none;
}

/* Active pill background */
.flip-switch .switch-card::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        135deg,
        var(--active-color),
        var(--active-dark)
    );

    border-radius: inherit;
    box-shadow:
        0 4px 12px rgba(32, 102, 133, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Business selected */
.flip-switch #rcm-switch-business:checked ~ .switch-card,
.flip-switch #home-switch-business:checked ~ .switch-card {
    transform: translateX(0);
}

/* Patient selected */
.flip-switch #rcm-switch-patient:checked ~ .switch-card,
.flip-switch #home-switch-patient:checked ~ .switch-card {
    transform: translateX(100%);
}

/* Active label & text & icon: WHITE */
.flip-switch #rcm-switch-business:checked ~ label[for="rcm-switch-business"],
.flip-switch #rcm-switch-patient:checked ~ label[for="rcm-switch-patient"],
.flip-switch #home-switch-business:checked ~ label[for="home-switch-business"],
.flip-switch #home-switch-patient:checked ~ label[for="home-switch-patient"] {
    color: #ffffff !important;
}

.flip-switch #rcm-switch-business:checked ~ label[for="rcm-switch-business"] svg,
.flip-switch #rcm-switch-patient:checked ~ label[for="rcm-switch-patient"] svg,
.flip-switch #home-switch-business:checked ~ label[for="home-switch-business"] svg,
.flip-switch #home-switch-patient:checked ~ label[for="home-switch-patient"] svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.flip-switch #rcm-switch-business:checked ~ label[for="rcm-switch-business"] span,
.flip-switch #rcm-switch-patient:checked ~ label[for="rcm-switch-patient"] span,
.flip-switch #home-switch-business:checked ~ label[for="home-switch-business"] span,
.flip-switch #home-switch-patient:checked ~ label[for="home-switch-patient"] span {
    color: #ffffff !important;
}
/* Remove old glowing underline */
.flip-switch .switch-button::after {
    display: none !important;
}

/* Keyboard accessibility */
.flip-switch input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--active-color);
    outline-offset: -3px;
}

/* Right-aligned hero placement */
.hero-switch-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-switch-wrap .flip-switch-container {
    margin: 0;
}

/* Responsive */
@media (max-width: 575.98px) {
    .flip-switch-container {
        --switch-width: 270px;
        --switch-height: 50px;
    }

    .flip-switch .switch-button {
        gap: 5px;
        padding: 0 5px;
    }

    .flip-switch .switch-button span {
        font-size: 11px;
    }

    .flip-switch .switch-button svg {
        width: 16px;
        height: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flip-switch .switch-card,
    .flip-switch .switch-button,
    .flip-switch .switch-button svg {
        transition: none;
    }
}

