/* ===========================================================================
   RedSwitches cart — order form styling

   Design tokens (--font, --accent, --r-md, …) are declared once in
   templates/redswitches/css/custom.css. The cart renders inside the active
   theme, so they are already in scope — do NOT redeclare them here.

   Loaded last in common.tpl so it wins over standard_cart's all.min.css.
   =========================================================================== */


/* === Bootstrap 3 compatibility shim ======================================
   The seeded template is Bootstrap 3 era and marks elements it wants hidden
   with .hidden. Twenty-One ships Bootstrap 4.5.3, which REMOVED .hidden in
   favour of .d-none — so every one of those elements was rendering visible:
   duplicate payment radios, an empty error alert, stray radio dots.

   SCOPE MATTERS: several containers ship with .hidden and are meant to be
   un-hidden at runtime by wgs_custom_script.js, which we deliberately did not
   carry over (it bundles jQuery 3 and would break the theme). Applying the
   shim to everything hid the cart contents themselves — #manageSummary holds
   the line items and is one of those runtime-toggled containers. So this is
   limited to elements genuinely meant to stay hidden: the duplicate payment
   radios and the domain type selectors.
   ========================================================================== */

.wgs_checkout_data label.radio-inline.hidden,
#order-standard_cart label.radio-inline.hidden,
.pymntmthd + label.hidden,
li.registerDm.hidden, li.transferDm.hidden { display: none !important; }


/* === Shell ================================================================ */

#order-standard_cart,
.wgs_checkout_data,
.accordionWgsOnePage {
    font-family: var(--font);
    color: var(--text-primary);
    max-width: 1100px;
}
#order-standard_cart h1, .wgs_checkout_data h1 { font-size: var(--t-section); }
#order-standard_cart h2, .wgs_checkout_data h2 {
    font-size: var(--t-subsection); font-weight: 700;
    letter-spacing: -.018em; color: var(--text-heading);
    margin: 1.5rem 0 .75rem;
}
#order-standard_cart .container,
.wgs_checkout_data .container { max-width: none; padding: 0; }


/* === Cart line items ====================================================== */

.accordionWgsOnePage .order-row,
.wgs-cart-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem 1.125rem;
    margin-bottom: .75rem;
}
.ram-box { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .375rem .5rem; }
.ram-box li {
    font-family: var(--mono); font-size: var(--t-body);
    font-variant-numeric: tabular-nums; color: var(--text-secondary);
    background: var(--bg-surface); border-radius: var(--r-sm); padding: .1875rem .5rem;
}
.ram-box li .fa-star { display: none; }


/* === Promo code =========================================================== */

#promoCodedivs, .promo-wrapper { margin: 1rem 0; }
#inputPromotionCode {
    font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em;
    max-width: 260px; display: inline-block;
}


/* === Payment method tiles =================================================
   WHMCS's real <input name="paymentmethod"> radios sit in labels marked
   .hidden — now genuinely hidden by the shim above. The .pymntmthd tiles are
   the visible control; their JS checks the matching radio on click. */

#order-standard_cart .nav-tabs,
.wgs_checkout_data .nav-tabs {
    border: 0; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .625rem; margin: .75rem 0 1.25rem; padding: 0;
}
.pymntmthd {
    list-style: none; margin: 0;
    border: 1px solid var(--border-active);
    border-radius: var(--r-md);
    background: var(--bg-card);
    transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.pymntmthd > a {
    display: flex; align-items: center; gap: .5rem;
    padding: .875rem 1rem; cursor: pointer;
    font-size: var(--t-body-lg); font-weight: 500; color: var(--text-primary);
}
.pymntmthd:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.pymntmthd.active, .pymntmthd.selected {
    border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent);
}
.pymntmthd i, .pymntmthd img { font-size: 16px; color: var(--text-muted); max-height: 20px; width: auto; }
.pymntmthd.active i { color: var(--accent); }


/* === Account / auth blocks ================================================ */

.account-select-container .account,
#containerExistingUserSignin,
#containerNewUserSignup > .panel,
.wgs_checkout_data .panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem 1.125rem;
    margin-bottom: .75rem;
}

/* The seed template ships these as teal/amber. Bring them into the palette:
   the primary path is black, the alternative is a quiet outline. */
#btnAlreadyRegistered, #btnNewUserSignup {
    font-size: var(--t-btn); font-weight: 500;
    border-radius: var(--r-sm); padding: .5rem 1rem;
    border: 1px solid var(--border-active);
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}
#btnAlreadyRegistered:hover, #btnNewUserSignup:hover {
    background: var(--bg-surface) !important; border-color: var(--border-strong);
}


/* === Credit balance panel ================================================= */

.wgs_checkout_data .well, .credit-balance-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem 1.125rem;
    font-size: var(--t-body-lg);
}


/* === Order summary ======================================================== */

#orderSummary, .order-summary-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1.125rem;
}
#orderSummary .total, .cart-total, .total-due {
    font-family: var(--mono); font-variant-numeric: tabular-nums;
    font-size: var(--t-price-card); font-weight: 700; color: var(--text-heading);
}
#orderSummary td, #orderSummary th { font-size: var(--t-body-lg); padding: .3125rem 0; }
#orderSummary .amount, #orderSummary td:last-child {
    font-family: var(--mono); font-variant-numeric: tabular-nums;
}


/* === Primary actions ====================================================== */

#wgsCompleteOrder, .checkout-btn, #btnCompleteProductConfig,
#order-standard_cart .btn-checkout {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--accent); color: var(--white);
    border: 1px solid var(--accent); border-radius: var(--r-sm);
    padding: .75rem 1.5rem;
    font-family: var(--font); font-size: var(--t-body-lg); font-weight: 500;
    cursor: pointer; transition: background-color .15s var(--ease);
}
#wgsCompleteOrder:hover, .checkout-btn:hover, #btnCompleteProductConfig:hover {
    background: var(--gray-700); border-color: var(--gray-700); color: var(--white);
}

/* Terms checkbox reads as a deliberate gate, not an afterthought. */
.wgs_checkout_data input[type="checkbox"] + label,
#accepttos + label { font-size: var(--t-body-lg); color: var(--text-secondary); }


/* === Notes ================================================================ */

textarea[name="notes"], #inputNotes {
    min-height: 90px; border-radius: var(--r-md);
    border: 1px solid var(--border-active); padding: .75rem;
    font-size: var(--t-body-lg); width: 100%;
}


/* === Spinner replacing the seed template's GIFs =========================== */

.rs-spinner {
    display: inline-block; width: 1em; height: 1em; vertical-align: -.125em;
    border: 2px solid var(--border-active); border-top-color: var(--accent);
    border-radius: 50%; animation: rs-spin .6s linear infinite;
}
.rs-spinner[hidden] { display: none; }
@keyframes rs-spin { to { transform: rotate(360deg); } }
.rs-arrow { color: var(--text-muted); font-size: .75em; }

@media (prefers-reduced-motion: reduce) {
    .rs-spinner { animation-duration: 2s; }
    .pymntmthd, .accordionWgsOnePage .order-row { transition: none; }
}


/* ===========================================================================
   ONE-PAGE CHECKOUT (our own markup — no Bootstrap grid)
   =========================================================================== */

.rs-co { max-width: 1180px; margin: 0 auto; }

.rs-co-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.25rem;
}
.rs-co-head h1 { font-size: var(--t-section); font-weight: 700; letter-spacing: -.018em; margin: 0; }
.rs-co-back { font-size: var(--t-label); color: var(--text-muted); }
.rs-co-back:hover { color: var(--text-primary); }

.rs-co-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 1.25rem; align-items: start; }
.rs-co-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.rs-co-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.25rem;
}
.rs-co-card h2 {
    font-size: var(--t-card); font-weight: 600; color: var(--text-heading);
    margin: 0 0 1rem; letter-spacing: -.01em;
}
.rs-co-card h3 { font-size: var(--t-label); color: var(--text-muted); margin: 1.25rem 0 .5rem; font-weight: 500; }

/* --- line item --- */
.rs-item { border-top: 1px solid var(--border); padding-top: .875rem; margin-top: .875rem; position: relative; }
.rs-item:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.rs-item-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.rs-item-name { display: block; font-size: var(--t-body-lg); font-weight: 500; color: var(--text-heading); }
.rs-item-price { text-align: right; white-space: nowrap; }
.rs-item-price .rs-num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--t-body-lg); font-weight: 500; }
.rs-item-cycle { display: block; font-size: var(--t-tag); color: var(--text-muted); }
.rs-item-edit { font-size: var(--t-tag); color: var(--text-muted); }
.rs-item-edit:hover { color: var(--accent); }

.rs-specs { list-style: none; margin: .625rem 0 .5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: .25rem .75rem; }
.rs-specs li { display: flex; justify-content: space-between; gap: .5rem; font-size: var(--t-body); padding: .25rem .5rem; background: var(--bg-surface); border-radius: var(--r-sm); }
.rs-spec-k { color: var(--text-muted); }
.rs-spec-v { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }
.rs-specs--addon li { background: var(--hint-green); }
.rs-specs--addon .rs-spec-k { color: var(--hint-green-text); }

/* --- fields --- */
.rs-field { margin-bottom: .75rem; }
.rs-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: .75rem; }
.rs-field label { display: block; font-size: var(--t-label); font-weight: 500; color: var(--text-secondary); margin-bottom: .25rem; }
.rs-field input, .rs-field select, .rs-field textarea {
    width: 100%; font-family: var(--font); font-size: var(--t-body-lg);
    color: var(--text-primary); background: var(--bg-card);
    border: 1px solid var(--border-active); border-radius: var(--r-sm);
    padding: .5rem .75rem;
}
.rs-field input:focus, .rs-field select:focus, .rs-field textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px #00000010; outline: none;
}
.rs-help { font-size: var(--t-tag); color: var(--text-muted); }
.rs-pw { height: 4px; border-radius: 999px; background: var(--gray-100); margin-top: -.25rem; }

/* --- new vs existing customer segmented control --- */
.rs-co-switch { display: inline-flex; background: var(--bg-surface); border-radius: var(--r-sm); padding: 3px; margin-bottom: 1rem; }
.rs-seg { border: 0; background: none; padding: .375rem .875rem; border-radius: 6px; font-size: var(--t-label); font-weight: 500; color: var(--text-muted); }
.rs-seg.is-active { background: var(--bg-card); color: var(--text-heading); box-shadow: var(--shadow-sm); }

.rs-accounts { display: grid; gap: .5rem; margin-bottom: 1rem; }
.rs-account-opt { display: block; border: 1px solid var(--border-active); border-radius: var(--r-md); padding: .75rem .875rem; cursor: pointer; margin: 0; }
.rs-account-opt.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rs-account-opt .rs-account-name { display: block; font-weight: 500; font-size: var(--t-body-lg); }
.rs-account-opt .rs-account-addr { display: block; font-size: var(--t-tag); color: var(--text-muted); }

/* --- payment trust note --- */
.rs-pay-note {
    display: flex; align-items: flex-start; gap: .625rem;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: .75rem .875rem; margin: 0 0 1rem;
}
.rs-pay-note i { color: var(--text-primary); font-size: 15px; margin-top: .1rem; flex: 0 0 auto; }
.rs-pay-note p { margin: 0; font-size: var(--t-body); color: var(--text-secondary); line-height: 1.45; }
.rs-pay-note strong { color: var(--text-primary); font-weight: 600; }

/* --- gateways: vertical cards, brand icon on top, custom check --- */
.rs-gateways { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: .625rem; }
.rs-gateway {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    margin: 0; border: 1px solid var(--border-active); border-radius: var(--r-md);
    padding: 1rem .75rem .875rem; cursor: pointer; text-align: center;
    transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.rs-gateway:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.rs-gateway:has(input:checked), .rs-gateway.is-active {
    border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent);
}
/* native radio hidden; the custom check is the indicator */
.rs-gateway input { position: absolute; opacity: 0; width: 0; height: 0; }
.rs-gateway-icon { font-size: 24px; color: var(--text-secondary); line-height: 1; }
.rs-gateway:has(input:checked) .rs-gateway-icon, .rs-gateway.is-active .rs-gateway-icon { color: var(--text-primary); }
.rs-gateway-name { font-size: var(--t-body); font-weight: 500; color: var(--text-primary); line-height: 1.25; }
.rs-gateway-check {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid var(--border-strong); background: var(--bg-card);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.rs-gateway:has(input:checked) .rs-gateway-check, .rs-gateway.is-active .rs-gateway-check {
    background: var(--accent); border-color: var(--accent);
}
.rs-gateway:has(input:checked) .rs-gateway-check::after, .rs-gateway.is-active .rs-gateway-check::after {
    content: ""; width: 5px; height: 9px; margin-top: -1px;
    border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rs-gateway:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Store-credit card — appears only when the client holds a balance. Green
   badge = money available (matches the savings/positive register); amount in
   mono, like every other price in the checkout. */
.rs-credit { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 1rem 1.125rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm); }
.rs-credit-head { display: flex; align-items: center; gap: .625rem; margin-bottom: .625rem; }
.rs-credit-badge { flex: 0 0 auto; width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--hint-green); color: var(--hint-green-text); font-size: .875rem; }
.rs-credit-label { font-weight: 600; color: var(--text-primary); }
.rs-credit-amt { margin-left: auto; font-family: var(--mono); font-weight: 600; font-size: var(--t-subsection); color: var(--text-heading); }
.rs-credit-opt { display: flex; align-items: center; gap: .5rem; padding: .5rem .625rem; margin: .25rem 0 0; border-radius: var(--r-sm); cursor: pointer; font-weight: 400; transition: background .15s var(--ease); }
.rs-credit-opt:hover { background: var(--bg-surface); }
.rs-credit-opt input { margin: 0; }

/* --- card entry (remote gateway = Stripe Elements in #paymentGatewayInput;
       local fallback fields in #creditCardInputFields) --- */

/* Stripe injects an iframe here — give it card-field chrome so it reads as
   one of our inputs rather than a bare frame. */
#paymentGatewayInput:not(:empty) {
    margin-top: .875rem; padding: .75rem .875rem;
    border: 1px solid var(--border-active); border-radius: var(--r-md);
    background: var(--bg-card);
}
#paymentGatewayInput .StripeElement { padding: .25rem 0; }

#creditCardInputFields { margin-top: .875rem; }

/* Saved payment methods — one tile per method (our own include wraps each in
   .rs-saved-card, so the layout is type-agnostic). */
.rs-saved-cards { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .875rem; }
.rs-saved-card {
    position: relative;
    display: flex; align-items: center; gap: .625rem; margin: 0;
    border: 1px solid var(--border-active); border-radius: var(--r-md);
    padding: .625rem .75rem; cursor: pointer;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.rs-saved-card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.rs-saved-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rs-saved-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.rs-saved-card.is-expired { opacity: .55; cursor: not-allowed; }
.rs-saved-check {
    flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid var(--border-strong); background: var(--bg-card);
    display: inline-flex; align-items: center; justify-content: center;
}
.rs-saved-card:has(input:checked) .rs-saved-check { background: var(--accent); border-color: var(--accent); }
.rs-saved-card:has(input:checked) .rs-saved-check::after {
    content: ""; width: 5px; height: 9px; margin-top: -1px;
    border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rs-saved-icon { flex: 0 0 auto; font-size: 20px; color: var(--text-secondary); width: 26px; text-align: center; }
.rs-saved-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rs-saved-name { font-size: var(--t-body-lg); font-weight: 500; color: var(--text-primary); }
.rs-saved-desc { font-size: var(--t-body); color: var(--text-muted); }
.rs-saved-exp { flex: 0 0 auto; font-size: var(--t-body); color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.rs-saved-exp small { color: var(--brand-red); }

/* security reassurance under the Complete Order button */
.rs-secure-note {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    margin: .625rem 0 0; font-size: var(--t-tag); color: var(--text-muted);
}
.rs-secure-note i { font-size: 11px; }

.rs-cc-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 .75rem; }
.rs-cc-row .rs-field { flex: 1 1 140px; margin: 0; }
.rs-cc-cvv { max-width: 160px; }

.rs-cc-new {
    display: inline-flex; align-items: center; gap: .5rem;
    margin: .25rem 0 .875rem; font-weight: 500; cursor: pointer;
}
.rs-cc-new input { accent-color: var(--accent); margin: 0; }

.rs-cc-store {
    display: inline-flex; align-items: center; gap: .5rem;
    margin: 0; font-weight: 400; font-size: var(--t-body); color: var(--text-muted);
}
.rs-cc-store input[type=checkbox] { accent-color: var(--accent); }

/* Validation messages are hidden until the field actually fails — WHMCS marks
   a failed field with .has-error / .is-invalid. A blanket display:block showed
   "CVC not valid" on every empty field. */
.rs-checkout .field-error-msg { display: none; font-size: var(--t-tag); color: var(--brand-red); margin-top: .25rem; }
.rs-checkout .has-error .field-error-msg,
.rs-checkout .is-invalid + .field-error-msg,
.rs-checkout .field-error-msg.is-visible { display: block; }

/* --- sticky summary --- */
/* The SUMMARY CARD is the sticky element — the currency picker above it
   scrolls away. The column must stretch to the full grid row (the page's
   height) or the card has no room to travel; the grid's align-items:start
   would otherwise shrink-wrap it. The earlier column-level sticky with an
   inner scroll pinned only the column's top in view, hiding the total and
   Complete Order below an internal fold. */
.rs-co-side { align-self: stretch; }
.rs-summary {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.125rem;
    position: sticky; top: calc(var(--topbar-h) + 1rem);
    /* The stock standard_cart JS treats #orderSummary as its own scroll-
       following sidebar and sets an inline margin-top:-Npx. That fights our
       CSS sticky and, on mobile, drags the summary up over the payment
       section. A stylesheet !important outranks the inline style, so we
       neutralise the JS entirely and let position:sticky do the work. */
    margin-top: 0 !important;
}
.rs-summary h2 { font-size: var(--t-label); font-weight: 500; color: var(--text-muted); margin: 0 0 .875rem; }
.rs-sum-row { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--t-body-lg); padding: .3125rem 0; }
.rs-sum-row--promo { color: var(--hint-pink-text); }
.rs-sum-total {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    border-top: 1px solid var(--border); margin-top: .625rem; padding-top: .75rem;
}
.rs-sum-total span:first-child { font-size: var(--t-label); color: var(--text-muted); }
.rs-sum-total .rs-num { font-size: var(--t-price-card); font-weight: 700; color: var(--text-heading); }
.rs-sum-recurring { font-size: var(--t-tag); color: var(--text-muted); margin-top: .375rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem; }
.rs-sum-recurring-lead { color: var(--text-muted); }
.rs-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.rs-tos { display: flex; gap: .5rem; align-items: flex-start; margin: 1rem 0 .875rem; font-size: var(--t-body); color: var(--text-secondary); }
.rs-tos input { margin-top: .2rem; accent-color: var(--accent); }

.rs-btn { border: 1px solid transparent; border-radius: var(--r-sm); font-family: var(--font); font-size: var(--t-body-lg); font-weight: 500; padding: .75rem 1.25rem; cursor: pointer; }
.rs-btn--primary { width: 100%; background: var(--accent); border-color: var(--accent); color: var(--white); }
.rs-btn--primary:hover { background: var(--gray-700); border-color: var(--gray-700); }
.rs-btn--ghost { background: var(--bg-card); border-color: var(--border-active); color: var(--text-primary); }
.rs-btn--ghost:hover { background: var(--bg-surface); }
.rs-express { margin-top: .75rem; }

@media (max-width: 991.98px) {
    .rs-co-grid { grid-template-columns: minmax(0,1fr); }
    .rs-co-side { position: static; }
    /* the sticky lives on .rs-summary, not .rs-co-side — it must be cleared
       here too, or the summary pins over the payment section on phones */
    .rs-summary { position: static; }
}

/* --- inline configurable options ------------------------------------------ */

.rs-cfg { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px,1fr)); gap: .625rem; margin: .75rem 0 .5rem; }
.rs-cfg-field label { display: block; font-size: var(--t-tag); color: var(--text-muted); margin-bottom: .25rem; }
.rs-cfg-field select,
.rs-cfg-field input[type="number"] {
    width: 100%; font-family: var(--font); font-size: var(--t-body);
    color: var(--text-primary); background: var(--bg-card);
    border: 1px solid var(--border-active); border-radius: var(--r-sm);
    padding: .375rem .5rem;
}
.rs-cfg-field input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rs-cfg-field select:focus,
.rs-cfg-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #00000010; outline: none; }

.rs-cfg-radios { display: grid; gap: .25rem; }
.rs-cfg-radio, .rs-cfg-check { display: flex; align-items: center; gap: .375rem; font-size: var(--t-body); margin: 0; }
.rs-cfg-radio input, .rs-cfg-check input { accent-color: var(--accent); }

.rs-cfg-status { grid-column: 1 / -1; font-size: var(--t-tag); color: var(--text-muted); display: flex; align-items: center; gap: .375rem; }
.rs-cfg-status[hidden] { display: none; }

/* --- product presentation on the checkout ---------------------------------
   The landing screen has to sell the machine, not just list a line item. */

.rs-item-head { align-items: flex-start; }
.rs-item-id { min-width: 0; }
h3.rs-item-name {
    font-size: var(--t-subsection); font-weight: 700; letter-spacing: -.02em;
    color: var(--text-heading); margin: 0;
}
.rs-item-price .rs-num { font-size: var(--t-price-card); font-weight: 700; line-height: 1.1; }

/* The product description renders AS STORED — the admin's own markup (bold
   labels, <br> line breaks), exactly like the store page shows it. No columns,
   no recoloured labels, no re-layout: an earlier two-column treatment here
   restyled the admin's content and made mixed markup render inconsistently.
   Spacing only. */
.rs-item-desc { margin: .875rem 0 .25rem; line-height: 1.7; }

/* --- interstitial while WHMCS commits the item ---------------------------- */
.rs-forward { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; min-height: 40vh; color: var(--text-muted); font-size: var(--t-body-lg); }
.rs-forward .rs-spinner { width: 22px; height: 22px; border-width: 2px; }
.rs-forward-source { display: block; }

/* --- summary breakdown + currency ----------------------------------------- */

.rs-currency {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: .625rem .875rem; margin-bottom: .75rem;
}
.rs-currency label { font-size: var(--t-label); color: var(--text-muted); margin: 0; }
.rs-currency select {
    font-family: var(--mono); font-size: var(--t-body);
    border: 1px solid var(--border-active); border-radius: var(--r-sm);
    padding: .25rem .5rem; background: var(--bg-card); color: var(--text-primary);
}

.rs-sum-item { border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: .5rem; }
.rs-sum-row--name { font-weight: 500; color: var(--text-heading); }
.rs-sum-row--opt { font-size: var(--t-body); color: var(--text-muted); padding: .125rem 0; }
.rs-sum-row--opt span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-qty {
    font-family: var(--mono); font-size: var(--t-tag); font-weight: 500;
    background: var(--gray-100); color: var(--text-secondary);
    border-radius: 999px; padding: .0625rem .375rem; vertical-align: middle;
}

/* --- billing cycle pills --------------------------------------------------- */

.rs-cycles { margin: .875rem 0 .25rem; }
.rs-cycles-label { display: block; font-size: var(--t-tag); color: var(--text-muted); margin-bottom: .375rem; }
.rs-cycles-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem; }
.rs-cycle {
    position: relative; display: flex; flex-direction: column; gap: .125rem;
    align-items: flex-start; text-align: left;
    border: 1px solid var(--border-active); border-radius: var(--r-md);
    background: var(--bg-card); padding: .625rem .75rem .6875rem;
    font-family: var(--font); cursor: pointer;
    transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.rs-cycle:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.rs-cycle.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rs-cycle-name { font-size: var(--t-label); font-weight: 500; color: var(--text-heading); }
.rs-cycle-price { font-size: var(--t-body); color: var(--text-secondary); }
.rs-cycle-save {
    position: absolute; top: .5rem; right: .625rem;
    font-size: var(--t-micro); font-weight: 500;
    background: var(--hint-green); color: var(--hint-green-text);
    border-radius: 999px; padding: .125rem .375rem;
}

/* --- quantity stepper ------------------------------------------------------ */
.rs-qty-ctl { display: inline-flex; align-items: center; gap: .375rem; margin-top: .375rem; justify-content: flex-end; }
.rs-qty-btn {
    width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-active); border-radius: 6px;
    background: var(--bg-card); color: var(--text-primary);
    font-size: 14px; line-height: 1; cursor: pointer;
    transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.rs-qty-btn:hover { background: var(--bg-surface); border-color: var(--border-strong); }
.rs-qty-val { font-size: var(--t-body); min-width: 1.5em; text-align: center; }

/* --- remove item ----------------------------------------------------------- */
.rs-item-remove {
    position: absolute; top: .625rem; right: 0;
    width: 30px; height: 30px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 50%;
    color: var(--text-primary); font-size: 13px; cursor: pointer;
    transition: color .15s var(--ease), background-color .15s var(--ease),
                border-color .15s var(--ease), transform .12s var(--ease);
}
.rs-item:first-of-type .rs-item-remove { top: -.25rem; }
.rs-item-remove:hover {
    color: var(--white); background: var(--brand-red); border-color: var(--brand-red);
    transform: scale(1.06);
}
.rs-item-remove:disabled { opacity: .5; cursor: default; }

/* --- empty cart ------------------------------------------------------------ */
.rs-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .75rem; min-height: 45vh; text-align: center;
}
.rs-empty i { font-size: 28px; color: var(--gray-300); }
.rs-empty h1 { font-size: var(--t-subsection); color: var(--text-heading); margin: 0; }
.rs-empty .rs-btn { margin-top: .5rem; text-decoration: none; }

/* The summary's Complete Order button is width:100%; the empty-state button
   must not inherit that. */
.rs-empty .rs-btn--primary { width: auto; padding: .75rem 2rem; }
/* The theme's `.rs-body a` (accent black) outranks .rs-btn--primary on
   ANCHOR-tag buttons — the label rendered black-on-black. Same specificity,
   later file wins. */
a.rs-btn--primary, a.rs-btn--primary:hover { color: var(--white); text-decoration: none; }

/* --- summary option entries: name above, value + charge below -------------- */
.rs-sum-opt { padding: .3125rem 0; }
.rs-sum-opt-name {
    display: block; font-size: var(--t-tag); color: var(--text-muted);
    letter-spacing: .01em; margin-bottom: .0625rem;
}
.rs-sum-opt-line {
    display: flex; justify-content: space-between; gap: .75rem;
    font-size: var(--t-body); color: var(--text-secondary);
}
.rs-sum-opt-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- account cards: radio inline with the identity ------------------------- */
.rs-account-opt {
    display: grid; grid-template-columns: auto 1fr;
    gap: .125rem .625rem; align-items: center;
}
.rs-account-opt input[type="radio"] { grid-row: 1 / 3; accent-color: var(--accent); width: 16px; height: 16px; }
.rs-account-opt .rs-account-name { grid-column: 2; }
.rs-account-opt .rs-account-addr { grid-column: 2; }

/* --- saved cards (existing pay methods): tame the parent markup ------------ */
#existingCardsContainer { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem; margin-top: .75rem; }
#existingCardsContainer .cc-item, #existingCardsContainer label, #existingCardsContainer .radio {
    border: 1px solid var(--border-active); border-radius: var(--r-md);
    padding: .625rem .75rem; margin: 0; display: flex; align-items: center; gap: .5rem;
    font-size: var(--t-body); cursor: pointer;
}
#existingCardsContainer img { max-height: 18px; width: auto; }

/* --- required / optional field marks --------------------------------------- */
.rs-req { color: var(--brand-red); font-weight: 500; }
.rs-opt { color: var(--text-muted); font-weight: 400; font-size: var(--t-tag); }

/* --- segmented New/Existing control ----------------------------------------
   WHMCS's stock JS treats these as a single toggle link: it w-hiddens the
   clicked one and reveals the other, which made a button vanish. In a
   segmented pair both stay visible; only the active highlight moves. */
.rs-co-switch .rs-seg { display: inline-block; }

/* --- Continue Shopping as a button ----------------------------------------- */
a.rs-co-back {
    display: inline-flex; align-items: center; gap: .375rem;
    height: 36px; padding: 0 1rem;
    border: 1px solid var(--border-active); border-radius: 999px;
    font-size: var(--t-btn); font-weight: 500;
    color: var(--text-primary) !important; text-decoration: none;
    transition: background-color .15s var(--ease);
}
a.rs-co-back:hover { background: var(--bg-surface); }
a.rs-co-back::before { content: "\2190"; }

/* --- promo in summary ------------------------------------------------------ */
.rs-promo { margin-top: .75rem; }
.rs-promo-row { display: flex; gap: .375rem; }
#rsPromoCode {
    flex: 1; min-width: 0;
    font-family: var(--mono); font-size: var(--t-body);
    text-transform: uppercase; letter-spacing: .04em;
    border: 1px solid var(--border-active); border-radius: var(--r-sm);
    padding: .4375rem .625rem; background: var(--bg-card);
}
#rsPromoCode:focus { border-color: var(--accent); outline: none; }
#rsPromoApply { flex: 0 0 auto; padding: .4375rem .875rem !important; font-size: var(--t-tag) !important; }
.rs-promo-applied {
    display: inline-flex; align-items: center;
    background: var(--hint-green); color: var(--hint-green-text);
    border-radius: 999px; padding: .25rem .625rem;
    font-family: var(--mono); font-size: var(--t-label);
}
.rs-promo-remove { margin-left: .5rem; font-size: var(--t-tag); color: var(--text-muted) !important; }
.rs-promo-remove:hover { color: var(--brand-red) !important; }

/* --- generate & copy link -------------------------------------------------- */
.rs-genlink { width: 100%; margin-top: .625rem; justify-content: center; display: inline-flex; }

/* --- micro-interactions ---------------------------------------------------
   150-300ms, transform/opacity/background only, brand easing. Everything in
   this block is presentation-only and dies gracefully under reduced-motion. */

@keyframes rsFlash { from { background: var(--gray-100); } to { background: transparent; } }
.rs-flash { animation: rsFlash .8s var(--ease); border-radius: 4px; }

@keyframes rsPop {
    0% { transform: scale(.5); }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); }
}
.rs-gateway:has(input:checked) .rs-gateway-check,
.rs-saved-card:has(input:checked) .rs-saved-check { animation: rsPop .18s var(--ease); }
.rs-tos input:checked { animation: rsPop .18s var(--ease); }

/* tactile press + lift */
.rs-gateway, .rs-saved-card, .rs-cycle, .rs-btn { will-change: transform; }
.rs-gateway:hover, .rs-saved-card:hover { transform: translateY(-1px); }
.rs-gateway:active, .rs-saved-card:active, .rs-cycle:active, .rs-btn:active { transform: translateY(1px); }

/* savings callout — money saved earns the green */
.rs-cycle-savings {
    margin: .5rem 0 0; font-size: var(--t-body); font-weight: 500;
    color: #00875a;
    opacity: 0; transform: translateY(-3px);
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.rs-cycle-savings.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .rs-flash, .rs-filled,
    .rs-gateway:has(input:checked) .rs-gateway-check,
    .rs-saved-card:has(input:checked) .rs-saved-check,
    .rs-tos input:checked { animation: none !important; }
    .rs-gateway, .rs-saved-card, .rs-cycle, .rs-btn { transform: none !important; }
    .rs-cycle-savings { transition: none; opacity: 1; transform: none; }
}

/* --- Complete Order loading state ----------------------------------------- */
.rs-btn.is-loading { pointer-events: none; opacity: .92; }
.rs-spin {
    width: 14px; height: 14px; flex: 0 0 auto;
    border: 2px solid #ffffff55; border-top-color: var(--white);
    border-radius: 50%; display: inline-block; margin-right: .5rem;
    animation: rsSpin .7s linear infinite; vertical-align: -2px;
}
@keyframes rsSpin { to { transform: rotate(360deg); } }
.rs-submit-msg { display: inline-block; }
@media (prefers-reduced-motion: reduce) {
    .rs-spin { animation-duration: 1.6s; }   /* still communicates activity */
}

/* --- order-flow stepper (top of checkout) --------------------------------- */
.rs-flow {
    display: flex; align-items: center; gap: .625rem;
    list-style: none; margin: 0 0 1.25rem; padding: 0;
}
.rs-flow-step {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: var(--t-label); font-weight: 500; color: var(--text-muted);
    white-space: nowrap;
}
.rs-flow-step.is-done, .rs-flow-step.is-now { color: var(--text-primary); }
.rs-flow-step.is-now { font-weight: 700; }
.rs-flow-dot {
    width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border-strong); background: var(--bg-card);
    font-size: 9px; color: var(--white);
}
.rs-flow-step.is-done .rs-flow-dot { background: var(--accent); border-color: var(--accent); }
.rs-flow-step.is-now .rs-flow-dot {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 3px var(--bg-card); background: var(--accent);
}
.rs-flow-line { flex: 0 1 56px; height: 1px; background: var(--border-strong); list-style: none; }
@media (max-width: 640px) {
    /* wrap as chips: nowrap labels overflowed 375px viewports */
    .rs-flow { gap: .375rem .875rem; flex-wrap: wrap; }
    .rs-flow-line { display: none; }
    .rs-flow-step { font-size: var(--t-tag); white-space: normal; }
}

/* --- dot grid behind the empty state (see theme custom.css section 22) --- */
.rs-empty {
    background-image:
        radial-gradient(ellipse 55% 60% at 50% 42%, transparent 0%, var(--bg-primary) 74%),
        radial-gradient(#00000021 1px, transparent 1.5px);
    background-size: 100% 100%, 20px 20px;
}

/* --- page gutters on cart pages -------------------------------------------
   Stock + module stylesheets (all.min.css, stripe.css) load late and zero
   #main-body's side padding — invisible on desktop where the centered
   max-width provides space, but on phones the content sat flush against the
   viewport edges. Rather than fight third-party CSS over #main-body, the
   gutters live on .rs-co — our own element, which nothing else styles. */
.rs-co { padding-left: 1.25rem; padding-right: 1.25rem; }
@media (max-width: 575.98px) {
    .rs-co { padding-left: .9375rem; padding-right: .9375rem; }
}

/* phone: price under the product name — side-by-side squeezed the name
   into one-word-per-line wrapping */
@media (max-width: 575.98px) {
    .rs-item-head { flex-direction: column; align-items: flex-start; gap: .375rem; padding-right: 2rem; }
    .rs-item-price { text-align: left; }
}

/* --- collapse the dead space under short product names ---------------------
   The price block (price + cycle + Remove) is taller than a one-line name,
   so the description had to clear the whole header row — leaving a hole
   under the name. Desktop: price block floats to the card corner and the
   specs tuck up under the name. Phones keep the stacked order. */
@media (min-width: 576px) {
    .rs-item-price { position: absolute; top: .875rem; right: 2.25rem; }
    .rs-item:first-of-type .rs-item-price { top: 0; }
    .rs-item-id { padding-right: 190px; }
    .rs-item-desc { margin-top: .5rem; }
}

/* --- IPMI / extra-IP note at the end of the order card --------------------- */
.rs-items-note {
    display: flex; align-items: flex-start; gap: .5rem;
    margin: 1rem 0 0; padding: .625rem .75rem;
    background: var(--bg-surface); border-radius: var(--r-md);
    font-size: var(--t-body); color: var(--text-secondary); line-height: 1.5;
}
.rs-items-note i { margin-top: .15rem; color: var(--text-muted); flex: 0 0 auto; }
.rs-items-note a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* --- live password strength + match ---------------------------------------- */
.rs-pwmeter { display: flex; align-items: center; gap: .5rem; margin-top: .375rem; }
.rs-pwbar {
    flex: 1 1 auto; height: 4px; border-radius: 2px;
    background: var(--gray-150); overflow: hidden;
}
.rs-pwfill {
    display: block; height: 100%; width: 0; border-radius: 2px;
    background: var(--brand-red);
    transition: width .3s var(--ease), background-color .3s var(--ease);
}
.rs-pwmeter[data-lvl="mid"] .rs-pwfill { background: var(--brand-orange); }
.rs-pwmeter[data-lvl="strong"] .rs-pwfill { background: #00875a; }
.rs-pwtext { flex: 0 0 auto; font-size: var(--t-tag); font-weight: 600; min-width: 58px; text-align: right; }
.rs-pwmeter[data-lvl="weak"] .rs-pwtext { color: var(--brand-red); }
.rs-pwmeter[data-lvl="mid"] .rs-pwtext { color: var(--hint-amber-text); }
.rs-pwmeter[data-lvl="strong"] .rs-pwtext { color: #00875a; }

.rs-pwmatch {
    display: inline-flex; align-items: center; gap: .375rem;
    margin-top: .375rem; font-size: var(--t-tag); font-weight: 600;
}
.rs-pwmatch[data-state="ok"] { color: #00875a; }
.rs-pwmatch[data-state="no"] { color: var(--brand-red); }

@keyframes rsPopIn { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.rs-popin { animation: rsPopIn .18s var(--ease); }
@media (prefers-reduced-motion: reduce) {
    .rs-pwfill { transition: none; }
    .rs-popin { animation: none; }
}

/* --- password guidance chips ----------------------------------------------- */
.rs-pwhints { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .5rem; }
.rs-pwhints span {
    font-size: var(--t-micro); font-weight: 600; letter-spacing: .02em;
    padding: .1875rem .5rem; border-radius: 999px;
    background: var(--bg-surface); color: var(--text-muted);
    transition: background-color .2s var(--ease), color .2s var(--ease);
}
.rs-pwhints span.is-ok { background: var(--hint-green); color: #00875a; }
.rs-pwhints span.is-ok::before { content: "✓ "; }

/* --- "server not available" page (store route, see products.tpl) ----------- */
.rs-unavailable-sub {
    max-width: 42ch; margin: 0 0 .5rem; text-align: center;
    color: var(--text-secondary); font-size: var(--t-body-lg); line-height: 1.55;
}
.rs-unavailable-help {
    margin: 1rem 0 0; font-size: var(--t-body); color: var(--text-muted); text-align: center;
}

/* --- order complete -------------------------------------------------------- */
.rs-complete {
    max-width: 560px; margin: 2.5rem auto 3rem; padding: 0 1rem;
    display: flex; flex-direction: column; align-items: center; gap: .875rem;
    text-align: center;
    background-image:
        radial-gradient(ellipse 70% 55% at 50% 18%, transparent 0%, var(--bg-primary) 74%),
        radial-gradient(#00000021 1px, transparent 1.5px);
    background-size: 100% 100%, 20px 20px;
}
.rs-complete-mark {
    width: 56px; height: 56px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hint-green); color: #00875a; font-size: 22px;
    animation: rsPop .35s var(--ease) both;
}
.rs-complete h1 { font-size: var(--t-section); letter-spacing: -.02em; margin: 0; }
.rs-complete-sub { margin: 0; color: var(--text-secondary); font-size: var(--t-body-lg); }
.rs-complete-order {
    padding: .4375rem .875rem; border-radius: 999px;
    background: var(--bg-card); border: 1px solid var(--border-active);
    font-size: var(--t-body); color: var(--text-secondary);
}
.rs-complete-order b { color: var(--text-heading); font-weight: 600; }
.rs-flow--complete { margin: .5rem 0; }
.rs-flow--complete .rs-flow-step.is-now .rs-flow-dot { animation: rsPulse 2.4s var(--ease) infinite; }
.rs-complete-pay {
    background: var(--hint-amber); border-radius: var(--r-md);
    padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .75rem;
    align-items: center;
}
.rs-complete-pay p { margin: 0; color: var(--hint-amber-text); font-size: var(--t-body-lg); }
.rs-complete-pay .rs-btn { text-decoration: none; }
.rs-complete-next { margin: 0; color: var(--text-secondary); font-size: var(--t-body-lg); max-width: 46ch; }
.rs-complete-cta { margin-top: .625rem; }
@media (prefers-reduced-motion: reduce) {
    .rs-complete-mark, .rs-flow--complete .rs-flow-step.is-now .rs-flow-dot { animation: none !important; }
}
