/**
 * AIO ERP — Unified Auth Design System (Option A: marketing shell)
 * login · register · password · 2FA · oauth consent
 *
 * Product pattern (2026-08-09):
 * - body.auth-page only (admin ERP chrome untouched)
 * - Login: balanced two-pane (~50/50)
 * - Register: wider form column (~40/60), short sticky hero, form scrolls
 * - ONE step UI: progress bar + step labels (tabs restyled, not dual chrome)
 * - Equal control height: 40px for input / select2 / phone / file / primary CTA
 * - Buttons: tw-dw-btn; fields: .auth-field + .auth-input
 * - Select2: select2_register + dropdownCssClass auth-select2-dropdown
 */

/* ── Tokens ── */
:root {
  --ab-ink-master: #0A1733;
  --ab-navy: #1E3A6F;
  --ab-blue: #1E3A6F;
  --ab-blue-dark: #142849;
  --ab-blue-light: #EEF2F9;
  --ab-gold: #D4A24C;
  --ab-gold-dark: #B8862E;
  --ab-ink: #0A1733;
  --ab-ink-60: #3D4D6B;
  --ab-ink-30: #7A8AA6;
  --ab-ink-08: rgba(10, 23, 51, 0.08);
  --ab-paper: #F6F8FB;
  --ab-white: #ffffff;
  --ab-border: #E5E9F0;
  --ab-border-md: #D5DBE5;
  --ab-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --ab-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --ab-shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --ab-r-sm: 6px;
  --ab-r-md: 10px;
  --ab-r-lg: 16px;
  --ab-r-xl: 24px;
  --ab-f-body: "Inter", system-ui, -apple-system, sans-serif;
  /* Single height for ALL interactive form controls on auth */
  --auth-control-h: 40px;
  --auth-field-gap: 12px;
  --auth-label-size: 12px;
  --auth-control-size: 14px;
  --auth-ph-size: 14px; /* match control text — no 13.5/16 mix */
  --auth-ring: 0 0 0 3px rgba(30, 58, 111, 0.12);
  --auth-border-w: 1.5px;
}

/* ── Page isolation — beat app.css / foundation form globals ── */
body.auth-page {
  /* Override admin --input-height so equal-height law wins */
  --input-height: var(--auth-control-h) !important;
  font-family: var(--ab-f-body);
  background: var(--ab-paper) !important;
  color: var(--ab-ink);
  max-width: 100%;
  overflow-x: clip;
}
body.auth-page .right-col {
  background: none !important;
  padding: 0 !important;
}
body.auth-page .container-fluid,
body.auth-page .row.eq-height-row {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
body.auth-page .row.eq-height-row > [class*="col-"] {
  padding: 0 !important;
  float: none !important;
  width: 100% !important;
}

.skip-to-content {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--ab-navy);
  color: #fff;
  border-radius: 0 0 4px 4px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-to-content:focus { top: 0; outline: 3px solid var(--ab-gold); outline-offset: 2px; }

/* ── Shell ── */
body.auth-page .auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 0px))
           max(16px, env(safe-area-inset-right, 0px))
           max(20px, env(safe-area-inset-bottom, 0px))
           max(16px, env(safe-area-inset-left, 0px));
  background-color: var(--ab-paper);
  background-image:
    radial-gradient(circle, rgba(212, 162, 76, 0.45) 0, rgba(212, 162, 76, 0.45) 1px, transparent 1.6px),
    linear-gradient(rgba(30, 58, 111, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 58, 111, 0.045) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px, 56px 56px;
  position: relative;
  overflow-x: clip;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
}
body.auth-page .auth-shell::before,
body.auth-page .auth-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}
body.auth-page .auth-shell::before {
  width: min(520px, 120vw);
  height: min(520px, 120vw);
  background: var(--ab-blue);
  opacity: 0.05;
  top: -160px;
  right: -80px;
}
body.auth-page .auth-shell::after {
  width: min(380px, 100vw);
  height: min(380px, 100vw);
  background: var(--ab-gold);
  opacity: 0.05;
  bottom: -120px;
  left: -80px;
}

/* ── Card ── */
body.auth-page .auth-card {
  width: 100%;
  max-width: min(1060px, 100%);
  background: var(--ab-white);
  border-radius: var(--ab-r-xl);
  border: 1px solid var(--ab-border);
  box-shadow: var(--ab-shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr; /* login balanced */
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  margin: 0 auto;
  align-items: stretch;
}
/* Option A register: wider form column (~40 / 60) */
body.auth-page .auth-card.register-card {
  grid-template-columns: 0.85fr 1.15fr;
  max-height: min(92vh, 900px);
}

/* ── Hero (shared login + register) ── */
body.auth-page .auth-hero {
  position: relative;
  background:
    radial-gradient(circle at 82% 18%, rgba(212, 162, 76, 0.28), transparent 46%),
    radial-gradient(circle at 12% 88%, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(155deg, #0A1733 0%, #142849 52%, #1E3A6F 100%);
  color: #fff;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
body.auth-page .auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/aio-nexus/patterns/hero_bg_dark_1920x1080.jpg") center/cover no-repeat;
  opacity: 0.5;
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none;
}
body.auth-page .auth-hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(212, 162, 76, 0.22), transparent 65%);
  border-radius: 50%;
  bottom: 32px;
  left: -48px;
  z-index: -1;
  pointer-events: none;
}
body.auth-page .auth-hero > * { position: relative; z-index: 1; }

body.auth-page .auth-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}
body.auth-page .auth-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
body.auth-page .auth-brand-link img {
  width: 40px;
  height: 40px;
  border-radius: var(--ab-r-md);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
body.auth-page .auth-brand-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
}
body.auth-page .auth-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
body.auth-page .auth-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
  width: fit-content;
}
body.auth-page .auth-hero-title {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
body.auth-page .auth-hero-sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  margin: 0 0 20px;
  max-width: 34em;
}
body.auth-page .auth-hero-bullets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.auth-page .auth-hero-bullet {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--ab-r-md);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
}
body.auth-page .auth-hero-bullet-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
body.auth-page .auth-hero-bullet-t {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.25;
}
body.auth-page .auth-hero-bullet-d {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  line-height: 1.4;
}
body.auth-page .auth-hero-stats { display: none; } /* slim ERP hero by default */

/* ── Form panel ── */
body.auth-page .auth-form {
  padding: 28px 28px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--ab-white);
  overflow-y: auto;
  position: relative;
}
body.auth-page .register-card .auth-form {
  max-height: min(92vh, 900px);
  overflow-y: auto;
}
body.auth-page .register-card .auth-hero {
  /* Short sticky hero — does not stretch empty navy with form height */
  position: sticky;
  top: 0;
  align-self: stretch;
  max-height: min(92vh, 900px);
  overflow: hidden;
}
body.auth-page .auth-form-inner {
  width: 100%;
  max-width: 400px;
}
body.auth-page .auth-form-inner--wide,
body.auth-page .register-card .auth-form-inner {
  max-width: 520px;
}

body.auth-page .auth-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--ab-blue-light);
  color: var(--ab-blue);
  border: 1px solid rgba(30, 58, 111, 0.18);
  margin-bottom: 10px;
}
body.auth-page .auth-form-title {
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ab-ink);
  margin: 0 0 6px;
}
body.auth-page .auth-form-sub {
  font-size: 13px;
  color: var(--ab-ink-60);
  line-height: 1.45;
  margin: 0 0 16px;
}
body.auth-page .auth-header-center { text-align: center; margin-bottom: 4px; }
body.auth-page .register-multi-biz-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ab-ink-30);
  margin: -8px 0 14px;
}

/* ── Neutralize Bootstrap/AdminLTE form chrome on auth ── */
body.auth-page .form-group {
  margin: 0 !important;
  padding: 0 !important;
}
body.auth-page .has-feedback .form-control { padding-right: 14px !important; }
body.auth-page .help-block {
  display: block;
  margin: 4px 0 0 !important;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--danger, #ef4444);
  line-height: 1.35;
}
body.auth-page label.error {
  display: block;
  margin: 4px 0 0 !important;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--danger, #ef4444);
}

/* ── Field primitive (login + register) ── */
body.auth-page .auth-field {
  position: relative;
  margin: 0 0 var(--auth-field-gap) !important;
}
body.auth-page .auth-field-label,
body.auth-page .auth-field > label,
body.auth-page .auth-field .control-label {
  display: block !important;
  font-size: var(--auth-label-size) !important;
  font-weight: 600 !important;
  color: var(--ab-ink) !important;
  line-height: 1.3 !important;
  margin: 0 0 5px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
body.auth-page .auth-field-hint {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ab-ink-60);
}
body.auth-page .auth-field-wrap {
  position: relative;
  display: block;
  width: 100%;
}
body.auth-page .auth-field-wrap .input-icon-left {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 40px !important;
  min-width: 40px !important;
  height: var(--auth-control-h) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ab-ink-30) !important;
  font-size: 13px !important;
  z-index: 5;
  pointer-events: none;
  box-shadow: none !important;
  border-radius: 0 !important;
}
body.auth-page .auth-field-wrap:focus-within .input-icon-left,
body.auth-page .auth-field-wrap:focus-within .input-group-addon {
  color: var(--ab-blue) !important;
}

/*
 * EQUAL HEIGHT LAW — every interactive form control is --auth-control-h (40px).
 * Beats app.css / foundation / intl-tel-input with higher specificity + !important.
 */
body.auth-page .auth-card .form-control:not(textarea):not(.select2-search__field),
body.auth-page .auth-card input.form-control,
body.auth-page .auth-card input.auth-input,
body.auth-page .auth-card select.form-control,
body.auth-page .auth-card .auth-input,
body.auth-page .auth-input,
body.auth-page .auth-card .select2-container--default .select2-selection--single,
body.auth-page .auth-card .select2-container .select2-selection--single,
body.auth-page .auth-card .auth-phone,
body.auth-page .auth-card .register-phone-shell,
body.auth-page .auth-card .aio-phone-group.auth-phone,
body.auth-page .auth-card .register-file-shell,
body.auth-page .auth-card .tab-navigation-buttons .tw-dw-btn,
body.auth-page .auth-card .register-nav-btn,
body.auth-page .auth-form-inner:not(.auth-form-inner--wide) form > .tw-dw-btn-primary,
body.auth-page .auth-form-inner:not(.auth-form-inner--wide) form > button[type="submit"].tw-dw-btn {
  height: var(--auth-control-h) !important;
  min-height: var(--auth-control-h) !important;
  max-height: var(--auth-control-h) !important;
  box-sizing: border-box !important;
}

/* Text / password / email / tel controls */
body.auth-page .auth-card .form-control:not(textarea):not(.select2-search__field),
body.auth-page .auth-card .auth-input,
body.auth-page .auth-input {
  width: 100% !important;
  padding: 0 12px 0 40px !important;
  border: var(--auth-border-w) solid var(--ab-border-md) !important;
  border-width: var(--auth-border-w) !important;
  border-style: solid !important;
  border-color: var(--ab-border-md) !important;
  border-radius: var(--ab-r-md) !important;
  background: #fff !important;
  color: var(--ab-ink) !important;
  font-family: var(--ab-f-body) !important;
  font-size: var(--auth-control-size) !important;
  font-weight: 400 !important;
  line-height: calc(var(--auth-control-h) - 3px) !important;
  box-shadow: var(--ab-shadow-sm) !important;
  outline: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Phone: no left icon padding — flag strip owns the left chrome */
body.auth-page .auth-card .auth-phone .form-control,
body.auth-page .auth-card .auth-phone .auth-input,
body.auth-page .auth-card .auth-phone input.aio-phone-input,
body.auth-page .auth-card .auth-phone #mobile_input {
  padding: 0 12px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  border: 0 !important;
  border-width: 0 !important;
  box-shadow: none !important;
  font-size: var(--auth-control-size) !important;
}
body.auth-page .auth-card .form-control:not(textarea)::placeholder,
body.auth-page .auth-card .auth-input::placeholder {
  color: var(--ab-ink-30) !important;
  font-size: var(--auth-ph-size) !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}
html body.auth-page .auth-card .form-control:not(textarea):focus,
html body.auth-page .auth-card .form-control:not(textarea):focus-visible,
html body.auth-page .auth-card .auth-input:focus,
html body.auth-page .auth-card .auth-input:focus-visible,
body.auth-page .auth-card .form-control:not(textarea):focus,
body.auth-page .auth-card .form-control:not(textarea):focus-visible,
body.auth-page .auth-card .auth-input:focus,
body.auth-page .auth-card .auth-input:focus-visible {
  border: var(--auth-border-w) solid var(--ab-blue) !important;
  border-color: var(--ab-blue) !important;
  box-shadow: var(--auth-ring) !important;
  /* Do not force white — dark mode keeps #0f172a surface */
  outline: none !important;
}
body.auth-page .auth-card .has-error .form-control:not(textarea),
body.auth-page .auth-card .has-error .auth-input,
body.auth-page .auth-card .has-error .select2-selection--single {
  border-color: var(--danger, #ef4444) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

body.auth-page .auth-input-pwd { padding-right: 44px !important; }
body.auth-page .auth-pwd-toggle,
body.auth-page .register-pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--ab-ink-60);
  padding: 6px;
  border-radius: var(--ab-r-sm);
  cursor: pointer;
  z-index: 6;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
body.auth-page .auth-pwd-toggle:hover,
body.auth-page .register-pwd-toggle:hover {
  color: var(--ab-ink);
  background: var(--ab-ink-08);
}

/* ── 2-column grid — true equal halves (Select2 must not expand tracks) ── */
body.auth-page .auth-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: var(--auth-field-gap) 14px;
  margin: 0 0 var(--auth-field-gap);
  align-items: start;
  width: 100%;
}
body.auth-page .auth-grid > *,
body.auth-page .auth-grid > .auth-field,
body.auth-page .auth-grid > div {
  min-width: 0 !important;
  max-width: 100% !important;
}
body.auth-page .auth-grid > .auth-field,
body.auth-page .auth-grid .auth-field { margin-bottom: 0 !important; }
/* Flatten extra wrappers used for cascade show/hide */
body.auth-page .auth-grid > div > .auth-field { margin-bottom: 0 !important; }
body.auth-page .auth-grid + .auth-grid { margin-top: 0; }
body.auth-page .auth-grid--1 { grid-template-columns: minmax(0, 1fr) !important; }
body.auth-page .auth-span-2 { grid-column: 1 / -1; }

/* Bootstrap row remnants if any remain — dense + no double gutters */
body.auth-page .auth-form .row {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: var(--auth-field-gap) 14px;
  margin: 0 0 var(--auth-field-gap) !important;
}
body.auth-page .auth-form .row > [class*="col-"] {
  float: none !important;
  width: auto !important;
  padding: 0 !important;
  min-height: 0 !important;
}
body.auth-page .auth-form .row > .col-xs-12:only-child,
body.auth-page .auth-form .row > .col-md-12 {
  grid-column: 1 / -1;
}

/* ── Select2 (register + any auth select) ── */
body.auth-page .auth-card .select2-container,
body.auth-page .auth-card .select2-container--default {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: block !important;
}
body.auth-page .auth-card .select2-container .selection { display: block; width: 100%; }
body.auth-page .auth-card .auth-field-wrap > .select2-container {
  width: 100% !important;
  min-width: 0 !important;
}
body.auth-page .auth-card .select2-container--default .select2-selection--single,
body.auth-page.register-cms-page .auth-card .select2-container--default .select2-selection--single,
body.auth-page .auth-card .select2-container .select2-selection--single {
  display: flex !important;
  align-items: center !important;
  /* height set by EQUAL HEIGHT LAW above */
  max-height: var(--auth-control-h) !important;
  border: var(--auth-border-w) solid var(--ab-border-md) !important;
  border-width: var(--auth-border-w) !important;
  border-style: solid !important;
  border-color: var(--ab-border-md) !important;
  border-radius: var(--ab-r-md) !important;
  background: #fff !important;
  box-shadow: var(--ab-shadow-sm) !important;
  padding: 0 32px 0 0 !important;
  outline: none !important;
}
body.auth-page .auth-card .select2-container--default .select2-selection--single .select2-selection__rendered,
body.auth-page .auth-card .select2-container .select2-selection--single .select2-selection__rendered {
  line-height: calc(var(--auth-control-h) - 3px) !important;
  padding: 0 8px 0 40px !important;
  color: var(--ab-ink) !important;
  font-size: var(--auth-control-size) !important;
  font-weight: 400 !important;
}
body.auth-page .auth-card .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--ab-ink-30) !important;
  font-size: var(--auth-ph-size) !important;
}
body.auth-page .auth-card .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: var(--auth-control-h) !important;
  width: 28px !important;
  right: 4px !important;
  top: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body.auth-page .auth-card .select2-container--default .select2-selection--single .select2-selection__arrow b {
  display: none !important;
}
body.auth-page .auth-card .select2-container--default .select2-selection--single .select2-selection__arrow::after {
  content: "\f078";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 10px;
  color: var(--ab-ink-30);
}
body.auth-page .auth-card .select2-container--default.select2-container--focus .select2-selection--single,
body.auth-page .auth-card .select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--ab-blue) !important;
  box-shadow: var(--auth-ring) !important;
}
body.auth-page .auth-card .select2-container--disabled .select2-selection--single {
  background: #f8fafc !important;
  color: var(--ab-ink-30) !important;
  cursor: not-allowed !important;
  opacity: 0.85;
}
body.auth-page .auth-card .select2-container--disabled .select2-selection__rendered {
  color: var(--ab-ink-30) !important;
  font-style: italic;
}

/* Body-appended dropdown (auth-select2-dropdown) */
body .auth-select2-dropdown.select2-dropdown,
body .select2-dropdown.auth-select2-dropdown {
  border: 1.5px solid var(--ab-border-md) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
  overflow: hidden;
  z-index: 1300 !important;
  margin-top: 4px;
  background: #fff !important;
}
body .auth-select2-dropdown .select2-search--dropdown { padding: 8px; }
body .auth-select2-dropdown .select2-search__field {
  border: var(--auth-border-w, 1.5px) solid var(--ab-border-md) !important;
  border-radius: 8px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  font-size: 14px !important;
  padding: 0 12px !important;
  color: var(--ab-ink) !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}
body .auth-select2-dropdown .select2-search__field:focus {
  border-color: var(--ab-blue) !important;
  box-shadow: var(--auth-ring) !important;
}
body .auth-select2-dropdown .select2-results__options {
  max-height: 240px;
  padding: 4px 6px 6px;
}
body .auth-select2-dropdown .select2-results__option {
  border-radius: 8px;
  min-height: 40px !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--ab-ink) !important;
  margin: 1px 0;
  line-height: 1.35;
  box-sizing: border-box !important;
}
body .auth-select2-dropdown .select2-results__option[aria-selected="true"] {
  background: rgba(30, 58, 111, 0.08) !important;
  color: var(--ab-blue-dark) !important;
}
body .auth-select2-dropdown .select2-results__option--highlighted,
body .auth-select2-dropdown .select2-results__option--highlighted[aria-selected],
body .select2-container--default .auth-select2-dropdown .select2-results__option--highlighted {
  background: var(--ab-blue) !important;
  color: #fff !important;
}
body .auth-select2-dropdown .select2-results__option[aria-disabled="true"] {
  color: var(--ab-ink-30) !important;
  cursor: not-allowed;
}

/* ── Phone — single equal-height control (flag strip + number) ── */
body.auth-page .auth-phone,
body.auth-page .auth-card .auth-phone.register-phone-shell,
body.auth-page .auth-card .auth-phone.aio-phone-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: 100% !important;
  border: 1.5px solid var(--ab-border-md) !important;
  border-radius: var(--ab-r-md) !important;
  background: #fff !important;
  box-shadow: var(--ab-shadow-sm) !important;
  overflow: hidden !important;
  position: relative !important;
  float: none !important;
}
body.auth-page .auth-phone:focus-within {
  border-color: var(--ab-blue) !important;
  box-shadow: var(--auth-ring) !important;
}
body.auth-page .auth-phone .auth-phone-flag,
body.auth-page .auth-phone .aio-phone-country-addon,
body.auth-page .auth-phone > .input-group-addon {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 52px !important;
  min-width: 52px !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 6px !important;
  border: 0 !important;
  border-right: 1px solid var(--ab-border) !important;
  border-radius: 0 !important;
  background: #f8fafc !important;
  color: var(--ab-ink-60) !important;
  font-size: 14px !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  box-shadow: none !important;
  z-index: 2;
  float: none !important;
}
body.auth-page .auth-phone .form-control,
body.auth-page .auth-phone .auth-input,
body.auth-page .auth-phone .aio-phone-input {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 12px !important;
  background: transparent !important;
  line-height: 1.25 !important;
  font-size: var(--auth-control-size) !important;
}
body.auth-page .auth-phone .form-control:focus,
body.auth-page .auth-phone .auth-input:focus {
  border: 0 !important;
  box-shadow: none !important;
}
/* Hide aio-phone injected country Select2 (keep picker functional via flag click) */
body.auth-page .auth-phone .aio-phone-country-picker,
body.auth-page .auth-phone select.aio-phone-country-picker {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  left: 0 !important;
  bottom: 0 !important;
}
body.auth-page .auth-phone .aio-phone-country-addon .select2-container,
body.auth-page .auth-phone .select2-container {
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
body.auth-page .auth-phone {
  font-size: var(--auth-control-size) !important;
}
/* Kill intl-tel-input / bootstrap input-group layout inside auth phone */
body.auth-page .auth-phone.input-group {
  display: flex !important;
}
body.auth-page .auth-phone .iti,
body.auth-page .auth-phone .iti--allow-dropdown {
  width: 100% !important;
  display: flex !important;
  flex: 1 !important;
}
body.auth-page .auth-phone .iti input {
  height: var(--auth-control-h) !important;
  border: 0 !important;
  padding-left: 12px !important;
}

/* ── File upload ── */
body.auth-page .register-file-shell {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  padding: 0 12px 0 40px !important;
  border: var(--auth-border-w) solid var(--ab-border-md) !important;
  border-width: var(--auth-border-w) !important;
  border-radius: var(--ab-r-md) !important;
  background: #f8fafc !important;
  color: var(--ab-ink-30) !important;
  font-size: var(--auth-control-size) !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: var(--ab-shadow-sm) !important;
}
body.auth-page .register-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100% !important;
}

/* ── Wizard ── */
body.auth-page .register-step-progress { margin: 0 0 12px; }
body.auth-page .register-step-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ab-ink-60);
  margin-bottom: 6px;
}
body.auth-page .register-step-pct { color: var(--ab-blue); }
body.auth-page .register-step-track {
  height: 5px;
  border-radius: 100px;
  background: rgba(30, 58, 111, 0.1);
  overflow: hidden;
}
body.auth-page .register-step-bar {
  display: block;
  height: 100%;
  width: 33%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--ab-blue), var(--ab-blue-dark));
  transition: width 0.25s ease;
}

/* Option A: step labels under progress (not heavy pill chrome) */
body.auth-page .register-tabs.nav-tabs {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px 14px;
  border: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  border-radius: 0;
  padding: 0;
  margin: 0 0 16px !important;
}
body.auth-page .register-tabs > li {
  float: none !important;
  margin: 0 !important;
  flex: 0 0 auto;
}
body.auth-page .register-tabs > li > a {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--ab-ink-30) !important;
  background: transparent !important;
  white-space: nowrap;
  box-shadow: none !important;
}
body.auth-page .register-tabs > li > a i {
  display: none !important; /* text steps only */
}
body.auth-page .register-step-num {
  font-weight: 800;
  color: inherit;
}
body.auth-page .register-tabs > li.active > a,
body.auth-page .register-tabs > li.active > a:hover,
body.auth-page .register-tabs > li.active > a:focus {
  background: transparent !important;
  color: var(--ab-blue) !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
body.auth-page .register-tab-content {
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
body.auth-page .register-tab-content > .tab-pane { display: none; }
body.auth-page .register-tab-content > .tab-pane.active,
body.auth-page .register-tab-content > .active { display: block; }

body.auth-page .register-section-heading {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: var(--ab-ink-60) !important;
  margin: 0 0 10px !important;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ab-border);
}

/* ── Nav buttons ── */
body.auth-page .tab-navigation-buttons {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px !important;
  margin-top: 16px !important;
  padding-top: 14px;
  border-top: 1px solid var(--ab-border);
}
body.auth-page .tab-navigation-buttons .tw-dw-btn,
body.auth-page .register-nav-btn {
  width: auto !important;
  min-width: 112px;
  min-height: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: var(--ab-r-md) !important;
  padding: 0 16px !important;
}
body.auth-page .register-nav-btn[hidden] { display: none !important; }

/* Full-width primary on login — same 40px height as fields */
body.auth-page .auth-form-inner:not(.auth-form-inner--wide) form > .tw-dw-btn-primary,
body.auth-page .auth-form-inner:not(.auth-form-inner--wide) form > button[type="submit"].tw-dw-btn {
  width: 100%;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  /* height forced by EQUAL HEIGHT LAW */
}
body.auth-page .auth-form .auth-sso-row .tw-dw-btn {
  width: auto;
  flex: 1 1 140px;
  min-width: 130px;
  /* height forced by EQUAL HEIGHT LAW */
}

/* ── Login chrome ── */
body.auth-page .auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
}
body.auth-page .auth-remember label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ab-ink-60);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 0 !important;
}
body.auth-page .auth-forgot {
  font-size: 13px;
  font-weight: 600;
  color: var(--ab-blue);
  text-decoration: none;
}
body.auth-page .auth-forgot:hover { text-decoration: underline; }
body.auth-page .auth-more-ways { margin-top: 14px; }
body.auth-page .auth-more-ways-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--ab-border-md);
  border-radius: var(--ab-r-md);
  background: transparent;
  color: var(--ab-ink-60);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
body.auth-page .auth-more-ways-toggle:hover,
body.auth-page .auth-more-ways-toggle.is-open {
  border-color: var(--ab-blue);
  color: var(--ab-blue);
  background: var(--ab-blue-light);
}
body.auth-page .auth-more-ways-panel { margin-top: 12px; }
body.auth-page .auth-more-ways-block + .auth-more-ways-block { margin-top: 12px; }
body.auth-page .auth-sso-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
body.auth-page .auth-create-workspace {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ab-ink-60);
}
body.auth-page .auth-create-workspace a {
  font-weight: 700;
  color: var(--ab-blue);
  text-decoration: none;
}
body.auth-page .auth-create-workspace a:hover { text-decoration: underline; }
body.auth-page .auth-create-workspace-hint {
  margin: 6px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ab-ink-30);
  line-height: 1.4;
}
body.auth-page .auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ab-ink-30);
  margin-top: 12px;
}
body.auth-page .auth-footer-links {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ab-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
}
body.auth-page .auth-footer-links a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ab-ink-60);
  text-decoration: none;
}
body.auth-page .auth-footer-links a:hover { color: var(--ab-blue); }
body.auth-page .auth-bottom-note,
body.auth-page .auth-passport-badge {
  margin-top: 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ab-ink-30);
}
body.auth-page .auth-passport-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
body.auth-page .auth-passport-badge img { width: 16px; height: 16px; }
body.auth-page .trust-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ab-border);
  font-size: 13px;
  color: var(--ab-ink-60);
}
body.auth-page .trust-link {
  color: var(--ab-blue);
  font-weight: 700;
  text-decoration: none;
}
body.auth-page .trust-link:hover { text-decoration: underline; }

/* Status banners */
body.auth-page .auth-status {
  border-radius: var(--ab-r-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  border: 1px solid var(--ab-border);
  background: #f8fafc;
}
body.auth-page .auth-status-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
body.auth-page .auth-status-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
  color: #166534;
}
body.auth-page .auth-status-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}
body.auth-page .auth-status-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.22);
  color: #92400e;
}
body.auth-page .auth-status-info {
  background: rgba(30, 58, 111, 0.06);
  border-color: rgba(30, 58, 111, 0.14);
  color: var(--ab-blue-dark);
}

/* Password strength / match */
body.auth-page .register-pwd-strength { margin-top: 6px; }
body.auth-page .register-pwd-strength-track {
  height: 4px;
  border-radius: 100px;
  background: rgba(30, 58, 111, 0.1);
  overflow: hidden;
}
body.auth-page .register-pwd-strength-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 100px;
  transition: width 0.2s, background 0.2s;
}
body.auth-page .register-pwd-strength-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
}
body.auth-page .register-pwd-match { margin-top: 6px; font-size: 11.5px; font-weight: 600; }
body.auth-page .register-pwd-match.is-ok { color: #15803d; }
body.auth-page .register-pwd-match.is-no { color: var(--danger, #ef4444); }

/* T&C row */
body.auth-page .register-tc-row { margin-top: 8px; }
body.auth-page .register-tc-status {
  font-size: 13px;
  color: var(--ab-ink-60);
  padding: 10px 0 4px;
  border-top: 1px solid var(--ab-border);
}
body.auth-page .register-tc-link { color: var(--ab-blue); font-weight: 700; }

/* Dark toggle */
body.auth-page .dm-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--ab-border);
  background: var(--ab-white);
  color: var(--ab-ink-60);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
body.auth-page .dm-toggle:hover {
  color: var(--ab-blue);
  border-color: var(--ab-blue);
}

/* Business type preview */
body.auth-page #business-type-preview {
  margin: 0 0 12px !important;
  padding: 10px 12px !important;
  font-size: 12.5px !important;
  line-height: 1.4;
  border-radius: 10px;
}

/* Caps lock */
body.auth-page .auth-capslock-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ab-gold-dark);
}
body.auth-page .auth-capslock-hint[hidden] { display: none !important; }

/* Dark mode */
html.dark body.auth-page { background: #0b1220 !important; color: #e5e7eb; }
html.dark body.auth-page .auth-shell { background-color: #0b1220; }
html.dark body.auth-page .auth-card,
html.dark body.auth-page .auth-form { background: #111827; border-color: rgba(255, 255, 255, 0.08); }
html.dark body.auth-page .auth-form-title { color: #f8fafc; }
html.dark body.auth-page .auth-form-sub,
html.dark body.auth-page .auth-field-hint,
html.dark body.auth-page .register-multi-biz-hint { color: #94a3b8; }
html.dark body.auth-page .auth-field-label,
html.dark body.auth-page .auth-field > label { color: #e2e8f0 !important; }
html.dark body.auth-page .auth-card .form-control:not(textarea),
html.dark body.auth-page .auth-card .form-control:not(textarea):focus,
html.dark body.auth-page .auth-card .form-control:not(textarea):focus-visible,
html.dark body.auth-page .auth-card .auth-input,
html.dark body.auth-page .auth-card .auth-input:focus,
html.dark body.auth-page .auth-card .auth-input:focus-visible,
html.dark body.auth-page .auth-card .select2-container--default .select2-selection--single,
html.dark body.auth-page .auth-card .select2-container--focus .select2-selection--single,
html.dark body.auth-page .auth-card .select2-container--open .select2-selection--single {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #e5e7eb !important;
}
html.dark body.auth-page .auth-card .form-control:not(textarea):focus,
html.dark body.auth-page .auth-card .form-control:not(textarea):focus-visible,
html.dark body.auth-page .auth-card .auth-input:focus,
html.dark body.auth-page .auth-card .auth-input:focus-visible {
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.22) !important;
}
html.dark body.auth-page .auth-card .select2-selection__rendered { color: #e5e7eb !important; }
html.dark body .auth-select2-dropdown.select2-dropdown { background: #111827 !important; border-color: rgba(148, 163, 184, 0.28) !important; }
html.dark body .auth-select2-dropdown .select2-results__option { color: #e5e7eb !important; }
html.dark body.auth-page .register-tabs.nav-tabs { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08) !important; }
html.dark body.auth-page .tab-navigation-buttons,
html.dark body.auth-page .trust-line,
html.dark body.auth-page .auth-footer-links { border-color: rgba(255, 255, 255, 0.08); }
html.dark body.auth-page .dm-toggle { background: #0f172a; border-color: rgba(255, 255, 255, 0.1); color: #cbd5e1; }

/* Responsive */
@media (max-width: 900px) {
  body.auth-page .auth-card {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  body.auth-page .auth-hero { display: none; }
  body.auth-page .auth-form { padding: 24px 20px; }
  body.auth-page .auth-grid,
  body.auth-page .auth-form .row {
    grid-template-columns: 1fr !important;
  }
  body.auth-page .register-tabs > li > a { font-size: 11.5px !important; padding: 8px 6px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-page * { transition: none !important; animation: none !important; }
}

/* === Option A consistency hard-fixes (border win + datepicker + CTA radius) === */
html body.auth-page .auth-card input.form-control,
html body.auth-page .auth-card input.auth-input,
html body.auth-page .auth-card .select2-container--default .select2-selection--single,
html body.auth-page .auth-card .select2-container .select2-selection--single,
html body.auth-page .auth-card .register-file-shell,
html body.auth-page .auth-card .auth-phone {
  border-width: 1.5px !important;
  border-style: solid !important;
}
html body.auth-page .auth-card .auth-phone {
  border-color: var(--ab-border-md, #D5DBE5) !important;
}
html body.auth-page .auth-card input.form-control,
html body.auth-page .auth-card input.auth-input,
html body.auth-page .auth-card .select2-selection--single,
html body.auth-page .auth-card .register-file-shell {
  border-color: var(--ab-border-md, #D5DBE5) !important;
}
html body.auth-page .auth-card .auth-phone input.form-control,
html body.auth-page .auth-card .auth-phone input.auth-input {
  border-width: 0 !important;
  border: none !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}
/* Login primary CTA radius matches fields */
html body.auth-page .auth-card .tw-dw-btn {
  border-radius: var(--ab-r-md, 10px) !important;
  font-size: 14px !important;
}
/* Auth datepicker panel (body-appended) */
body .datepicker.dropdown-menu,
body .datepicker-dropdown {
  font-family: "Inter", system-ui, sans-serif !important;
  font-size: 14px !important;
  border: 1.5px solid #D5DBE5 !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
  z-index: 1310 !important;
}
body .datepicker table tr td,
body .datepicker table tr th {
  font-size: 13px !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
}
body .datepicker table tr td.active,
body .datepicker table tr td.active:hover {
  background: #1E3A6F !important;
  background-image: none !important;
}
