/* Pricing page (_includes/pricing-shell.html). Uses the colour tokens and
   shared components in modern-base.css (.container, .eyebrow, .lead,
   .check-list, .app-store-badge), so the dark colour scheme comes from the
   tokens; this file adds no colours of its own. Panels match the support and
   testimonials cards. */

.pricing-hero {
    padding: 60px 0 24px;
}

.pricing-plans {
    padding: 10px 0 48px;
}

.pricing-plans h2,
.pricing-customers h2,
.pricing-faq h2 {
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
}

.pricing-plans-intro {
    margin: 0 0 20px;
    max-width: 60ch;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.plan-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-panel);
}

/* Lifetime: the emphasised card. A heavier accent border and the badge carry
   the emphasis; the badge text keeps it clear without colour. */
.plan-card--featured {
    border: 2px solid var(--color-accent);
    padding: 23px;
    box-shadow: var(--shadow-feature);
}

.plan-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.plan-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.plan-badge {
    margin: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-accent-subtle);
    color: var(--color-accent-subtle-text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Weekly's trial pill: the same shape, outlined instead of filled, so the
   Lifetime badge stays the stronger of the two. */
.plan-badge--secondary {
    padding: 2px 9px;
    border: 1px solid var(--color-border-strong);
    background: transparent;
    color: var(--color-text-muted);
}

/* The price line, then (Weekly) the trial pill under it. */
.plan-price-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
}

.plan-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: 0;
}

.plan-amount {
    /* 3.4vw keeps "R$ 799,90" inside a card's padding in four columns
       down to 1001px. */
    font-size: clamp(2rem, 3.4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.plan-period {
    color: var(--color-text-muted);
    font-weight: 600;
}

.plan-body,
.plan-note {
    margin: 0 0 8px;
}

/* The note and the App Store link sit at the bottom of the card, so the
   buttons line up across a row whatever the length of the text above. */
.plan-card-foot {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
    padding-top: 8px;
}

.plan-card-foot .plan-note {
    margin: 0;
}

.plan-cta {
    width: 100%;
    text-align: center;
}

.plan-note {
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Shared rows: each card spans four rows of the grid (heading, price area,
   body, footer) and takes them as a subgrid, so within a row of cards the
   headings, prices, body text and buttons each start at the same height,
   whatever wraps. A row is as tall as its tallest part, so a card without a
   pill keeps a little space under its price. Browsers without subgrid keep
   the stacked flex layout above, where only the buttons line up. */
@supports (grid-template-rows: subgrid) {
    .plan-card {
        display: grid;
        grid-row: span 4;
        grid-template-rows: subgrid;
        row-gap: 0;
        align-content: start;
    }

    /* The heading stays at the top of its row when another card's heading
       row is taller (a wrapped badge), rather than centring in it. */
    .plan-card-head {
        align-self: start;
    }

    .plan-card-foot {
        align-self: end;
    }
}

/* Storefront line and selector, directly above the cards, so the currency
   is read before the prices. The billing note sits under the cards. */
.storefront-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    margin-bottom: 16px;
    padding: 12px 20px;
    background: var(--color-sunken);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.storefront-current {
    margin: 0;
    font-weight: 600;
}

.storefront-note {
    margin: 16px 0 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.storefront-control[hidden],
.storefront-current[hidden] {
    display: none;
}

.storefront-control {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.storefront-control label {
    font-weight: 600;
}

.storefront-select {
    min-height: 44px;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-input-border);
    border-radius: 10px;
    background: var(--color-input-bg);
    color: var(--color-text);
    font: inherit;
    font-weight: 600;
}

.storefront-select:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Trial and what's included; customer notes. */
.pricing-details {
    padding: 0 0 48px;
}

.pricing-details-grid,
.pricing-customers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pricing-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-panel);
}

.pricing-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.pricing-panel h3 {
    margin-top: 18px;
}

.pricing-customers .pricing-panel h3 {
    margin-top: 0;
    font-size: 1.25rem;
}

.pricing-panel p {
    margin: 0 0 12px;
}

.pricing-panel p:last-child {
    margin-bottom: 0;
}

.pricing-link {
    font-weight: 700;
    border-bottom: 2px solid var(--color-link-underline);
}

.pricing-link:hover {
    border-bottom-color: var(--color-link-underline-hover);
}

.pricing-customers {
    padding: 0 0 48px;
}

/* FAQ: always visible, so it matches its FAQPage data. */
.pricing-faq {
    padding: 0 0 48px;
}

.pricing-faq-inner {
    max-width: 760px;
}

.faq-item {
    padding: 18px 0;
    border-top: 1px solid var(--color-border);
}

.faq-item h3 {
    margin-bottom: 6px;
}

.faq-item p {
    margin: 0;
}

/* Closing call to action, as on the testimonials page. The badge has at least
   16px of space above and below (docs/app-store-badge.md). */
.pricing-cta {
    padding: 0 0 70px;
}

.pricing-cta-inner {
    background: var(--color-callout-bg);
    border: 1px solid var(--color-callout-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-panel);
}

.pricing-cta-inner h2 {
    margin-bottom: 8px;
}

.pricing-cta-inner p {
    margin: 0 0 16px;
}

.pricing-cta-inner .pricing-compare {
    margin: 16px 0 0;
}

/* Four cards in a row on wide screens, two by two in between, one column on
   phones (below). */
@media (max-width: 1000px) {
    .plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .pricing-details-grid,
    .pricing-customers-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .pricing-hero {
        padding-top: 34px;
    }

    .plan-grid {
        grid-template-columns: 1fr;
    }

    .plan-card,
    .pricing-panel {
        padding: 20px;
    }

    .plan-card--featured {
        padding: 19px;
    }
}
