/* ============================================================
   Insurance companies section (front component) — auto slider
   Scope: .insurance-* classes only — no other component is touched.
   Brand colors follow the rest of the site (#00c19a / #3bd8ad / #f4fcfa).

   How the slider works (pure CSS, no library):
   .insurance-track holds TWO identical .insurance-group blocks side by side
   and slides left by exactly 50% forever, so when the first group has fully
   left the screen the second one sits exactly where it started — no jump.
============================================================ */

.insurance-section {
    background: linear-gradient(180deg, #ffffff 0%, #f4fcfa 100%);
    overflow: hidden;
}

/* ---------- Header ---------- */
.insurance-header {
    max-width: 720px;
    margin: 0 auto 32px;
}

.insurance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e6f9f4;
    color: #00997e;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 14px;
}

.insurance-title {
    font-size: 2rem;
    font-weight: 800;
    color: #242424;
    margin-bottom: 10px;
}

.insurance-subtitle {
    font-size: 17px;
    color: #666;
    line-height: 1.8;
    margin: 0;
}

/* ---------- Slider ---------- */
.insurance-marquee {
    /* Forced LTR: the slide direction and the -50% loop math must not flip
       with the page/text direction. Card text inside is centered anyway. */
    direction: ltr;
    position: relative;
    overflow: hidden;
    /* Room for the hover lift + shadow so they are not clipped. */
    padding: 24px 0 30px;
    /* Cards fade in/out at both edges instead of being cut off hard. */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.insurance-track {
    display: flex;
    width: max-content;
    animation: insuranceScroll var(--insurance-duration, 30s) linear infinite;
    will-change: transform;
}

/* Hover / keyboard focus pauses the slider so a logo can be read comfortably. */
.insurance-marquee:hover .insurance-track,
.insurance-marquee:focus-within .insurance-track {
    animation-play-state: paused;
}

.insurance-group {
    display: flex;
    flex-shrink: 0;
}

@keyframes insuranceScroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ---------- Card ---------- */
.insurance-card {
    flex: 0 0 200px;
    /* margin (not gap) so both groups have identical widths -> seamless loop */
    margin-right: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px 16px 16px;
    background: #fff;
    border: 1px solid #e3f4ef;
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.insurance-card:hover {
    transform: translateY(-6px);
    border-color: #3bd8ad;
    box-shadow: 0 14px 32px rgba(0, 193, 154, 0.16);
}

.insurance-logo {
    width: 100%;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logos start slightly muted so a mixed wall of colors looks calm,
   then come alive on hover. */
.insurance-logo img {
    max-width: 85%;
    max-height: 100%;
    object-fit: contain;
    /*filter: grayscale(.85);*/
    opacity: .85;
    transition: filter .3s ease, opacity .3s ease, transform .3s ease;
    user-select: none;
}

.insurance-card:hover .insurance-logo img {
    filter: none;
    opacity: 1;
    transform: scale(1.06);
}

.insurance-logo-fallback {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e6f9f4;
    color: #00997e;
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insurance-name {
    font-size: 17px;
    font-weight: 600;
    color: #555;
    text-align: center;
    line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .insurance-title {
        font-size: 1.5rem;
    }

    .insurance-subtitle {
        font-size: 15px;
    }

    .insurance-header {
        margin-bottom: 20px;
    }

    .insurance-card {
        flex-basis: 150px;
        margin-right: 12px;
        padding: 16px 10px 12px;
        border-radius: 16px;
    }

    .insurance-logo {
        height: 58px;
    }

    .insurance-marquee {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
    }
}

/* ---------- Accessibility: no automatic motion when the user asks for less ---------- */
@media (prefers-reduced-motion: reduce) {
    .insurance-marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .insurance-track {
        animation: none;
    }

    /* The duplicate group only exists for the looping animation. */
    .insurance-group[aria-hidden="true"] {
        display: none;
    }
}
