/* ============================================================
   Billing: plans, checkout, cancel
   ============================================================ */

/* The stripe-payment controller toggles Bootstrap's old .hide class on the
   payment form (.new_credit_card_form, .existing_cards). Keep it working. */
.c-subscriptions .hide{display:none!important}

.billing{display:grid;gap:2rem}
.bill-block{display:grid;gap:1.25rem}
.bill-block__head{display:grid;gap:.35rem}

/* current plan */
/* the plan, price and card on the left; Cancel subscription top right */
.bill-current{display:flex;flex-wrap:wrap;gap:1.25rem 2rem;align-items:flex-start}
.bill-current__items{flex:1 1 30rem;min-width:0;display:grid;gap:1.25rem 2rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
.bill-current__actions{margin-left:auto}
.bill-current .bill-current__actions .btn{margin-top:0}
.bill-current__item{display:grid;gap:.35rem;align-content:start;justify-items:start}
.bill-current__v{font-family:var(--ff-display);font-size:1.35rem;letter-spacing:-.02em;line-height:1.2}
.bill-current__per{font-family:var(--ff-body);font-size:.9rem;font-weight:500;color:var(--gray-600)}
.bill-current .muted{font-size:.92rem}
.bill-current .btn{margin-top:.35rem}

/* plan cards (from the marketing site) */
.plans{display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));align-items:stretch}
.plan{background:#fff;border:1px solid var(--gray-200);border-radius:var(--r-lg);padding:1.75rem 1.5rem;
  display:flex;flex-direction:column;gap:.75rem;position:relative}
.plan--feat{border:2px solid var(--amber);box-shadow:0 24px 60px -20px rgba(232,151,31,.35)}
.plan--team{background:linear-gradient(160deg,var(--blue-50),#fff 80%);border-color:var(--blue-border)}
.plan h3{font-size:1.4rem}
.plan__lede{font-family:var(--ff-display);font-weight:700;font-size:1.35rem;letter-spacing:-.02em;color:var(--blue-700);line-height:1.2}
.plan .checks{font-size:.95rem;margin-bottom:.5rem}
.plan>.btn,.plan>.plan-current,.plan>.plan-full{margin-top:auto}
.plan>.btn{width:100%}
.plan-current{justify-content:center;min-height:44px;font-size:.78rem}
.plan-full{font-size:.9rem}

/* prices (plan cards and the team table) */
.price{display:flex;flex-wrap:wrap;align-items:baseline;gap:.15rem .4rem}
.price__amt{font-family:var(--ff-display);font-weight:700;font-size:2.2rem;letter-spacing:-.03em;line-height:1}
.price__was{text-decoration:line-through;color:var(--gray-500);font-weight:500}
.price__amt.price__was{font-size:1.2rem}
.price__per{color:var(--gray-600);font-size:.9rem}
.price__note{display:block;color:var(--gray-600);font-size:.85rem}
.team-plans .price__amt{font-size:1.1rem;letter-spacing:-.01em}
.team-plans .price__amt.price__was{font-size:.95rem}
.team-plans .price__note{font-size:.8rem}

/* courses in each plan card */
.plan-courses{display:grid;gap:.5rem;margin-bottom:.5rem}
.plan-courses .checks{font-size:.95rem}
.plan-courses__list{list-style:none;margin:0 0 0 2rem;padding:0;display:grid;gap:.4rem;font-size:.88rem;color:var(--gray-700);line-height:1.35}
.plan-courses__list li{padding-left:.85rem;position:relative}
.plan-courses__list li::before{content:"";position:absolute;left:0;top:.55em;width:.3rem;height:.3rem;border-radius:50%;background:var(--gray-500)}
.plan-courses__more{margin-left:2rem}
.plan-courses__more summary{list-style:none;cursor:pointer;font-size:.88rem;font-weight:600;color:var(--blue-700);padding:.15rem 0;width:max-content}
.plan-courses__more summary::-webkit-details-marker{display:none}
.plan-courses__more summary:hover{text-decoration:underline}
.plan-courses__more .plan-courses__list{margin:.4rem 0 0}
.plan-courses__more:not([open]) .plan-courses__close,.plan-courses__more[open] .plan-courses__open{display:none}
.plan-courses__more[open]{display:flex;flex-direction:column-reverse;align-items:flex-start;gap:.4rem}
.plan-courses__more[open] .plan-courses__list{margin:0}
.plan-courses__count{display:block;font-size:.85rem}
.plans__all{margin-top:1rem;color:var(--gray-600);font-size:.92rem}
.plans__all strong{color:var(--ink)}

/* team plans */
.bill-seats{max-width:320px}
.team-plans th[scope=row]{font-family:var(--ff-body);font-size:.95rem;font-weight:600;letter-spacing:0;text-transform:none;color:var(--ink);background:none;white-space:nowrap}
.team-plans td{white-space:nowrap}
.team-plans .plan-full{white-space:normal;display:inline-block;max-width:12rem;text-align:right}

/* cancel subscription: its form opens in a dialog from the current-plan box */
.bill-current__actions .btn--sm{min-height:44px}
/* .bill-cancel: the unsubscribe page's card */
.bill-cancel{display:grid;gap:1.25rem;border-color:var(--red-border)}
.bill-cancel__head{display:flex;flex-wrap:wrap;gap:1rem 2rem;align-items:center;justify-content:space-between}
.bill-cancel__head>div{display:grid;gap:.35rem;max-width:60ch}
.bill-cancel__head h2{font-size:1.15rem}
.bill-cancel__body{padding-top:1.25rem;border-top:1px solid var(--gray-200)}
.bill-cancel .btn--sm{min-height:44px}

/* ---------- checkout (focused layout) ---------- */
.checkout-steps{list-style:none;margin:0;padding:0;display:flex;gap:.5rem;flex-wrap:wrap;counter-reset:none}
.checkout-steps li{display:flex;align-items:center;gap:.5rem;font-size:.88rem;font-weight:600;color:var(--gray-600)}
.checkout-steps li+li::before{content:"";width:1.5rem;height:1px;background:var(--gray-300);margin-right:.1rem}
.checkout-steps__n{width:1.6rem;height:1.6rem;border-radius:50%;display:grid;place-items:center;flex:none;
  font-family:var(--ff-mono);font-size:.75rem;background:var(--gray-100);border:1px solid var(--gray-200)}
.checkout-steps li.is-done{color:var(--ink)}
.checkout-steps li.is-done .checkout-steps__n{background:var(--ok-100);border-color:var(--ok-border);color:var(--ok)}
.checkout-steps li[aria-current]{color:var(--ink)}
.checkout-steps li[aria-current] .checkout-steps__n{background:var(--amber);border-color:var(--amber);color:var(--ink)}
@media (max-width:600px){
  .checkout-steps li:not([aria-current]) .checkout-steps__l{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}

.focus-head{display:grid;gap:.5rem}

.bill-summary{display:grid;gap:1.25rem 2rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
.bill-summary__item{display:grid;gap:.35rem;align-content:start}
.bill-summary__v{font-family:var(--ff-display);font-size:1.4rem;letter-spacing:-.02em;line-height:1.2}
.bill-summary__per{font-family:var(--ff-body);font-size:.9rem;font-weight:500;color:var(--gray-600)}
.bill-summary .muted{font-size:.9rem}
.bill-summary__item a{font-size:.9rem;font-weight:600;justify-self:start;min-height:24px}

.bill-section{display:grid;gap:1.1rem}
.bill-section h2{font-size:1.2rem}
.bill-section__head{display:flex;justify-content:space-between;align-items:center;gap:1rem}
.bill-fields{display:grid;gap:1.1rem}
.bill-card-entry{display:grid;gap:1.5rem;grid-template-columns:minmax(0,1fr) auto;align-items:start}
.credit_card_display:empty{display:none}
@media (max-width:760px){.bill-card-entry{grid-template-columns:1fr}.credit_card_display{display:none}}
.card-number{position:relative}
.field .card-number input{padding-right:9.5rem;font-variant-numeric:tabular-nums;letter-spacing:.04em}
.card-brand{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);pointer-events:none;
  font-family:var(--ff-body);font-size:.75rem;font-weight:700;letter-spacing:.02em;line-height:1;white-space:nowrap;
  padding:.35rem .55rem;border-radius:4px;color:#fff;background:var(--gray-600)}
.card-brand:empty{display:none}
.card-brand[data-brand=visa]{background:#1a1f71}
.card-brand[data-brand=mastercard]{background:#252525;color:#f79e1b}
.card-brand[data-brand=amex]{background:#006fcf}
.card-brand[data-brand=discover]{background:#ff6000}
.card-brand[data-brand=diners]{background:#0079be}
.card-brand[data-brand=jcb]{background:#0e7c3a}
.card-brand[data-brand=unionpay]{background:#d10429}
.bill-fields__pair{grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr))}
.existing_cards_form{display:flex;flex-wrap:wrap;gap:.75rem 1rem;align-items:center}
.bill-card{font-family:var(--ff-mono);font-size:.95rem;font-weight:600;letter-spacing:.02em}
.existing_cards.bill-card{display:inline-flex;align-items:center;gap:.6rem;background:var(--gray-100);border:1px solid var(--gray-200);border-radius:var(--r);padding:.6rem .9rem;white-space:pre-wrap}
.existing_cards.bill-card::before{content:"";width:20px;height:20px;flex:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4642' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E") center/contain no-repeat}
.existing_cards_form .btn--sm{min-height:44px}
.bill-secure{display:inline-flex;align-items:center;gap:.4rem;font-size:.88rem}

.bill-details{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));align-items:start}
.bill-dl{display:grid;gap:.9rem;margin:0}
.bill-dl>div{display:grid;gap:.15rem}
.bill-dl dt{font-family:var(--ff-mono);font-weight:600;font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;color:var(--gray-600)}
.bill-dl dd{margin:0;overflow-wrap:anywhere}
.bill-done{background:var(--ok-100);border-color:var(--ok-border);flex-wrap:wrap}
.bill-done .ico{color:var(--ok)}
.c-subscriptions .focus-main>.form .form-actions{padding-top:0}
/* SimpleForm wraps hidden inputs in div.field.hidden; keep them out of the grid */
.c-subscriptions .field.hidden{display:none}
@media (max-width:600px){.checkout-steps li+li::before{width:.6rem}}
.unsub{display:grid;gap:1rem;max-width:720px}
