/* ─────────────────────────────────────────────────────────────────────────────
   pricing.next.css — the pricing page in the new look (?ui=next).
   Loaded after style.next.css: tokens and the public header come from there.

   The job here is comparison. Left-aligned under a plain heading, prices in
   tabular figures, one quiet emphasis for the popular plan, and nothing that
   floats, spins or glows.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    /* pricing.css gives the page its own palette names; point them at the tokens. */
    --dark: var(--color-fg-default);
    --light: var(--color-bg-muted);
    --primary: var(--color-money);
    --secondary: var(--color-fg-muted);
    /* Width of the content column, so every block below lines up on the same edge. */
    --pricing-col: calc(100% - 2 * var(--page-gutter));
    --pricing-col-max: calc(var(--page-max) - 2 * var(--page-gutter));
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-bg-page);
    color: var(--color-fg-default);
    overflow-x: hidden;
}

/* ── Heading ───────────────────────────────────────────────────────────────── */
.pricing-hero {
    width: var(--pricing-col);
    max-width: var(--pricing-col-max);
    margin: 0 auto;
    padding: calc(var(--nav-height) + var(--space-12)) 0 var(--space-6);
}

.pricing-hero h1 {
    margin: 0 0 var(--space-2);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--color-fg-default);
}

.pricing-hero p {
    margin: 0;
    max-width: 36rem;
    font-size: 1.125rem;
    color: var(--color-fg-muted);
}

/* ── Free-trial note ───────────────────────────────────────────────────────── */
.trial-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: var(--pricing-col);
    max-width: var(--pricing-col-max);
    margin: 0 auto var(--space-12);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.trial-icon {
    display: flex;
    flex-shrink: 0;
    width: auto;
    height: auto;
    background: none;
    color: var(--color-fg-default);
}

.trial-smiley { display: none; }
.trial-icon-line { display: block; width: 1.25rem; height: 1.25rem; }

.trial-copy { flex: 1 1 auto; min-width: 0; }

.trial-title {
    margin: 0;
    font-size: var(--text-body);
    font-weight: 600;
    color: var(--color-fg-default);
}

.trial-text {
    margin: 0.125rem 0 0;
    font-size: var(--text-ui);
    color: var(--color-fg-muted);
}

/* ── Ladder headings ───────────────────────────────────────────────────────── */
.ladder-head {
    width: var(--pricing-col);
    max-width: var(--pricing-col-max);
    margin: 0 auto var(--space-6);
    padding: 0;
    text-align: left;
}

.ladder-head--second { margin-top: var(--space-16); }

.ladder-head h2 {
    margin: 0 0 var(--space-2);
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
    color: var(--color-fg-default);
}

.ladder-head p {
    margin: 0;
    max-width: 40rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-fg-muted);
}

/* ── Plan cards ────────────────────────────────────────────────────────────── */
.pricing-grid {
    display: grid;
    /* Explicit columns, not auto-fit. auto-fit counts columns from the track's MAXIMUM, so in
       this narrower column a four-plan ladder fell to three plus one (pricing.css warns about
       exactly this). Four equal columns on a wide screen also mean a two-plan ladder lines up
       under the first two plans of the ladder above it instead of floating. */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: start;
    align-items: stretch;
    gap: var(--space-4);
    width: var(--pricing-col);
    max-width: var(--pricing-col-max);
    margin: 0 auto;
    padding: 0 0 var(--space-4);
}

/* Two-by-two between tablet and desktop, never three plus one. */
@media (max-width: 1150px) and (min-width: 769px) {
    .pricing-grid { grid-template-columns: repeat(2, minmax(0, 280px)); }
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--space-6);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* The popular plan: a second hairline in ink, drawn as a ring so the card does not grow. */
.pricing-card.popular {
    border-color: var(--color-fg-default);
    box-shadow: 0 0 0 1px var(--color-fg-default);
}

.popular-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    padding: 0.125rem var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--color-bg-inverse);
    color: var(--color-fg-inverse);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.plan-name {
    margin-bottom: var(--space-3);
    font-size: var(--text-h3);
    font-weight: 600;
    color: var(--color-fg-default);
}

.plan-price {
    margin-bottom: var(--space-1);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-fg-default);
    font-variant-numeric: tabular-nums;
}

.plan-price span {
    margin-left: 0.125rem;
    font-size: var(--text-ui);
    font-weight: 400;
    letter-spacing: 0;
    color: var(--color-fg-muted);
}

.plan-desc {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-ui);
    font-weight: 400;
    color: var(--color-fg-muted);
}

.plan-features {
    flex-grow: 1;
    margin: 0 0 var(--space-6);
    padding: 0;
    list-style: none;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-ui);
    line-height: 1.4;
    color: var(--color-fg-default);
}

.plan-features li svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    color: var(--color-fg-default);
}

.btn-subscribe {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-lg);
    margin-top: auto;
    padding: 0 var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-ui);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.btn-subscribe:active { transform: scale(0.97); }

.pricing-card .btn-outline {
    background: var(--color-bg-surface);
    color: var(--color-fg-default);
    border: 1px solid var(--color-border-strong);
    box-shadow: var(--shadow-xs);
}

.pricing-card .btn-solid {
    background: var(--color-action);
    color: var(--color-action-fg);
    border: 1px solid var(--color-action);
}

@media (hover: hover) and (pointer: fine) {
    .pricing-card .btn-outline:hover { background: var(--color-bg-muted); border-color: var(--color-border-input); color: var(--color-fg-default); text-decoration: none; }
    .pricing-card .btn-solid:hover { background: var(--color-action-hover); border-color: var(--color-action-hover); color: var(--color-action-fg); text-decoration: none; }
}

.plans-empty {
    grid-column: 1 / -1;
    padding: var(--space-8) 0;
    color: var(--color-fg-muted);
}

/* ── WhatsApp hand-off dialog ──────────────────────────────────────────────── */
.whatsapp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    padding: var(--space-4);
    background: var(--color-bg-overlay);
}

.whatsapp-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-modal-content {
    position: relative;
    width: 100%;
    max-width: 28rem;
    padding: var(--space-8) var(--space-6) var(--space-6);
    background: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
    text-align: center;
    animation: wa-enter var(--duration-base) var(--ease-out);
}

@keyframes wa-enter {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: none; }
}

.whatsapp-modal-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--control-md);
    height: var(--control-md);
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    color: var(--color-fg-muted);
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .whatsapp-modal-close:hover { background: var(--color-bg-muted); color: var(--color-fg-default); }
}

.whatsapp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto var(--space-4);
    border-radius: var(--radius-full);
    background: var(--color-success-bg);
    box-shadow: none;
}

.whatsapp-icon svg { width: 2rem; height: 2rem; }

.wa-title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-h2);
    font-weight: 600;
    color: var(--color-fg-default);
}

.wa-lede {
    margin: 0 0 var(--space-6);
    font-size: var(--text-ui);
    color: var(--color-fg-muted);
}

.whatsapp-number-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.whatsapp-number {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-fg-default);
    font-variant-numeric: tabular-nums;
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--control-md);
    min-height: var(--control-md);
    padding: 0;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    color: var(--color-fg-default);
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .copy-btn:hover { background: var(--color-bg-muted); }
    .copy-btn:hover svg { stroke: currentColor; }
}

/* WhatsApp's own dark green: a third-party brand action, so a brand colour rather than a
   token. The bright brand green (#25D366) fails contrast behind white text. */
.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--control-lg);
    margin-top: 0;
    padding: 0 var(--space-6);
    border-radius: var(--radius-md);
    background: #075e54;
    color: #ffffff;
    box-shadow: none;
    font-size: var(--text-body);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--duration-fast) var(--ease-out);
}

.whatsapp-btn svg { width: 1.25rem; height: 1.25rem; }

@media (hover: hover) and (pointer: fine) {
    .whatsapp-btn:hover { background: #054d44; color: #ffffff; text-decoration: none; }
}

.wa-note {
    margin: var(--space-4) 0 0;
    font-size: var(--text-small);
    color: var(--color-fg-muted);
}

/* ── Phones ────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pricing-hero { padding-top: calc(var(--nav-height) + var(--space-8)); }
    .pricing-hero p { font-size: var(--text-body); }
    .trial-banner { align-items: flex-start; margin-bottom: var(--space-8); }
    .ladder-head--second { margin-top: var(--space-12); }
    .pricing-grid { grid-template-columns: 1fr; }
    .plan-price { font-size: 1.75rem; }
}

@media (max-width: 600px) {
    .whatsapp-modal-content { padding: var(--space-8) var(--space-4) var(--space-4); }
    .whatsapp-number { font-size: 1.125rem; }
}
