/* =====================================================================================================
   redswitches-v4 · sign-in, sign-up and password-reset pages in the V29 design. v4-only file.
   ROOT: .rxd4-auth on .rs-auth-wrap, added by login.tpl / clientregister.tpl / password-reset-container.tpl only when
   $template == 'redswitches-v4'; the link sits in includes/rs-auth-brand.tpl behind the same test, so v2/v3 render
   exactly as before. These pages are signed out: no shell and none of the rx-dark-*.css files, so this file carries the
   V29 type and BOTH palettes for them (uiux/V29-DESIGN-SPEC.md §1-§5): Light below, Dark at the end, switched on by
   <html data-theme="dark"> (header.tpl applies the saved choice before first paint on these three screens too).
   Form names, ids, actions, captcha and linked-account markup are WHMCS's own and untouched; this file only restyles.
   Colours only through the --au-* tokens below (tests/rxd4_static_test.php S4).
   ===================================================================================================== */

.rxd4-auth{
  /* V29 Light */
  --au-ink:#111827;--au-ink-2:#374151;--au-mut:#6b7280;--au-main:#fff;--au-card:#fff;--au-soft:#f7f8fa;--au-line:#e5e7eb;--au-line-2:#d1d5db;--au-line-h:#b8bec8;
  --au-navy:#14123f;--au-navy-h:#26236a;--au-on-navy:#fff;--au-acc:#4f46e5;--au-link:#4f46e5;--au-ring:0 0 0 3px rgba(79,70,229,.15);
  --au-red:#d23c4b;--au-red-ink:#8a1c28;--au-red-soft:#fdeef0;--au-red-line:#f5c2c8;
  --au-ok:#0e9f6e;--au-ok-ink:#05603f;--au-ok-text:#047857;--au-ok-soft:#e8f6f1;--au-ok-tag:#ecfdf5;
  --au-amber-dot:#d97706;--au-amber-ink:#7a3e05;--au-amber-tag-ink:#92400e;--au-amber-soft:#fff7e8;--au-amber-line:#f3d39b;
  --au-acc-ink:#3730a3;--au-acc-soft:#eef0ff;
  /* the V29 dark panel (always dark) */
  --au-dk-bg:radial-gradient(520px 300px at 100% -10%,rgba(253,14,56,.2),transparent 70%),radial-gradient(480px 320px at -10% 115%,rgba(56,59,248,.24),transparent 70%),#0e0d1a;
  --au-dk-line:rgba(255,255,255,.08);--au-dk-ink:#fff;--au-dk-mut:#a6a9b6;
  /* custom.css tokens the stock auth markup reads, re-pointed at V29 */
  --font:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;--mono:"IBM Plex Sans","Inter",system-ui,sans-serif;
  --text-primary:#111827;--text-secondary:#374151;--text-muted:#6b7280;--text-heading:#111827;
  --bg-primary:#fff;--bg-card:#fff;--bg-surface:#f7f8fa;--bg-card-hover:#f9fafb;
  --border:#e5e7eb;--border-hover:#b8bec8;--border-active:#d1d5db;--border-strong:#d1d5db;
  --accent:#14123f;--brand-red:#d23c4b;--brand-orange:#d97706;
  --hint-green:#e8f6f1;--hint-green-text:#05603f;--hint-pink:#fdeef0;--hint-pink-text:#8a1c28;--hint-amber:#fff7e8;--hint-amber-text:#7a3e05;
  --t-section:28px;--t-card:17px;--t-label:12px;--t-tag:11px;--t-micro:11px;--t-btn:14px;--t-stat:28px;
  font-family:var(--font);font-size:14px;line-height:1.5;color:var(--au-ink);-webkit-font-smoothing:antialiased
}
.rxd4-auth .rs-auth-main{background:var(--au-main)}

/* ---------- brand panel: the V29 dark panel ---------- */
.rxd4-auth .rs-auth-brand{background:var(--au-dk-bg);border-right:1px solid var(--au-dk-line)}
.rxd4-auth .rs-auth-logo{font:700 15px/1.45 var(--font);letter-spacing:-.01em}
.rxd4-auth .rs-auth-eyebrow{font:500 12.5px/1.45 var(--font);letter-spacing:0;text-transform:none;color:var(--au-dk-mut)}
.rxd4-auth .rs-auth-brand h1{font:700 28px/1.2 var(--font);letter-spacing:-.02em;color:var(--au-dk-ink)!important;text-wrap:balance}
.rxd4-auth .rs-auth-stats > div{border-color:var(--au-dk-line)}
.rxd4-auth .rs-auth-stats span{font:500 12px/1.2 var(--font);letter-spacing:0;text-transform:none;color:var(--au-dk-mut);margin-bottom:6px}
.rxd4-auth .rs-auth-stats b{font:500 13px/1.45 var(--font);color:var(--au-dk-ink)}
.rxd4-auth .rs-auth-foot{font:400 12.5px/1.45 var(--font);color:var(--au-dk-mut)}

/* ---------- card: page title, labels, fields ---------- */
.rxd4-auth .rs-auth-card h2{font:700 28px/1.15 var(--font);letter-spacing:-.015em;color:var(--au-ink);margin:0 0 4px}
.rxd4-auth .rs-auth-sub{font-size:14px;line-height:1.5;color:var(--au-mut)}
.rxd4-auth .rs-auth-card .rs-field label{font:400 12px/1.45 var(--font);color:var(--au-ink-2);margin-bottom:4px}
.rxd4-auth .rs-auth-card .rs-req{color:var(--au-red)}
.rxd4-auth .rs-auth-card .rs-opt{color:var(--au-mut)}
.rxd4-auth .rs-auth-forgot{font:500 12.5px/1.45 var(--font);color:var(--au-link)!important}
.rxd4-auth .rs-auth-card :is(.form-control,.custom-select,select,input[type=text],input[type=email],input[type=password],input[type=tel]){height:44px;padding:0 12px;border:1px solid var(--au-line-2);border-radius:8px;background-color:var(--au-card);color:var(--au-ink);font:400 14px/1.3 var(--font);box-shadow:none}
.rxd4-auth .rs-auth-card :is(.form-control,.custom-select,select,input):focus{outline:0;border-color:var(--au-acc);box-shadow:var(--au-ring)}
.rxd4-auth .rs-auth-card .form-control::placeholder{color:var(--au-mut)}
.rxd4-auth .rs-auth-card .input-group-text{border-color:var(--au-line-2);background:var(--au-soft);color:var(--au-mut)}
.rxd4-auth :is(.rs-auth-remember,.rs-auth-card .form-check-label,.rs-auth-card label.checkbox){font:400 13.5px/1.45 var(--font);color:var(--au-ink)}
.rxd4-auth .rs-auth-card input:is([type=checkbox],[type=radio]){width:18px;height:18px;accent-color:var(--au-acc)}
.rxd4-auth .rs-auth-div{font:400 12.5px/1.45 var(--font);color:var(--au-mut)}
.rxd4-auth .rs-auth-div::before,.rxd4-auth .rs-auth-div::after{border-top-color:var(--au-line)}
.rxd4-auth .rs-auth-alt{font-size:13px;color:var(--au-mut)}
.rxd4-auth .rs-auth-alt a,.rxd4-auth .rs-auth-card a:not(.btn):not(.rs-auth-mlogo){color:var(--au-link);font-weight:500}
.rxd4-auth .rs-auth-card :focus-visible{outline:2px solid var(--au-acc);outline-offset:2px}

/* ---------- buttons: primary navy 40px, secondary (Google) 40px, 14/600, r8 ---------- */
.rxd4-auth .rs-auth-card .btn{min-height:40px;padding:0 14px;border-radius:8px!important;font:600 14px/1.35 var(--font);box-shadow:none}
.rxd4-auth :is(.rs-auth-submit,.rs-auth-submit:focus){display:flex;align-items:center;justify-content:center;width:100%;min-height:40px;padding:0 14px;background:var(--au-navy)!important;border:1px solid var(--au-navy)!important;color:var(--au-on-navy)!important;font:600 14px/1.35 var(--font)}
.rxd4-auth .rs-auth-submit:hover{background:var(--au-navy-h)!important;border-color:var(--au-navy-h)!important}
.rxd4-auth .rs-auth-google :is(a,button){min-height:40px;padding:0 14px!important;border:1px solid var(--au-line-2)!important;border-radius:8px!important;background:var(--au-card)!important;color:var(--au-ink)!important;font:600 14px/1.35 var(--font)}
.rxd4-auth .rs-auth-google :is(a,button):hover{background:var(--au-soft)!important;border-color:var(--au-line-h)!important}

/* ---------- notices: V29 alert palette (r10) ---------- */
.rxd4-auth .rs-auth-card .alert{border-radius:10px;padding:10px 12px;font-size:13.5px;line-height:1.45}
.rxd4-auth .rs-auth-card .alert-success{background:var(--au-ok-soft);border-color:var(--au-ok-soft);color:var(--au-ok-ink)}
.rxd4-auth .rs-auth-card .alert-danger{background:var(--au-red-soft);border-color:var(--au-red-line);color:var(--au-red-ink)}
.rxd4-auth .rs-auth-card .alert-warning{background:var(--au-amber-soft);border-color:var(--au-amber-line);color:var(--au-amber-ink)}
.rxd4-auth .rs-auth-card .alert-info{background:var(--au-acc-soft);border-color:var(--au-acc-soft);color:var(--au-acc-ink)}
.rxd4-auth .rs-tax-note{border-radius:10px;padding:8px 12px;font-size:12.5px;line-height:1.45;color:var(--au-amber-ink);background:var(--au-amber-soft);border-color:var(--au-amber-line)}
.rxd4-auth .rs-tax-note svg{color:var(--au-amber-dot)}
.rxd4-auth .rs-tax-note b{font-weight:600}

/* ---------- password strength, match and hint tags ---------- */
.rxd4-auth .rs-pwbar{background:var(--au-line)}
.rxd4-auth .rs-pwfill{background:var(--au-red)}
.rxd4-auth .rs-pwmeter[data-lvl="mid"] .rs-pwfill{background:var(--au-amber-dot)}
.rxd4-auth .rs-pwmeter[data-lvl="strong"] .rs-pwfill{background:var(--au-ok)}
.rxd4-auth :is(.rs-pwtext,.rs-pwmatch){font:600 11px/1.2 var(--font)}
.rxd4-auth :is(.rs-pwmeter[data-lvl="weak"] .rs-pwtext,.rs-pwmatch[data-state="no"]){color:var(--au-red)}
.rxd4-auth .rs-pwmeter[data-lvl="mid"] .rs-pwtext{color:var(--au-amber-tag-ink)}
.rxd4-auth :is(.rs-pwmeter[data-lvl="strong"] .rs-pwtext,.rs-pwmatch[data-state="ok"]){color:var(--au-ok-text)}
.rxd4-auth .rs-pwhints span{font:600 11px/1.2 var(--font);letter-spacing:0;padding:2px 7px;border-radius:6px;background:var(--au-soft);color:var(--au-mut)}
.rxd4-auth .rs-pwhints span.is-ok{background:var(--au-ok-tag);color:var(--au-ok-ink)}

/* phones: 44px touch targets */
@media (max-width:860px){
  .rxd4-auth :is(.rs-auth-card .btn,.rs-auth-submit,.rs-auth-google a,.rs-auth-google button){min-height:44px}
}

/* ---------- V4.1 responsive (A1/A2, FOUNDATION.md): layout from the auth page's own width, not viewport jumps ----------
   The wrap (.rs-auth-wrap.rxd4-auth) is the rx-auth container: brand panel + form side by side from 960px, the form alone
   (with its phone wordmark) below. It replaces custom.css's viewport 900px split and this file's old 44px/1100px heading.
   No viewport surface lives inside the wrap: the captcha badge is put in normal flow below, the Google One Tap prompt and
   intl-tel-input's list are not fixed descendants of it. */
.rs-auth-wrap.rxd4-auth{container:rx-auth/inline-size;display:flex;align-items:stretch}
.rs-auth-wrap.rxd4-auth > .rs-auth-brand{display:none;flex:0 0 50%;min-width:0;padding:40px}
.rs-auth-wrap.rxd4-auth > .rs-auth-main{flex:1 1 0;min-width:0}
.rxd4-auth .rs-auth-mlogo{display:block}
@container rx-auth (min-width:960px){
  .rs-auth-wrap.rxd4-auth > .rs-auth-brand{display:flex}
  .rxd4-auth .rs-auth-mlogo{display:none}
}
@container rx-auth (min-width:1200px){
  .rs-auth-wrap.rxd4-auth > .rs-auth-brand{padding:40px 48px}
  .rxd4-auth .rs-auth-brand h1{font-size:32px}
}
/* register's name/phone rows: two columns only when the card itself has room (FOUNDATION S = 480), not a 560px viewport */
.rxd4-auth .rs-auth-card{container:rx-authform/inline-size}
.rxd4-auth .rs-auth-card .rs-field-row{grid-template-columns:minmax(0,1fr);row-gap:0}
@container rx-authform (min-width:480px){.rxd4-auth .rs-auth-card .rs-field-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
/* the entrance animation must not leave a transform behind: a transformed card is the containing block of any
   position:fixed descendant (that is how the captcha badge escaped to the right, A2) */
.rxd4-auth .rs-auth-card{animation-fill-mode:backwards}
/* A2 reCAPTCHA (invisible): Google renders .grecaptcha-badge with inline position:fixed; right:-186px inside the form's
   .g-recaptcha slot. Keep it visible and working, but in normal flow inside that slot above the submit button. */
.rxd4-auth .g-recaptcha{display:block;min-width:0;max-width:100%;margin:4px 0 16px}
.rxd4-auth .grecaptcha-badge{position:static!important;inset:auto!important;max-width:100%;margin:0}
/* WHMCS appends the slot after the submit button: show it above the button (source order and the form are unchanged) */
.rxd4-auth form:has(> .g-recaptcha){display:flex;flex-direction:column}
.rxd4-auth form:has(> .g-recaptcha) > .rs-auth-submit{order:1}
/* 44px hit area for the checkbox labels (Keep me signed in, marketing opt-in, Terms) and the Forgot password link */
@media (max-width:860px),(pointer:coarse){
  .rxd4-auth .rs-auth-remember{min-height:44px;padding-block:8px;margin:0 0 8px}
  .rxd4-auth .rs-auth-forgot{padding-block:12px;margin-block:-12px}
}

/* ---------- V29 Dark (spec §3 Dark column): colour only, shapes and sizes unchanged. Screen only: print stays Light ---------- */
@media screen{
  html[data-theme="dark"] body:has(.rxd4-auth){--au-page:#0d0e13;background:var(--au-page)}
  html[data-theme="dark"] .rxd4-auth{
    --au-ink:#e6e7ec;--au-ink-2:#d4d6de;--au-mut:#a6a9b6;--au-main:#0d0e13;--au-card:#14151b;--au-soft:#1b1d24;--au-line:#2f3240;--au-line-2:#2f3240;--au-line-h:#454857;
    --au-navy:#3ddc97;--au-navy-h:#5fe3a8;--au-on-navy:#07261a;--au-acc:#3ddc97;--au-link:#8ab4ff;--au-ring:0 0 0 3px rgba(61,220,151,.225);
    --au-red:#ef5f5c;--au-red-ink:#ff8f8f;--au-red-soft:#262833;--au-red-line:#ef5f5c;
    --au-ok:#3ddc97;--au-ok-ink:#5fe3a8;--au-ok-text:#3ddc97;--au-ok-soft:#262833;--au-ok-tag:#10261d;
    --au-amber-dot:#f0a43a;--au-amber-ink:#f5b84d;--au-amber-tag-ink:#f5b84d;--au-amber-soft:#1b1d24;--au-amber-line:#f0a43a;
    --au-acc-ink:#8ab4ff;--au-acc-soft:#262833;
    --au-dk-line:#262833;
    --text-primary:#e6e7ec;--text-secondary:#d4d6de;--text-muted:#a6a9b6;--text-heading:#e6e7ec;
    --bg-primary:#0d0e13;--bg-card:#14151b;--bg-surface:#1b1d24;--bg-card-hover:#1b1d24;
    --border:#2f3240;--border-hover:#454857;--border-active:#2f3240;--border-strong:#2f3240;
    --accent:#3ddc97;--brand-red:#ef5f5c;--brand-orange:#f0a43a;
    --hint-green:#262833;--hint-green-text:#5fe3a8;--hint-pink:#262833;--hint-pink-text:#ff8f8f;--hint-amber:#1b1d24;--hint-amber-text:#f5b84d;
    color-scheme:dark
  }
  /* the phone wordmark is navy: the same white-out the brand panel uses */
  html[data-theme="dark"] .rxd4-auth .rs-auth-mlogo img{filter:brightness(0) invert(1)}
  /* phone-number country list (intl-tel-input) */
  html[data-theme="dark"] .rxd4-auth .iti__country-list{background:var(--au-card);border-color:var(--au-line);color:var(--au-ink)}
  html[data-theme="dark"] .rxd4-auth .iti__country.iti__highlight{background:var(--au-soft)}
  html[data-theme="dark"] .rxd4-auth .iti__dial-code{color:var(--au-mut)}
}

/* ---------- two-step verification (two-factor-challenge.tpl): the security module's own {$challenge} markup ---------- */
.rxd4-auth .rs-2fa-card .w-hidden{display:none}
.rxd4-auth .rs-2fa-challenge{display:flex;flex-direction:column;gap:12px;text-align:left}
.rxd4-auth .rs-2fa-challenge br{display:none}
.rxd4-auth .rs-2fa-challenge :is(center,[align]){text-align:left}
.rxd4-auth .rs-2fa-challenge :is(input[type=text],input[type=tel],input[type=number],input[type=password],.form-control){width:100%!important;max-width:none!important;height:52px;padding:0 12px;border:1px solid var(--au-line-2);border-radius:8px;background:var(--au-card);color:var(--au-ink);font:600 22px/1 var(--font)!important;letter-spacing:.25em;text-align:center;box-shadow:none}
.rxd4-auth .rs-2fa-challenge :is(input,.form-control):focus{outline:0;border-color:var(--au-acc);box-shadow:var(--au-ring)}
.rxd4-auth .rs-2fa-challenge :is(input[type=submit],button[type=submit],.btn){display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;margin:0;padding:0 14px;border-radius:8px!important;background:var(--au-navy)!important;border:1px solid var(--au-navy)!important;color:var(--au-on-navy)!important;font:600 14px/1.35 var(--font);box-shadow:none}
.rxd4-auth .rs-2fa-challenge :is(input[type=submit],button[type=submit],.btn):hover{background:var(--au-navy-h)!important;border-color:var(--au-navy-h)!important}
.rxd4-auth .rs-2fa-card #frmTwoFactorBackup .rs-auth-alt{margin-top:1rem}
