/* ===========================================================================
   Plan cards, allowance lists and the checkout stepper.

   Plain CSS on purpose: the committed tailwind.css is a stale build without
   arbitrary-value utilities, so anything expressed as h-[calc(...)] or
   max-md:* silently does nothing. See static/css/agent_cards.css for the same
   reasoning.
   =========================================================================== */

.plan-card {
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}
.plan-card:hover { border-color: var(--border-strong); }

/* The recommended tier is lifted rather than recoloured, so the accent stays
   meaningful for actions instead of decoration. */
.plan-card-featured {
    border-color: rgb(var(--primary-rgb) / .5);
    box-shadow: var(--shadow-lg);
}
@media (min-width: 1280px) {
    .plan-card-featured { transform: none; }
    .plan-card-featured:hover { transform: none; }
}

.plan-kinds { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-bottom: 1.75rem; }
.plan-kinds img { width: 15px; height: 15px; }

/* Phones: the plans start high on the page, the recommended one first, and each
   card is short enough to compare. What you own is on the home page. */
@media (max-width: 767.98px) {
    .plan-intro { margin-bottom: 1rem !important; }
    .plan-intro .eyebrow { display: none; }
    .plan-have { display: none !important; }
    .plan-kinds { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1.25rem; padding-inline: 1.25rem; margin-bottom: 1rem; }
    .plan-kinds::-webkit-scrollbar { display: none; }
    .plan-kinds .btn { flex: none; }
    .plan-card { padding: 18px; }
    .plan-card-featured { order: -1; }
}

/* ── Allowance block ────────────────────────────────────────────────────── */

.plan-allow {
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: .85rem .95rem;
    background: var(--sunken);
}
.plan-allow-h {
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--color-text-muted);
    list-style: none;
    cursor: pointer;
}
.plan-allow-h::-webkit-details-marker { display: none; }
.plan-allow-h::after { content: "▾"; margin-inline-start: 6px; opacity: .7; }
.plan-allow[open] > .plan-allow-h { margin-bottom: .5rem; }
.plan-allow[open] > .plan-allow-h::after { content: "▴"; }
@media (min-width: 768px) {
    /* Room to read every card: _body.html opens them all up here. */
    .plan-allow-h { cursor: default; pointer-events: none; }
    .plan-allow-h::after,
    .plan-allow[open] > .plan-allow-h::after { content: none; }
}
.plan-allow ul {
    display: grid;
    gap: .3rem;
    margin: 0 0 .55rem;
    padding: 0;
    list-style: none;
}
.plan-allow li {
    font-size: 11.5px;
    color: var(--color-text-main);
    display: flex;
    align-items: baseline;
    gap: .4rem;
}
/* Leading marker instead of list-style so RTL alignment stays correct. */
.plan-allow li::before {
    content: '';
    flex: 0 0 auto;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgb(var(--primary-rgb) / .75);
    transform: translateY(-2px);
}
.plan-allow li b { font-variant-numeric: tabular-nums; }
/* The flagship video model (pricing.FEATURED_VIDEO): the line people look for. */
.plan-allow li.plan-allow-star {
    margin: .1rem -.45rem;
    padding: .4rem .45rem;
    border-radius: 8px;
    background: rgb(var(--primary-rgb) / .08);
    line-height: 1.7;
}
.plan-allow li.plan-allow-star::before { background: rgb(var(--primary-rgb)); }
.plan-allow li.plan-allow-star small {
    display: block;
    font-size: 10px;
    color: var(--color-text-muted);
}
.plan-allow-f {
    font-size: 10px;
    line-height: 1.7;
    color: var(--color-text-muted);
    opacity: .8;
    padding-top: .5rem;
    border-top: 1px solid var(--border-subtle);
}

/* ── Checkout stepper ───────────────────────────────────────────────────── */

.ck-steps {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 2.25rem;
}
.ck-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 11.5px;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.ck-step i {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    font-size: 11px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}
.ck-step.is-on { color: var(--color-text-main); }
.ck-step.is-on i {
    background: rgb(var(--primary-rgb));
    border-color: rgb(var(--primary-rgb));
    color: var(--color-text-on-primary);
    font-weight: 700;
}
.ck-step.is-done i {
    border-color: rgb(var(--primary-rgb) / .5);
    color: rgb(var(--primary-ink-rgb));
}
.ck-bar {
    flex: 1 1 auto;
    height: 1px;
    min-width: .75rem;
    background: var(--border-strong);
}

/* Hide the step labels on phones; the numbers alone carry the progress. */
@media (max-width: 639px) {
    .ck-step span { display: none; }
    .ck-steps { gap: .35rem; }
}

/* ── Add-on option rows ─────────────────────────────────────────────────── */

.ck-opt {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .95rem 1.05rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.ck-opt:hover { border-color: rgb(var(--primary-rgb) / .4); }
.ck-opt input { margin-top: .2rem; accent-color: rgb(var(--primary-rgb)); }
/* :has() lets the whole row react to its radio without any JS. */
.ck-opt:has(input:checked) {
    border-color: rgb(var(--primary-rgb) / .6);
    background: rgb(var(--primary-rgb) / .07);
}
.ck-opt-t { font-size: 12.5px; color: var(--color-text-main); font-weight: 700; }
.ck-opt-d { font-size: 10.5px; color: var(--color-text-muted); line-height: 1.7; margin-top: .15rem; }
.ck-opt-p { margin-inline-start: auto; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* "recommended" badge next to an option title (agent creation wizard). */
.ck-opt-tag {
    display: inline-block;
    margin-inline-start: .4rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    background: rgb(var(--primary-rgb) / .15);
    color: rgb(var(--primary-ink-rgb));
}

/* ── Review totals ──────────────────────────────────────────────────────── */

.ck-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
}
/* The optional storage row stays out until storage is picked. */
.ck-line[hidden] { display: none; }
.ck-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .9rem;
    font-size: 15px;
    font-weight: 800;
}
.ck-total b { font-variant-numeric: tabular-nums; }

/* ── Storage term tabs (storefront) ─────────────────────────────────────── */

.term-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
}
.term-tab {
    padding: .5rem 1.1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text-muted);
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.term-tab:hover { border-color: rgb(var(--primary-rgb) / .4); }
/* Tailwind's .grid would otherwise beat the [hidden] attribute. */
[data-term-panel][hidden] { display: none !important; }
.term-tab[aria-selected="true"] {
    border-color: rgb(var(--primary-rgb) / .6);
    background: rgb(var(--primary-rgb) / .1);
    color: var(--color-text-main);
}

/* ── Storage size + term picker (checkout) ──────────────────────────────── */

/* Tailwind's preflight [hidden] rule is weaker than the display below. */
.ck-more[hidden] { display: none; }
.ck-more {
    display: grid;
    gap: 1.1rem;
    margin-top: 1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-subtle);
    animation: ck-reveal .18s ease-out;
}
@keyframes ck-reveal { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .ck-more { animation: none; } }

.ck-field { display: grid; gap: .5rem; }
.ck-field-l { font-size: 11px; font-weight: 700; color: var(--color-text-muted); }

.ck-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
@media (max-width: 379px) { .ck-chips-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ck-chip {
    display: grid;
    justify-items: center;
    gap: .15rem;
    min-height: 44px;
    padding: .55rem .3rem;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.ck-chip b { font-size: 12.5px; color: var(--color-text-main); }
.ck-chip small { font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ck-chip:hover:not(:disabled) { border-color: rgb(var(--primary-rgb) / .4); }
.ck-chip:focus-visible { outline: 2px solid rgb(var(--primary-rgb) / .6); outline-offset: 2px; }
.ck-chip:disabled { opacity: .4; cursor: not-allowed; }
.ck-chip[aria-checked="true"] {
    border-color: rgb(var(--primary-rgb) / .7);
    background: rgb(var(--primary-rgb) / .1);
    color: var(--color-text-main);
}
.ck-chip[aria-checked="true"] small { color: rgb(var(--primary-ink-rgb)); }


/* ── One-page checkout: optional storage add-on + pay row ───────────────── */

.ck-addon { padding: 1rem 1.1rem; }
@media (min-width: 640px) { .ck-addon { padding: 1.1rem 1.5rem; } }
.ck-addon-head { display: flex; align-items: flex-start; gap: .8rem; cursor: pointer; }
.ck-addon-head input { margin-top: .25rem; width: 1rem; height: 1rem; flex: 0 0 auto; accent-color: rgb(var(--primary-rgb)); }
.ck-addon-head .ck-opt-t { font-size: 13px; }
.ck-addon-head .ck-opt-d { font-size: 11.5px; }

.ck-pay { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }

/* Gateway picker: two logo cards and ONE pay button below them. */
.ck-gateways { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.ck-gateways legend { padding: 0; font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-bottom: .55rem; }
.ck-gateway-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: .6rem; }
.ck-gateway { position: relative; display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem;
    border-radius: 14px; border: 1.5px solid var(--border-subtle); background: var(--color-surface);
    cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.ck-gateway:hover { border-color: var(--border-strong); }
.ck-gateway.is-on { border-color: rgb(var(--primary-rgb)); background: rgb(var(--primary-rgb) / .07);
    box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / .12); }
.ck-gateway:has(.ck-gateway-input:focus-visible) { outline: 2px solid rgb(var(--primary-rgb)); outline-offset: 2px; }
.ck-gateway-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ck-gateway-logo { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 5px;
    height: 48px; min-width: 108px; padding: 0 12px; border-radius: 10px; background: #fff; }
.ck-gateway-logo img { display: block; width: auto; }
.ck-zibal-logo { max-height: 27px; max-width: 82px; }
.ck-zarinpal-logo { max-height: 27px; max-width: 120px; }
.ck-gateway-name { display: flex; flex-direction: column; line-height: 1.6; font-size: 13px;
    font-weight: 700; color: var(--color-text-main); }
.ck-gateway-name small { font-size: 10.5px; font-weight: 500; color: rgb(var(--primary-rgb)); }
.ck-gateway-dot { position: relative; flex: 0 0 auto; margin-inline-start: auto; width: 18px; height: 18px;
    border-radius: 50%; border: 1.5px solid var(--border-strong); }
.ck-gateway.is-on .ck-gateway-dot { border-color: rgb(var(--primary-rgb)); }
.ck-gateway.is-on .ck-gateway-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%;
    background: rgb(var(--primary-rgb)); }

.ck-pay-btn { padding: .85rem 1.75rem; font-size: 14.5px; font-weight: 800; }
@media (max-width: 479px) {
    /* Phones: the pay button takes the row, "back" sits under it. */
    .ck-pay { flex-direction: column-reverse; align-items: stretch; }
    .ck-pay .btn { width: 100%; justify-content: center; }
}

/* ── "Turn off your VPN" box on the payment pages (agents/_vpn_warning.html) ── */
.vpn-box {
    --vpn-rgb: 251 191 36;
    margin-bottom: 1rem; padding: 1rem 1.1rem; border-radius: 14px;
    background: rgb(var(--vpn-rgb) / .08);
    border: 1px solid rgb(var(--vpn-rgb) / .35);
    scroll-margin-top: 6rem;
}
:root[data-theme="light"] .vpn-box { --vpn-rgb: 217 119 6; }
.vpn-box.is-asking { border-color: rgb(var(--vpn-rgb) / .8); box-shadow: 0 0 0 3px rgb(var(--vpn-rgb) / .15); }
.vpn-box.is-ok { --vpn-rgb: 52 211 153; }
:root[data-theme="light"] .vpn-box.is-ok { --vpn-rgb: 16 150 104; }
.vpn-head { display: flex; align-items: center; gap: .5rem; font-size: 14px; color: rgb(var(--vpn-rgb)); }
:root[data-theme="light"] .vpn-head { color: #92400E; }
:root[data-theme="light"] .vpn-box.is-ok .vpn-head { color: #047857; }
.vpn-icon { width: 18px; height: 18px; flex-shrink: 0; }
.vpn-text, .vpn-ask { margin-top: .5rem; font-size: 12.5px; line-height: 1.9; color: var(--color-text-main); }
.vpn-ask { font-weight: 700; }
.vpn-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.vpn-actions .btn { padding: .6rem 1rem; font-size: 13px; }
.vpn-status { margin-top: .5rem; font-size: 12px; color: var(--color-text-muted); }
.vpn-status:empty { display: none; }
@media (max-width: 479px) {
    .vpn-actions { flex-direction: column-reverse; }
    .vpn-actions .btn { width: 100%; justify-content: center; }
}

/* Monthly subscription vs credit (plans/_plan_switch.html) */
.plan-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 520px; margin: 0 auto 1.75rem;
    padding: 5px; border-radius: 16px; background: var(--surface-fill);
    border: 1px solid var(--border-subtle); }
.plan-switch-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .7rem .75rem;
    border-radius: 12px; text-align: center; color: var(--color-text-muted); transition: background .15s, color .15s; }
.plan-switch-tab b { font-size: .875rem; color: var(--color-text-main); }
.plan-switch-tab small { font-size: .6875rem; line-height: 1.5; }
.plan-switch-tab:hover { background: var(--color-hover-subtle); }
.plan-switch-tab[aria-current="page"] { background: var(--color-surface); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--border-subtle); }
.plan-switch-tab[aria-current="page"] b { color: rgb(var(--primary-rgb)); }

/* ===========================================================================
   Monthly subscription page (plans/monthly.html, plans/_monthly_card.html)
   =========================================================================== */
.mo-page { max-width: 1240px; margin-inline: auto; }
.mo-hero { text-align: center; max-width: 640px; margin: .5rem auto 2rem; }
.mo-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; color: rgb(var(--primary-rgb));
    background: rgb(var(--primary-rgb) / .1); padding: 4px 12px; border-radius: 99px; margin-bottom: 14px; }
.mo-hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.35rem); font-weight: 800; line-height: 1.35;
    color: var(--color-text-main); margin-bottom: 12px; }
.mo-hero p { font-size: 14.5px; line-height: 2; color: var(--color-text-muted); }
.mo-mine { max-width: 560px; margin: 0 auto 2.25rem; }

.mo-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 3.5rem; }
.mo-card { position: relative; flex: 1 1 200px; max-width: 244px; display: flex; flex-direction: column;
    padding: 22px 18px 18px; border-radius: 20px; background: var(--color-surface);
    border: 1px solid var(--border-subtle); transition: border-color .2s, transform .2s, box-shadow .2s; }
.mo-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mo-card.is-featured { border-color: rgb(var(--primary-rgb) / .55);
    background: linear-gradient(180deg, rgb(var(--primary-rgb) / .09), transparent 42%), var(--color-surface);
    box-shadow: var(--shadow-lg); }
.mo-card.is-current { border-color: rgb(var(--primary-rgb) / .8); }
.mo-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.mo-card-head h3 { font-size: 1.15rem; font-weight: 800; color: var(--color-text-main); }
.mo-badge { font-size: 10.5px; font-weight: 700; white-space: nowrap; padding: 3px 9px; border-radius: 99px;
    color: var(--color-text-on-primary); background: rgb(var(--primary-rgb)); }
.mo-badge.is-current { color: rgb(var(--primary-rgb)); background: rgb(var(--primary-rgb) / .12); }
.mo-tagline { font-size: 12px; line-height: 1.8; color: var(--color-text-muted); margin-top: 6px; min-height: 2.9em; }
.mo-price { display: flex; flex-direction: column; gap: 2px; margin: 16px 0 14px; }
.mo-price b { font-size: 1.55rem; font-weight: 800; color: var(--color-text-main); letter-spacing: -.01em; }
.mo-price span { font-size: 11.5px; color: var(--color-text-muted); }

.mo-usage { padding: 12px; border-radius: 14px; background: rgb(var(--color-text-main-rgb) / .045); margin-bottom: 16px; }
.mo-usage-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 8px; }
.mo-usage-bar i { height: 6px; border-radius: 99px; background: rgb(var(--color-text-main-rgb) / .1); }
.mo-usage-bar i.on { background: rgb(var(--primary-rgb)); }
.mo-usage p { font-size: 12px; color: var(--color-text-muted); }
.mo-usage b { color: var(--color-text-main); }

.mo-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; font-size: 12.5px;
    line-height: 1.75; color: var(--color-text-muted); }
.mo-features li { display: flex; gap: 8px; align-items: flex-start; }
.mo-features b { color: var(--color-text-main); font-weight: 700; }
.mo-features svg { flex: none; width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: rgb(var(--primary-rgb));
    stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.mo-cta { margin-top: auto; display: block; text-align: center; padding: 11px 12px; border-radius: 13px;
    font-size: 13.5px; font-weight: 700; color: var(--color-text-main); border: 1px solid var(--border-strong);
    transition: background .15s, border-color .15s; }
.mo-cta:hover { background: var(--color-hover-subtle); }
.mo-cta.is-primary { color: var(--color-text-on-primary); background: rgb(var(--primary-rgb)); border-color: transparent; }
.mo-cta.is-primary:hover { filter: brightness(1.06); background: rgb(var(--primary-rgb)); }
.mo-empty { padding: 2rem; text-align: center; color: var(--color-text-muted); font-size: 14px; }

.mo-how, .mo-faq { max-width: 920px; margin: 0 auto 3rem; }
.mo-how h2, .mo-faq h2 { font-size: 1.15rem; font-weight: 800; color: var(--color-text-main); margin-bottom: 1rem; text-align: center; }
.mo-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mo-steps li { padding: 18px; border-radius: 18px; background: var(--color-surface); border: 1px solid var(--border-subtle); }
.mo-steps b { display: block; font-size: 14px; color: var(--color-text-main); margin: 12px 0 6px; }
.mo-steps p { font-size: 12.5px; line-height: 1.9; color: var(--color-text-muted); }
.mo-step-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
    background: rgb(var(--primary-rgb) / .12); }
.mo-step-ico svg { width: 20px; height: 20px; fill: none; stroke: rgb(var(--primary-rgb)); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; }

.mo-faq details { border-bottom: 1px solid var(--border-subtle); }
.mo-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 15px 4px; font-size: 14px; font-weight: 600; color: var(--color-text-main); }
.mo-faq summary::-webkit-details-marker { display: none; }
.mo-faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--color-text-muted); transition: transform .2s; }
.mo-faq details[open] summary::after { transform: rotate(45deg); }
.mo-faq details p { padding: 0 4px 16px; font-size: 13px; line-height: 2; color: var(--color-text-muted); }

.mo-credit { max-width: 920px; margin: 0 auto 3.5rem; display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 18px 20px; border-radius: 18px; border: 1px dashed var(--border-strong); }
.mo-credit b { font-size: 14px; color: var(--color-text-main); }
.mo-credit p { font-size: 12.5px; line-height: 1.9; color: var(--color-text-muted); margin-top: 2px; }
.mo-credit a { flex: none; padding: 9px 16px; border-radius: 12px; font-size: 13px; font-weight: 700;
    color: rgb(var(--primary-rgb)); background: rgb(var(--primary-rgb) / .1); }

@media (max-width: 767px) {
    .mo-hero { margin-bottom: 1.5rem; }
    .mo-card { flex-basis: 100%; max-width: none; }
    .mo-card.is-featured { order: -1; }
    .mo-tagline { min-height: 0; }
    .mo-steps { grid-template-columns: 1fr; }
    .mo-credit { flex-direction: column; align-items: stretch; text-align: start; }
    .mo-credit a { text-align: center; }
}
