/* ===================================================================
   Pricing: green hero with the title, the page-view slider, the billing switch and three cards
   (Free, the plan picked on the slider, Corporate); then what every plan has, the add-ons,
   what the four limits mean and every plan side by side.
   =================================================================== */

.pricing {
    padding-top: calc(var(--header-height) + clamp(28px, 6vh, 64px));
    /* room for the wave under the cards: the lower part of the cards overlaps it */
    padding-bottom: max(120px, 12vw);
}

/* ===== title ===== */

.pricing-head {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.pricing-head h1 {
    font-size: clamp(36px, 4.6vw, 60px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -.03em;
    text-wrap: balance;
}

.pricing-head h1 .accent {
    color: var(--on-hero-accent);
}

.pricing-lead {
    max-width: 46ch;
    margin: 18px auto 0;

    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.55;
    color: color-mix(in srgb, var(--on-hero) 86%, transparent);
    text-wrap: balance;
}

/* the note under the cards: what the prices do not include */
.pricing-vat {
    max-width: 60ch;
    margin: 22px auto 0;

    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    text-wrap: balance;
    color: color-mix(in srgb, var(--on-hero) 80%, transparent);
}

/* ===== the page-view slider: one stop per plan, the picked one is the big dot ===== */

.pv {
    /* the big dot; the dots and labels line up with its centre at every stop */
    --thumb: 30px;
    --pv-line: color-mix(in srgb, #ffffff 55%, transparent);
    --pv-on: var(--color-green-ink);

    max-width: 860px;
    margin: clamp(32px, 5vh, 48px) auto 0;
    text-align: center;
}

:root[data-theme="dark"] .pv {
    --pv-line: color-mix(in srgb, #ffffff 16%, transparent);
    --pv-on: var(--color-green);
}

.pv-question {
    display: block;

    font-size: 16px;
    font-weight: 700;
    color: color-mix(in srgb, var(--on-hero) 86%, transparent);
}

.pv-value {
    margin-top: 4px;

    font-size: 17px;
    font-weight: 600;
    color: color-mix(in srgb, var(--on-hero) 86%, transparent);
}

.pv-value strong {
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--on-hero);
    font-variant-numeric: tabular-nums;
}

.pv-rail {
    position: relative;
    height: 44px;
    margin-top: 14px;
}

.pv-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;

    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;

    height: 4px;
    margin-top: -2px;
    padding: 0 calc(var(--thumb) / 2);
}

.pv-seg {
    position: relative;
    background: var(--pv-line);
}

/* a dot at the start of every piece of the line, and one at the end of the last */
.pv-seg::before,
.pv-seg:last-child::after {
    content: "";
    position: absolute;
    top: 50%;
    inset-inline-start: -6px;

    width: 12px;
    height: 12px;
    margin-top: -6px;

    border-radius: 50%;
    background: #ffffff;
}

.pv-seg:last-child::after {
    inset-inline-start: auto;
    inset-inline-end: -6px;
}

:root[data-theme="dark"] .pv-seg::before,
:root[data-theme="dark"] .pv-seg:last-child::after {
    background: color-mix(in srgb, #ffffff 40%, var(--color-bg));
}

.pv-seg.is-on,
.pv-seg.is-on::before {
    background: var(--pv-on);
}

.pv-range {
    position: relative;
    display: block;

    width: 100%;
    height: 44px;
    margin: 0;

    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.pv-range::-webkit-slider-runnable-track {
    height: 44px;
    background: transparent;
}

.pv-range::-moz-range-track {
    height: 44px;
    background: transparent;
}

.pv-range::-webkit-slider-thumb {
    box-sizing: border-box;
    width: var(--thumb);
    height: var(--thumb);
    margin-top: calc((44px - var(--thumb)) / 2);

    border: 8px solid var(--pv-on);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 46, 22, .3);
    -webkit-appearance: none;
    appearance: none;
}

.pv-range::-moz-range-thumb {
    box-sizing: border-box;
    width: var(--thumb);
    height: var(--thumb);

    border: 8px solid var(--pv-on);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 46, 22, .3);
}

.pv-range:focus {
    outline: none;
}

.pv-range:focus-visible::-webkit-slider-thumb {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.pv-range:focus-visible::-moz-range-thumb {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* the labels under the stops: each is centred under its dot */
.pv-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 calc(var(--thumb) / 2);
}

.pv-tick {
    display: flex;
    justify-content: center;
    width: 0;

    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    color: color-mix(in srgb, var(--on-hero) 72%, transparent);
    cursor: pointer;
}

.pv-tick.is-on {
    font-weight: 800;
    color: var(--on-hero);
}

/* ===== billing switch ===== */

.billing {
    display: inline-flex;
    gap: 4px;
    margin-top: 28px;
    padding: 4px;

    border-radius: 999px;
    background: color-mix(in srgb, #ffffff 34%, transparent);
    border: 1px solid color-mix(in srgb, #ffffff 45%, transparent);
}

:root[data-theme="dark"] .billing {
    background: color-mix(in srgb, #000000 28%, transparent);
    border-color: color-mix(in srgb, #ffffff 14%, transparent);
}

.billing button {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    height: 40px;
    padding: 0 20px;

    border-radius: 999px;

    /* one line in every language: CJK text has no spaces to break at, so it would wrap letter by letter */
    white-space: nowrap;
    min-width: 0;

    font-size: 15px;
    font-weight: 700;
    color: var(--on-hero);

    transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}

.billing button[aria-pressed="true"] {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.billing .save {
    padding: 2px 8px;

    border-radius: 999px;
    background: var(--color-green-soft);
    color: var(--color-green-dark);

    font-size: 12px;
    font-weight: 800;
}

:root[data-theme="dark"] .billing .save {
    color: var(--color-green);
}

/* ===== the three cards ===== */

.plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;

    max-width: 1180px;
    margin: 44px auto 0;
}

.plan {
    position: relative;

    display: flex;
    flex-direction: column;

    padding: 28px 26px 30px;

    border: 1px solid var(--color-border-soft);
    border-radius: 22px;
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
}

/* the recommended card: the plan picked on the slider (or Free, when the page views fit Free) */
.plan.is-picked {
    border: 2px solid var(--color-green-ink);
    box-shadow: var(--shadow-lg);
}

:root[data-theme="dark"] .plan.is-picked {
    border-color: var(--color-green);
}

.plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);

    padding: 5px 14px;

    border-radius: 999px;
    background: var(--color-green-ink);
    color: #ffffff;

    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
}

:root[data-theme="dark"] .plan-badge {
    background: var(--color-green);
    color: var(--color-green-ink);
}

.plan h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.plan-desc {
    min-height: 3.1em;
    margin-top: 6px;

    font-size: 14.5px;
    line-height: 1.5;
    color: var(--color-text-soft);
}

.plan-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;

    margin-top: 22px;
}

.plan-price .amount {
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.plan-price .per {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.plan-note {
    margin-top: 6px;
    font-size: 13.5px;
    color: var(--color-text-soft);
}

.plan-cta {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    margin-top: 22px;
    padding: 0 16px;

    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    color: var(--color-text);

    font-size: 15.5px;
    font-weight: 700;
    text-align: center;

    transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}

.plan-cta:hover {
    background: var(--color-bg-soft);
    border-color: color-mix(in srgb, var(--color-text-muted) 60%, var(--color-border));
    transform: translateY(-1px);
}

.plan.is-picked .plan-cta {
    border-color: transparent;
    background: var(--color-green);
    color: var(--color-green-ink);
    font-weight: 800;
    box-shadow: 0 1px 2px rgba(22, 163, 74, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.plan.is-picked .plan-cta:hover {
    background: #2bd46a;
    border-color: transparent;
    box-shadow: 0 14px 26px -14px rgba(22, 163, 74, .8), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* under the picked plan's button: the free trial (src/pages/pricing.html, the days come from TRIAL_DAYS) */
.plan-trial {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    margin-top: 10px;

    font-size: 13.5px;
    font-weight: 600;
    color: var(--green-text, #15803d);
}

:root[data-theme="dark"] .plan-trial {
    color: var(--color-green);
}

.plan-trial svg {
    flex: none;
    width: 16px;
    height: 16px;
}

/* the four limits: a word, then the number (no plural forms needed in any language) */
.plan-limits {
    display: grid;
    gap: 12px;

    margin-top: 26px;
    padding-top: 22px;

    border-top: 1px solid var(--color-border-soft);
}

.plan-limits div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;

    font-size: 15px;
    line-height: 1.4;
}

.plan-limits dt {
    color: var(--color-text-soft);
}

.plan-limits dd {
    font-weight: 800;
    text-align: end;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* ===== what every plan has ===== */

.includes {
    padding: 8px 0 8px;
}

.includes ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 40px;
}

.includes li {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-soft);
}

.includes svg {
    width: 22px;
    height: 22px;
    color: var(--color-green-dark);
}

:root[data-theme="dark"] .includes svg {
    color: var(--color-green);
}

/* ===== section titles ===== */

.addons h2,
.compare h2 {
    font-size: clamp(26px, 2.8vw, 36px);
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: center;
    text-wrap: balance;
}

.section-sub {
    max-width: 60ch;
    margin: 8px auto 0;

    font-size: 17px;
    text-align: center;
    color: var(--color-text-soft);
    text-wrap: balance;
}

/* ===== add-ons ===== */

.addons {
    padding: clamp(56px, 8vw, 96px) 0 0;
}

.addons-for {
    margin-top: 14px;

    font-size: 15px;
    text-align: center;
    color: var(--color-text-soft);
}

.addons-for strong {
    color: var(--color-text);
    font-weight: 800;
}

.addon-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;

    max-width: 1180px;
    margin: 32px auto 0;
}

.addon {
    display: flex;
    flex-direction: column;

    padding: 26px 26px 28px;

    border: 1px solid var(--color-border-soft);
    border-radius: 22px;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
}

.addon-icon,
.fact-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    border-radius: 12px;
    background: var(--color-green-soft);
    color: var(--color-green-dark);
}

:root[data-theme="dark"] .addon-icon,
:root[data-theme="dark"] .fact-icon {
    color: var(--color-green);
}

.addon-icon svg,
.fact-icon svg {
    width: 22px;
    height: 22px;
}

.addon h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;

    margin-top: 16px;

    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.soon {
    padding: 3px 9px;

    border-radius: 999px;
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);

    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--color-text-soft);
}

.addon-text {
    flex: 1;
    margin-top: 8px;

    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text-soft);
}

.addon .plan-price {
    margin-top: 20px;
}

/* the link under a priced add-on: what it does (Chat has a page of its own) */
.addon-more {
    margin-top: 14px;
}

.addon-more .more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-size: 14.5px;
    font-weight: 700;
    color: var(--green-text, #15803d);
}

:root[data-theme="dark"] .addon-more .more-link {
    color: var(--color-green);
}

.addon-more .more-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.addon-more .more-link svg {
    flex: none;
    width: 16px;
    height: 16px;
}

[dir="rtl"] .addon-more .more-link svg {
    transform: scaleX(-1);
}

.addon .plan-price .amount {
    font-size: 32px;
}

.addons-free {
    margin-top: 18px;

    font-size: 14px;
    text-align: center;
    color: var(--color-text-soft);
}

/* ===== what the four limits mean, then every plan side by side ===== */

.compare {
    padding: clamp(56px, 8vw, 96px) 0 clamp(56px, 8vw, 96px);
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;

    margin-top: 32px;
}

.facts li {
    padding: 22px 22px 24px;

    border: 1px solid var(--color-border-soft);
    border-radius: 20px;
    background: var(--color-bg-soft);
}

.facts h3 {
    margin-top: 14px;

    font-size: 17px;
    font-weight: 800;
}

.facts p {
    margin-top: 6px;

    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text-soft);
}

.compare .compare-title {
    margin-top: clamp(48px, 7vw, 80px);
}

.compare-scroll {
    position: relative; /* keeps visually hidden texts inside the scroll box */
    margin-top: 32px;
    overflow-x: auto;

    border: 1px solid var(--color-border-soft);
    border-radius: 20px;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
}

.compare-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.compare-table th,
.compare-table td {
    padding: 14px 20px;

    border-bottom: 1px solid var(--color-border-soft);

    font-size: 15px;
    text-align: end;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.compare-table thead th {
    padding-top: 18px;
    padding-bottom: 16px;

    font-size: 13px;
    font-weight: 800;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.compare-table th:first-child {
    text-align: start;
}

.compare-table tbody th {
    font-weight: 800;
    color: var(--color-text);
    background: var(--color-bg);
}

.compare-table td {
    font-weight: 600;
    color: var(--color-text-soft);
}

.compare-table td strong {
    font-weight: 800;
    color: var(--color-text);
}

.compare-table .per {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* room for the longest price, so the columns stay put when the billing switch changes them */
.compare-table th:last-child,
.compare-table td:last-child {
    min-width: 11.5em;
}

.compare-table tr:last-child th,
.compare-table tr:last-child td {
    border-bottom: 0;
}

/* the plan picked on the slider gets a faint tint across its row */
.compare-table tr.is-picked th,
.compare-table tr.is-picked td {
    background: color-mix(in srgb, var(--color-green) 9%, var(--color-bg));
}

/* ===== responsive ===== */

@media (max-width: 1100px) {

    .facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {

    .plans,
    .addon-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 520px;
        gap: 28px;
    }

    /* on one column the card that follows the slider comes first, right under it */
    .plans #PLAN_PICK {
        order: -1;
    }

    .plan-desc {
        min-height: 0;
    }

    .compare-table th:first-child {
        position: sticky;
        inset-inline-start: 0;
        z-index: 1;
    }
}

@media (max-width: 640px) {

    .pv {
        --thumb: 28px;
    }

    /* every third label (10K, 100K, 1M, 10M), so they never touch on a narrow screen; the last one always stays
       (the big number says the rest) */
    .pv-tick:not(:nth-child(3n+1)):not(:last-child) {
        visibility: hidden;
    }

    .billing button {
        padding: 0 14px;
    }

    .facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .compare-table {
        min-width: 600px;
    }

    .compare-table th,
    .compare-table td {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* ===================================================================
   Questions before buying: one answer open at a time (<details name>)
   =================================================================== */

.faq {
    padding: 0 0 clamp(64px, 9vw, 112px);
}

.faq h2 {
    font-size: clamp(26px, 2.8vw, 36px);
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: center;
    text-wrap: balance;
}

.faq-list {
    display: grid;
    gap: 12px;
    max-width: 820px;
    margin: 32px auto 0;
}

.faq-item {
    border: 1px solid var(--color-border-soft);
    border-radius: 18px;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
    transition: border-color .18s var(--ease);
}

:root[data-theme="dark"] .faq-item {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
}

.faq-item[open] {
    border-color: color-mix(in srgb, var(--color-green) 45%, var(--color-border));
}

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 19px 22px;

    border-radius: 18px;
    list-style: none;
    cursor: pointer;

    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.faq-q::-webkit-details-marker {
    display: none;
}

.faq-q:focus-visible {
    outline-offset: -2px;
}

.faq-chevron {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--color-text-quiet);
    transition: transform .2s var(--ease), color .2s var(--ease);
}

.faq-q:hover .faq-chevron {
    color: var(--color-text);
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: #15803d;
}

:root[data-theme="dark"] .faq-item[open] .faq-chevron {
    color: var(--color-green);
}

.faq-a {
    padding: 0 22px 22px;

    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text-soft);
}
