/* =====================================================================
   Pricing section (Aug 2026 price book) + 18-month offer bar
   Loaded after styles.css, homepage only. Bump ?v= in index.html
   whenever this file changes (*.css is served with a 1-year immutable cache).
   ===================================================================== */

:root {
    --promo-bar-h: 38px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- 18-month offer bar: remove with the offer after Oct 31, 2026 ---------- */
.promo-bar {
    height: var(--promo-bar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: var(--green);
}

.promo-bar-link {
    max-width: 100%;
    overflow: hidden;
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.promo-bar-link strong {
    font-weight: 700;
}

.promo-bar-cta {
    margin-left: 0.35rem;
    font-weight: 700;
}

.promo-bar-cta-text {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.promo-bar-link:hover .promo-bar-cta-text,
.promo-bar-link:focus-visible .promo-bar-cta-text {
    text-decoration-thickness: 2px;
}

.promo-bar-link:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.promo-bar-narrow {
    display: none;
}

/* Fixed-header offset for direct links such as /#pricing
   (in-page anchor clicks use script.js's own offset). */
html {
    scroll-padding-top: 24px;
}

.has-promo {
    scroll-padding-top: calc(24px + var(--promo-bar-h));
}

.has-promo .hero {
    padding-top: calc(150px + var(--promo-bar-h));
}

/* ---------- Term selector ---------- */
.term-select {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 460px;
    margin: 0 auto;
    padding: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
}

.term-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.8rem 1.1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.term-option:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.term-option:focus-visible {
    outline: 2px solid var(--light-green);
    outline-offset: 2px;
}

.term-option.is-active {
    color: var(--white);
    background: rgba(74, 124, 89, 0.2);
    border-color: var(--green);
}

.term-label-note {
    margin-left: 0.35rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.term-badge {
    flex-shrink: 0;
    padding: 0.2rem 0.65rem;
    background: rgba(93, 153, 112, 0.18);
    border-radius: 999px;
    color: #a6dbb5;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.term-option.is-active .term-badge {
    background: var(--green);
    color: var(--white);
}

.term-note {
    max-width: 640px;
    margin: 1rem auto 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
}

.term-note strong {
    color: var(--white);
}

/* Term visibility: hide anything whose data-show list lacks the active term.
   Hide-only on purpose -- never use display: revert here (it breaks the grids). */
.pricing[data-term="monthly"] [data-show]:not([data-show~="monthly"]),
.pricing[data-term="annual"] [data-show]:not([data-show~="annual"]),
.pricing[data-term="intro"] [data-show]:not([data-show~="intro"]) {
    display: none !important;
}

/* ---------- Groups and grids ---------- */
.pricing-group {
    margin-top: 4rem;
}

.pricing-group-title {
    margin-bottom: 0.5rem;
    color: var(--light-green);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}

.pricing-group-lead {
    max-width: 640px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.pricing-group .pricing-grid {
    margin-top: 2.25rem;
}

.pricing-grid--three {
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    max-width: 1100px;
}

.pricing-grid:focus {
    outline: none;
}

.pricing-card--compact {
    padding: 2rem 1.5rem;
}

.pricing-card--compact .pricing-plan-name {
    font-size: 1.3rem;
}

.pricing-card--compact .pricing-card-header {
    margin-bottom: 1.25rem;
}

/* ---------- Price blocks ---------- */
.plan-price {
    margin-bottom: 1.75rem;
}

.plan-price-main {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.plan-amount {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.pricing-card--compact .plan-amount {
    font-size: 2.1rem;
}

.plan-per {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

.plan-price-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.plan-price-sub s {
    margin-right: 0.3rem;
    color: #e59a9a;
    text-decoration-thickness: 1.5px;
}

.plan-price-sub strong {
    color: var(--white);
    font-weight: 700;
}

.plan-save {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.25rem 0.7rem;
    background: rgba(93, 153, 112, 0.18);
    border-radius: 6px;
    color: #a6dbb5;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Add-on cards have no button: line their prices up across the row. */
.pricing-card--addon .pricing-plan-desc {
    min-height: 4.3rem;
}

.pricing-card--addon .plan-price {
    margin-bottom: 0;
}

/* ---------- Bundles in the monthly view ---------- */
.bundle-monthly-note {
    max-width: 640px;
    margin: 2rem auto 0;
    padding: 1.5rem;
    background: var(--panel);
    border: 1px dashed var(--panel-border);
    border-radius: 14px;
    color: var(--text-muted);
    text-align: center;
}

.bundle-monthly-note p {
    margin-bottom: 0.5rem;
}

.pricing-inline-link {
    padding: 0;
    background: none;
    border: 0;
    color: var(--light-green);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.pricing-inline-link:hover {
    color: var(--white);
}

.pricing-inline-link:focus-visible {
    outline: 2px solid var(--light-green);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---------- Compare table ---------- */
.compare-wrap {
    max-width: 800px;
    margin: 2.25rem auto 0;
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
}

.compare-table thead th:not(:first-child),
.compare-table td {
    width: 28%;
    text-align: center;
}

.compare-table tbody th {
    color: var(--white);
    font-weight: 500;
    text-align: left;
}

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

.compare-table .is-featured-col {
    background: rgba(74, 124, 89, 0.12);
}

.compare-yes svg {
    width: 20px;
    height: 20px;
    color: var(--light-green);
    vertical-align: middle;
}

.compare-no {
    color: rgba(255, 255, 255, 0.35);
}

.compare-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.compare-text--good {
    color: #a6dbb5;
}

#pricing .pricing-footnote {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- FAQ (reuses .kb-faq card styles) ---------- */
.pricing-faq {
    max-width: 800px;
    margin: 2.25rem auto 0;
}

.pricing-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pricing-faq summary::after {
    content: "+";
    flex-shrink: 0;
    color: var(--light-green);
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1;
}

.pricing-faq details[open] summary::after {
    content: "\2212";
}

.pricing-faq summary:focus-visible {
    outline: 2px solid var(--light-green);
    outline-offset: 4px;
    border-radius: 4px;
}

.pricing-faq-more {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.pricing-faq-more a {
    color: var(--light-green);
    font-weight: 600;
}

.pricing-faq-more a:hover {
    color: var(--white);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 46px;
    }

    .has-promo {
        scroll-padding-top: calc(46px + var(--promo-bar-h));
    }

    .has-promo .hero {
        padding-top: calc(110px + var(--promo-bar-h));
    }

    .promo-bar-wide {
        display: none;
    }

    .promo-bar-narrow {
        display: inline;
    }

    .pricing-group {
        margin-top: 3rem;
    }

    .pricing-grid,
    .pricing-grid--three {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .plan-amount {
        font-size: 2.35rem;
    }

    .pricing-card--addon .pricing-plan-desc {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    :root {
        --promo-bar-h: 34px;
    }

    html {
        scroll-padding-top: 50px;
    }

    .has-promo {
        scroll-padding-top: calc(50px + var(--promo-bar-h));
    }

    .has-promo .hero {
        padding-top: calc(100px + var(--promo-bar-h));
    }

    .promo-bar {
        padding: 0 12px;
    }

    .promo-bar-link {
        font-size: 0.8rem;
    }

    .term-option {
        padding: 0.75rem 0.9rem;
        font-size: 0.95rem;
    }

    .term-label-note {
        display: block;
        margin-left: 0;
        font-size: 0.78rem;
    }

    .plan-amount {
        font-size: 2.1rem;
    }

    .pricing-card--compact .plan-amount {
        font-size: 1.9rem;
    }

    .compare-table {
        font-size: 0.85rem;
    }

    .compare-table th,
    .compare-table td {
        padding: 0.75rem 0.6rem;
    }

    .compare-table thead th {
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .promo-bar-cta-text {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .term-option {
        transition: none;
    }
}
