/* Pricing (homepage #pricing) and the plan picker on /subscribe.
   Builds on the tokens and components in style.css. */

.interval-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    border-radius: var(--pill);
    background: var(--card);
    border: 1px solid var(--glass-edge);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}
.interval-toggle button {
    padding: 8px 16px;
    border-radius: var(--pill);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: background 0.15s, color 0.15s;
}
.interval-toggle button.active { background: var(--ink); color: #fff; }
.interval-toggle .save { margin-left: 6px; font-size: 0.72rem; color: var(--ok); font-weight: 700; }
.interval-toggle button.active .save { color: #86efac; }

.plans {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gap-lg);
    margin-top: var(--gap-lg);
}
.plan-card { display: flex; flex-direction: column; gap: 14px; position: relative; }
.plan-card.featured {
    background: var(--grad);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}
.plan-card .plan-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 1.05rem; }
.plan-badge {
    padding: 3px 10px;
    border-radius: var(--pill);
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price b { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.plan-price small { color: var(--ink-3); font-size: 0.9rem; }
.plan-card.featured .plan-price small { color: rgba(255, 255, 255, 0.8); }
.plan-note { min-height: 1.3em; font-size: 0.8rem; color: var(--ok); font-weight: 600; }
.plan-card.featured .plan-note { color: #bbf7d0; }
.plan-credits { padding: 12px 14px; border-radius: var(--r-sm); background: var(--card-2); }
.plan-card.featured .plan-credits { background: rgba(255, 255, 255, 0.16); }
.plan-credits b { display: block; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.plan-credits small { font-size: 0.8rem; color: var(--ink-3); }
.plan-card.featured .plan-credits small { color: rgba(255, 255, 255, 0.8); }
.plan-feats { list-style: none; display: grid; gap: 8px; font-size: 0.9rem; color: var(--ink-2); }
.plan-card.featured .plan-feats { color: rgba(255, 255, 255, 0.92); }
.plan-feats li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 0.55em; border-radius: 50%; background: var(--blue); }
.plan-card.featured .plan-feats li::before { background: #fff; }
.plan-card .btn { margin-top: auto; }

.pricing-extras {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: var(--gap-lg);
    margin-top: var(--gap-lg);
}
.pricing-extras h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.pricing-extras p { color: var(--ink-2); font-size: 0.92rem; }
.topup-list { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.topup-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--card-2); }
.topup-list b { font-weight: 700; }
.topup-list span { color: var(--ink-3); font-size: 0.85rem; }
.cost-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.86rem; }
.cost-table td { padding: 7px 0; border-top: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.cost-table tr:first-child td { border-top: 0; }
.cost-table td:last-child { text-align: right; font-weight: 600; color: var(--ink); white-space: nowrap; padding-left: 12px; }
.cost-table code { font-size: 0.8rem; }
.pricing-fineprint { margin-top: 12px; font-size: 0.8rem; color: var(--ink-3); }
.pricing-fineprint a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) {
    .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pricing-extras { grid-template-columns: 1fr 1fr; }
    .pricing-extras .contact-tile { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .plans, .pricing-extras { grid-template-columns: minmax(0, 1fr); }
    .plan-price b { font-size: 2.2rem; }
}

/* ---------- /subscribe plan picker ---------- */
.picker-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.picker { display: grid; gap: 8px; margin-bottom: 16px; }
.pick {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--r-sm);
    background: var(--card-2);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.pick:hover { background: var(--blue-wash); }
.pick input { accent-color: var(--blue); width: 18px; height: 18px; }
.pick:has(input:checked) { border-color: var(--blue); background: #fff; }
.pick b { font-weight: 600; }
.pick small { display: block; font-size: 0.8rem; color: var(--ink-3); }
.pick .pick-price { text-align: right; font-weight: 700; white-space: nowrap; }
.pick .pick-price small { font-weight: 500; }

.credit-meter { margin: 12px 0 6px; height: 10px; border-radius: 10px; background: var(--card-2); overflow: hidden; }
.credit-meter i { display: block; height: 100%; border-radius: 10px; background: var(--blue); transition: width 0.6s ease; }
.credit-meter.low i { background: var(--warn); }
.credit-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 0.88rem; color: var(--ink-2); }
.credit-line b { color: var(--ink); }
.topup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.have-key { display: flex; gap: 8px; margin-top: 10px; }
.have-key .input { flex: 1; min-width: 0; }
@media (max-width: 480px) {
    .pick { grid-template-columns: auto 1fr; }
    .pick .pick-price { grid-column: 2; text-align: left; }
    .topup-row { grid-template-columns: 1fr; }
    .have-key { flex-direction: column; }
}
