/* ------------------------------------------------------------------
   "How Carevo compares." section
   Ported from the Rimo comparison section, rebuilt self-contained and
   blended into Carevo's design language (brand #1800ad, off-black #111,
   cream #f4f3ec, border #e5e5e5, Saans/Serrif type).

   Everything is namespaced under .cvc so it cannot collide with, or
   leak into, the existing Carevo/Tailwind styles.
   ------------------------------------------------------------------ */

.cvc {
    --cvc-brand: #1800ad;
    --cvc-fg: #111;
    --cvc-muted-fg: #6a7282;
    --cvc-cream: #f4f3ec;
    --cvc-border: #e5e5e5;
    --cvc-white: #fff;
    --cvc-yes: #45a557;
    --cvc-no: #e40014;
    background: var(--cvc-white);
    padding: 6rem 0;
    font-family: saans, "saans Fallback", ui-sans-serif, system-ui, sans-serif;
    color: var(--cvc-fg);
}

.cvc__inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- heading ---------- */
.cvc__head {
    position: relative;
    margin-bottom: 3rem;
}

.cvc__eyebrow {
    display: block;
    font-family: serrif, "serrif Fallback", ui-serif, Georgia, serif;
    font-style: italic;
    font-size: 1.5rem;
    line-height: 1.1;
    color: var(--cvc-brand);
}

.cvc__title {
    margin-top: .75rem;
    font-family: saans, "saans Fallback", ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    line-height: 1.05;
    letter-spacing: -.03em;
    font-weight: 400;
    color: var(--cvc-fg);
    text-wrap: balance;
}

.cvc__lede {
    margin-top: 1rem;
    max-width: 42rem;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--cvc-muted-fg);
}

@media (min-width: 1024px) {
    .cvc__head { overflow: hidden; }
    .cvc__eyebrow {
        position: absolute;
        right: 0;
        top: .5rem;
        transform: rotate(-6deg);
        transform-origin: 100% 50%;
        white-space: nowrap;
        font-size: 1.5rem;
        max-width: 45%;
    }
    .cvc__head > div { margin-top: 0; }
}

/* ---------- comparison table ---------- */
.cvc__table {
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--cvc-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -12px rgba(0, 0, 0, .08);
}

.cvc__scroll { overflow-x: auto; }

.cvc__grid {
    display: grid;
    grid-template-columns: 1.8fr 1.15fr 1fr 1fr 1fr;
    min-width: 720px;
    align-items: stretch;
}

/* header row */
.cvc__hcell {
    background: color-mix(in srgb, var(--cvc-cream) 55%, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem .75rem;
    text-align: center;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--cvc-muted-fg);
}

.cvc__hcell--label { justify-content: flex-start; padding-left: 1.25rem; }

.cvc__hcell--own {
    background: color-mix(in srgb, var(--cvc-brand) 8%, #fff);
    color: var(--cvc-fg);
    font-weight: 700;
}

/* group heading row */
.cvc__group {
    grid-column: 1 / -1;
    background: var(--cvc-cream);
    padding: .625rem 1.25rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cvc-muted-fg);
    border-top: 1px solid var(--cvc-border);
}

/* data cells */
.cvc__row { display: contents; }

.cvc__cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .875rem .5rem;
    text-align: center;
    font-size: .8125rem;
    line-height: 1.3;
    color: var(--cvc-muted-fg);
    border-top: 1px solid var(--cvc-border);
    transition: background-color .2s ease;
}

.cvc__cell--label {
    justify-content: flex-start;
    text-align: left;
    padding-left: 1.25rem;
    padding-right: 1rem;
    font-size: .875rem;
    color: var(--cvc-fg);
}

/* the "us" column gets a subtle brand tint + emphasis */
.cvc__cell--own {
    background: color-mix(in srgb, var(--cvc-brand) 4%, #fff);
    color: var(--cvc-brand);
    font-weight: 500;
}

.cvc__row:hover .cvc__cell { background: color-mix(in srgb, var(--cvc-cream) 45%, #fff); }
.cvc__row:hover .cvc__cell--own { background: color-mix(in srgb, var(--cvc-brand) 7%, #fff); }

/* yes / no pills */
.cvc__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    flex: none;
}
.cvc__mark svg { width: .625rem; height: .625rem; }
.cvc__mark--yes { background: color-mix(in srgb, var(--cvc-yes) 15%, transparent); color: var(--cvc-yes); }
.cvc__mark--no  { background: color-mix(in srgb, var(--cvc-no) 10%, transparent);  color: var(--cvc-no); }

/* ---------- feature showcase ---------- */
.cvc__showcase { margin-top: 4rem; }

.cvc__panel {
    position: relative;
    height: 20rem;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--cvc-border);
    background: var(--cvc-cream);
}

.cvc__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .7s ease;
}
.cvc__slide.is-active { opacity: 1; }
.cvc__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.cvc__cards {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 0;
}

.cvc__card {
    appearance: none;
    background: none;
    border: 0;
    border-top: 1px solid var(--cvc-border);
    cursor: pointer;
    text-align: left;
    padding: 1.25rem 0;
    opacity: .5;
    transition: opacity .25s ease;
    font: inherit;
    color: inherit;
}
.cvc__card:hover { opacity: .75; }
.cvc__card.is-active { opacity: 1; }

.cvc__card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--cvc-fg);
}
.cvc__card-title svg { width: .875rem; height: .875rem; flex: none; color: var(--cvc-muted-fg); }
.cvc__card.is-active .cvc__card-title svg { color: var(--cvc-brand); }

.cvc__card-body {
    margin-top: .375rem;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--cvc-muted-fg);
}

@media (min-width: 640px) {
    .cvc__cards {
        grid-template-columns: repeat(3, 1fr);
        margin-top: 2rem;
        border-top: 1px solid var(--cvc-border);
    }
    .cvc__card {
        border-top: 0;
        border-left: 1px solid var(--cvc-border);
        padding: 1.25rem 1.5rem;
    }
    .cvc__card:first-child { border-left: 0; padding-left: 0; }
    .cvc__card:last-child { padding-right: 0; }
}

/* ---------- mobile competitor selector (hidden on >= sm) ---------- */
.cvc__vs { display: none; }

@media (max-width: 639px) {
    .cvc { padding: 4rem 0; }
    .cvc__showcase { display: flex; flex-direction: column-reverse; gap: 2rem; }
    .cvc__cards { margin-top: 0; }

    /* the panel is a near-square 342x320 on phones (matches the original),
       and the mobile <source> image is authored at that ratio - so show it
       whole instead of cropping a wide desktop capture */
    .cvc__panel { height: auto; aspect-ratio: 342 / 320; }
    .cvc__slide img { object-fit: fill; }

    /* segmented control: Bask | OpenLoop | CareValidate */
    .cvc__vs {
        display: flex;
        gap: .25rem;
        margin-bottom: .75rem;
        padding: .25rem;
        border-radius: .625rem;
        background: var(--cvc-cream);
    }
    .cvc__vs-btn {
        flex: 1 1 0;
        appearance: none;
        border: 0;
        cursor: pointer;
        border-radius: .5rem;
        padding: .5rem .75rem;
        font: inherit;
        font-size: .75rem;
        font-weight: 500;
        color: var(--cvc-muted-fg);
        background: transparent;
        transition: background-color .2s ease, color .2s ease;
    }
    .cvc__vs-btn.is-active {
        background: var(--cvc-white);
        color: var(--cvc-fg);
        box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    }

    /* 3 columns: feature | Carevo | selected rival */
    .cvc__grid { grid-template-columns: 1.5fr 1.15fr 1fr; min-width: 0; }
    .cvc__scroll { overflow-x: visible; }

    /* hide every rival column except the selected one */
    .cvc [data-col="2"], .cvc [data-col="3"], .cvc [data-col="4"] { display: none; }
    .cvc[data-vs="1"] [data-col="2"],
    .cvc[data-vs="2"] [data-col="3"],
    .cvc[data-vs="3"] [data-col="4"] { display: flex; }

    .cvc__cell, .cvc__hcell { padding-left: .5rem; padding-right: .5rem; font-size: .75rem; }
    .cvc__cell--label { padding-left: .75rem; padding-right: .5rem; font-size: .8125rem; }
    .cvc__group { padding-left: .75rem; }
}
