/* =========================================================================
   SIGN-IN DIALOGS (log in, sign up, reset password, login code, complete
   your account, "Verification Required"). Loaded after homepage.css on every
   storefront page that carries them.

   homepage.css draws these dialogs dark-first with fixed hexes; this layer
   restates every colour in --moto-* tokens so the dialogs follow the page
   theme (DESIGN.md §2.5), and settles the shapes on the storefront button
   system: 48px fields and buttons, 12px corners, the solid logo red for the
   one primary action, no pulse, no glow. Selectors are scoped to
   the dialog ids so they outrank the legacy class rules without a fight.
   ========================================================================= */

:is(#authModalOverlay, #completeAccountOverlay) {
  --auth-field-bg: var(--moto-panel-inset);
  --auth-field-border: var(--moto-border-subtle);
  background: var(--moto-backdrop) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ---------------------------------------------------------------- box
   (the id list matches the legacy ".auth-modal-overlay #loginModal
   .account-box" rule's weight, so the token surface wins) */
:is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .account-box {
  padding: 32px 28px 28px !important;
  border: 1px solid var(--moto-border) !important;
  border-radius: 20px !important;
  background-color: var(--moto-panel) !important;
  box-shadow: none !important;
  color: var(--moto-text) !important;
  scrollbar-color: var(--moto-overlay-strong) transparent;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .account-box::-webkit-scrollbar-thumb {
  background: var(--moto-overlay-strong);
}

:is(#authModalOverlay, #completeAccountOverlay) .close-modal-btn {
  top: 16px !important;
  right: 16px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: var(--moto-overlay) !important;
  color: var(--moto-muted) !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .close-modal-btn:hover {
  background: var(--moto-overlay-strong) !important;
  color: var(--moto-text) !important;
}

/* ------------------------------------------------------------ headings */
:is(#authModalOverlay, #completeAccountOverlay) :is(h2, .auth-modal-title) {
  margin: 4px 0 22px !important;
  color: var(--moto-text) !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-modal-subtitle {
  color: var(--moto-muted) !important;
}

/* The markup's inline #ffffff would vanish on the white Light Mode panel */
:is(#authModalOverlay, #completeAccountOverlay) .auth-modal-subtitle strong {
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) label {
  color: var(--moto-text-secondary) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
}

/* A field's label sits close to its box (Jemmy, 2026-11-13) */
:is(#authModalOverlay, #completeAccountOverlay) .auth-field-group > label {
  margin-bottom: 3px !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.auth-field-note, .password-helper-text, .auth-options-row, .login-otp-resend-row, .resend-row, .resend-countdown) {
  color: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-address-intro {
  color: var(--moto-text-secondary) !important;
}

/* -------------------------------------------------------------- fields */
:is(#authModalOverlay, #completeAccountOverlay) .inputForm {
  height: 48px !important;
  min-height: 48px !important;
  border: 1px solid var(--auth-field-border) !important;
  border-radius: var(--btn-radius) !important;
  background-color: var(--auth-field-bg) !important;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .inputForm:focus-within {
  border-color: var(--moto-red) !important;
  box-shadow: 0 0 0 3px var(--moto-red-glow) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.inputForm.has-error, .phone-number-box.has-error) {
  border-color: var(--moto-danger) !important;
  box-shadow: 0 0 0 3px var(--moto-danger-bg) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .inputForm.is-valid {
  border-color: var(--moto-success) !important;
  box-shadow: none !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.input, .inputForm input, .inputForm select) {
  color: var(--moto-text) !important;
  font-size: 0.94rem !important;
}

/* Browser autofill (a saved e-mail and password): the legacy rules in homepage.css
   paint a fixed dark #252525 box with white text in every theme, which showed as a
   black bar inside the white field in Light Mode. Autofilled values now sit on the
   field's own surface with the theme's text colour. */
:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):-webkit-autofill,
:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):-webkit-autofill:hover,
:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):-webkit-autofill:focus,
:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--auth-field-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--auth-field-bg) inset !important;
  -webkit-text-fill-color: var(--moto-text) !important;
  caret-color: var(--moto-text);
  background-color: transparent !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):autofill,
:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):autofill:hover,
:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):autofill:focus,
:is(#authModalOverlay, #completeAccountOverlay) :is(input, select, textarea):autofill:active {
  box-shadow: 0 0 0 1000px var(--auth-field-bg) inset !important;
  -webkit-text-fill-color: var(--moto-text) !important;
  caret-color: var(--moto-text);
  background-color: transparent !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .inputForm select option {
  background: var(--moto-panel);
  color: var(--moto-text);
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.input, .inputForm input)::placeholder {
  color: var(--moto-muted) !important;
  opacity: 1;
}

/* Field icons follow the field state. The show/hide-password eye is a
   control, not a field icon: it keeps the button colour below in every state
   (an old homepage.css rule painted it pure red once a password was typed). */
:is(#authModalOverlay, #completeAccountOverlay) .inputForm svg:not(.tab-card-icon):not(:is(.reveal-btn, .reveal-btn-forgot) svg) {
  stroke: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .inputForm:focus-within svg:not(.tab-card-icon):not(:is(.reveal-btn, .reveal-btn-forgot) svg) {
  stroke: var(--moto-text-secondary) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .inputForm.has-error svg:not(.tab-card-icon):not(:is(.reveal-btn, .reveal-btn-forgot) svg) {
  stroke: var(--moto-danger) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.reveal-btn, .reveal-btn-forgot) {
  color: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.reveal-btn, .reveal-btn-forgot) svg {
  color: inherit !important;
  stroke: currentColor !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.reveal-btn, .reveal-btn-forgot):hover {
  color: var(--moto-text) !important;
}

/* Edge draws its own eye inside a password box. These boxes already have ours,
   so its one is hidden, or the field shows two. A rule of its own: other
   browsers drop a selector list that names it. */
:is(#authModalOverlay, #completeAccountOverlay) .inputForm input::-ms-reveal {
  display: none;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.phone-country-box, .phone-prefix-badge) {
  border: 1px solid var(--auth-field-border) !important;
  border-radius: var(--btn-radius) !important;
  background-color: var(--auth-field-bg) !important;
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .phone-input-container.is-invalid .phone-prefix-badge {
  border-color: var(--moto-danger) !important;
  color: var(--moto-danger) !important;
}

/* A phone keyboard zooms a field whose text is under 16px */
@media (max-width: 600px) {
  :is(#authModalOverlay, #completeAccountOverlay) :is(.input, .inputForm input, .inputForm select, .otp-digit-box) {
    font-size: 16px !important;
  }
}

/* ------------------------------------------------ links, checkbox, rows */
:is(#authModalOverlay, #completeAccountOverlay) :is(.remember-me-label span, .auth-switch-text, .consent-checkbox-label .consent-text, .verify-info-text) {
  color: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.verify-info-text strong) {
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) input[type="checkbox"] {
  accent-color: var(--moto-red-solid) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.auth-link-red, #forgotPasswordLink, .auth-back-link, .resend-otp-btn, .consent-checkbox-label .consent-text a) {
  color: var(--moto-red) !important;
  font-weight: 600 !important;
  text-underline-offset: 3px;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.auth-link-red, #forgotPasswordLink, .auth-back-link, .resend-otp-btn:not(:disabled), .consent-checkbox-label .consent-text a):hover {
  color: var(--moto-red) !important;
  text-decoration: underline !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .resend-otp-btn:disabled {
  color: var(--moto-text-dim) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .back-to-login-link {
  color: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .back-to-login-link:hover {
  background: var(--moto-overlay) !important;
  color: var(--moto-text) !important;
}

/* The span links and the checkboxes are the auth controls storefront-interactions.css
   does not ring for the keyboard */
:is(#authModalOverlay, #completeAccountOverlay) :is(.auth-back-link, input[type="checkbox"]):focus-visible {
  outline: 2px solid var(--moto-red);
  outline-offset: 2px;
}

/* -------------------------------------------------------- primary action
   The one solid button of each step, slanted (.btn-skewed): grey until the
   step is filled in, then brand red (owner, 2026-11-07; before that it was
   straight and always red). Grey is only a look: the button stays pressable
   so homepage.js can say what is missing.
   While a request runs (homepage.js swaps the label for authBusyLabel(): the
   gauge + text inside .auth-busy) it holds the deeper brand red and the
   Motolectron gauge sweeps its needle, whatever the pointer is doing. Every
   failure puts the plain label back, which ends this state. The id pair
   outranks homepage.css's `.auth-modal #modalLoginForm:invalid` rule. */
:is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .login-ui-form .button-submit {
  /* The slant carries the corners past the box: tan(21deg) of half the height.
     Inset by that much, the outer corners line up with the fields above. */
  --auth-skew-inset: calc(var(--btn-h) * 0.192);
  width: calc(100% - 2 * var(--auth-skew-inset)) !important;
  height: var(--btn-h) !important;
  min-height: var(--btn-h) !important;
  margin: 4px var(--auth-skew-inset) 0 !important;
  padding: 0 16px !important;
  border-radius: var(--btn-radius) !important;
  background-color: var(--moto-red-solid) !important;
  color: #ffffff !important;
  font-size: 0.94rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  box-shadow: none !important;
  animation: none !important;
  transform: skew(-21deg) !important;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, scale var(--ix-release-dur) var(--ix-ease-out) !important;
}

/* The label stands upright on the slant. Only the direct child: the busy label
   is a span holding another span, which must not turn back twice. */
:is(#authModalOverlay, #completeAccountOverlay) .btn-skewed span {
  transform: none !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .btn-skewed > span {
  transform: skew(21deg) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .btn-skewed::before {
  display: none !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .login-ui-form .button-submit:hover:not(:disabled):not(:has(.auth-busy)) {
  background-color: var(--moto-red-dark) !important;
}

/* Grey while a field of the step on screen is empty or not valid yet. CSS reads
   this itself, so it follows typing, the form reset, a remembered email and
   step changes with no event wiring; autofill counts as filled, because a
   browser keeps a saved password from the page until the first click. Steps
   not on screen carry .is-signup-hidden and don't count. Scoped to the forms:
   a :has() on body would restyle the page on every DOM change (DESIGN.md). */
:is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .login-ui-form:has(:is(input, select, textarea):invalid:not(:autofill):not(.is-signup-hidden *)) .button-submit:not(:has(.auth-busy)) {
  background-color: var(--moto-panel-hover) !important;
  color: var(--moto-text-secondary) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .login-ui-form .button-submit:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .login-ui-form .button-submit:has(.auth-busy) {
  background-color: var(--moto-red-dark) !important;
  opacity: 1 !important;
  cursor: progress !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: auth-busy-in 160ms var(--ix-ease-out) both;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-busy__gauge {
  flex: none;
  width: 22px;
  height: auto;
  overflow: visible;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-busy__needle {
  transform-box: view-box;
  transform-origin: 34.01px 33.72px;
  animation: auth-needle-rev 1.1s var(--ix-ease-out) infinite alternate;
}

@keyframes auth-needle-rev {
  from { rotate: -140deg; }
  to { rotate: 4deg; }
}

@keyframes auth-busy-in {
  from { opacity: 0; translate: 0 4px; }
  to { opacity: 1; translate: 0 0; }
}

/* ------------------------------------------------------ divider, social */
:is(#authModalOverlay, #completeAccountOverlay) .auth-divider::before,
:is(#authModalOverlay, #completeAccountOverlay) .auth-divider::after {
  background-color: var(--moto-border) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-divider span {
  color: var(--moto-muted) !important;
  text-transform: none !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-social-row .btn {
  height: var(--btn-h) !important;
  min-height: var(--btn-h) !important;
  border: 1px solid var(--moto-border) !important;
  border-radius: var(--btn-radius) !important;
  background-color: var(--moto-panel-soft) !important;
  color: var(--moto-text) !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, scale var(--ix-scale-dur, var(--ix-release-dur)) var(--ix-scale-ease, var(--ix-spring)) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-social-row .btn:hover:not(:disabled) {
  border-color: var(--moto-border-hover) !important;
  background-color: var(--moto-panel-hover) !important;
}

/* ------------------------------------------- reset password: method tabs */
:is(#authModalOverlay, #completeAccountOverlay) .reset-method-tabs {
  border: 1px solid var(--moto-border) !important;
  background-color: var(--moto-panel-inset) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .reset-method-tab {
  border: 1px solid transparent !important;
  background-color: transparent !important;
  color: var(--moto-muted) !important;
  box-shadow: none !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .reset-method-tab :is(svg, span) {
  color: inherit !important;
  stroke: currentColor !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .reset-method-tab:hover:not(.active) {
  background-color: var(--moto-overlay) !important;
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .reset-method-tab.active {
  border-color: transparent !important;
  background-color: var(--moto-panel-hover) !important;
  color: var(--moto-text) !important;
  box-shadow: var(--moto-card-shadow) !important;
}

/* Log in / Sign up segmented tabs (where a page shows them) */
:is(#authModalOverlay, #completeAccountOverlay) .auth-modal-tabs {
  border: 1px solid var(--moto-border) !important;
  background: var(--moto-panel-inset) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-modal-tab {
  color: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-modal-tab:hover {
  background: var(--moto-overlay) !important;
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-modal-tab.active {
  background: var(--moto-panel-hover) !important;
  box-shadow: var(--moto-card-shadow) !important;
  color: var(--moto-text) !important;
}

/* ------------------------------------------------------------ code boxes */
:is(#authModalOverlay, #completeAccountOverlay) .otp-digit-box {
  border: 1px solid var(--auth-field-border) !important;
  border-radius: var(--radius-sm) !important;
  background-color: var(--auth-field-bg) !important;
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .otp-digit-box:focus {
  border-color: var(--moto-red) !important;
  background-color: var(--auth-field-bg) !important;
  box-shadow: 0 0 0 3px var(--moto-red-glow) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .otp-digit-box.is-filled {
  border-color: var(--moto-border-hover) !important;
  background-color: var(--auth-field-bg) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .otp-digit-input {
  color: var(--moto-text) !important;
}

/* -------------------------------------------- sign-up password checklist
   homepage.js sets data-level (weak/fair/good/strong) on the meter; the
   level colours its first 1-4 bars and the label. */
:is(#authModalOverlay, #completeAccountOverlay) .strength-bars .bar {
  background-color: var(--moto-border-subtle) !important;
  box-shadow: none !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .strength-meter {
  --strength-color: var(--moto-muted);
}

:is(#authModalOverlay, #completeAccountOverlay) .strength-meter[data-level="weak"] { --strength-color: var(--moto-danger); }
:is(#authModalOverlay, #completeAccountOverlay) .strength-meter[data-level="fair"] { --strength-color: var(--moto-warning); }
:is(#authModalOverlay, #completeAccountOverlay) .strength-meter:is([data-level="good"], [data-level="strong"]) { --strength-color: var(--moto-success); }

:is(#authModalOverlay, #completeAccountOverlay) .strength-meter[data-level="weak"] .bar:nth-child(-n + 1),
:is(#authModalOverlay, #completeAccountOverlay) .strength-meter[data-level="fair"] .bar:nth-child(-n + 2),
:is(#authModalOverlay, #completeAccountOverlay) .strength-meter[data-level="good"] .bar:nth-child(-n + 3),
:is(#authModalOverlay, #completeAccountOverlay) .strength-meter[data-level="strong"] .bar {
  background-color: var(--strength-color) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .strength-meter #strengthLabel {
  color: var(--strength-color) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .password-checklist {
  grid-template-columns: repeat(3, max-content) !important;
  gap: 6px 16px !important;
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.strength-text, .password-checklist .check-item) {
  color: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .password-checklist .check-item .icon {
  background-color: var(--moto-border-subtle) !important;
  color: var(--moto-text-secondary) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .password-checklist .check-item .icon svg {
  stroke: var(--moto-panel) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .password-checklist .check-item.is-met {
  color: var(--moto-success) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .password-checklist .check-item.is-met .icon {
  background-color: var(--moto-success) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .password-checklist .check-item.is-unmet {
  color: var(--moto-danger) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .password-checklist .check-item.is-unmet .icon {
  background-color: var(--moto-danger) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .field-status-icon.is-valid .status-check {
  stroke: var(--moto-success) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .field-status-icon.is-invalid .status-error {
  stroke: var(--moto-danger) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-inline-error {
  color: var(--moto-danger) !important;
}

/* ------------------------------------------------------- auth steppers
   Numbered circles and tracks share the same sign-up styling. */
:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -6px 0 20px;
  padding: 0;
  list-style: none;
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__step {
  flex: none;
  min-width: 0;
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__target {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 2px 4px 2px 2px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
  transition: background-color var(--dur-fast) ease;
}

:is(#authModalOverlay, #completeAccountOverlay) button.signup-stepper__target:disabled {
  opacity: 1;
}

:is(#authModalOverlay, #completeAccountOverlay) button.signup-stepper__target:not(:disabled) {
  cursor: pointer;
}

:is(#authModalOverlay, #completeAccountOverlay) button.signup-stepper__target:not(:disabled):hover {
  background: var(--moto-overlay);
}

:is(#authModalOverlay, #completeAccountOverlay) button.signup-stepper__target:focus-visible {
  outline: 2px solid var(--moto-red);
  outline-offset: 2px;
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--moto-border-hover);
  border-radius: 50%;
  background: transparent;
  color: var(--moto-muted);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition:
    background-color var(--dur-base) var(--ix-ease-out),
    border-color var(--dur-base) var(--ix-ease-out),
    color var(--dur-base) var(--ix-ease-out);
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.signup-stepper__num, .signup-stepper__check) {
  grid-area: 1 / 1;
  transition: opacity var(--dur-fast) ease, transform var(--dur-base) var(--ix-spring);
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__check {
  opacity: 0;
  transform: scale(0.4);
}

:is(#authModalOverlay, #completeAccountOverlay) :is(.is-current, .is-done) .signup-stepper__dot {
  border-color: var(--moto-red-solid);
  background: var(--moto-red-solid);
  color: #ffffff;
}

:is(#authModalOverlay, #completeAccountOverlay) .is-done .signup-stepper__num {
  opacity: 0;
  transform: scale(0.4);
}

:is(#authModalOverlay, #completeAccountOverlay) .is-done .signup-stepper__check {
  opacity: 1;
  transform: scale(1);
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__kicker {
  color: var(--moto-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__title {
  color: var(--moto-text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: color var(--dur-base) var(--ix-ease-out);
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__step:not(.is-current):not(.is-done) .signup-stepper__title {
  color: var(--moto-muted);
}

:is(#authModalOverlay, #completeAccountOverlay) .is-current .signup-stepper__title {
  color: var(--moto-text);
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__line {
  position: relative;
  flex: 1 1 auto;
  min-width: 8px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--moto-border);
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--moto-red-solid);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 420ms var(--ix-ease-out);
}

:is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__line.is-filled::after {
  transform: scaleX(1);
}

/* A phone keeps the current step's name and drops the other one's */
@media (max-width: 420px) {
  :is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__step:not(.is-current) .signup-stepper__text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(#authModalOverlay, #completeAccountOverlay) :is(.signup-stepper__dot, .signup-stepper__num, .signup-stepper__check, .signup-stepper__title),
  :is(#authModalOverlay, #completeAccountOverlay) .signup-stepper__line::after {
    transition: none;
  }
}

/* Account completion's second step is wider for the delivery map */
#completeAccountOverlay #completeAccountLocationModal {
  width: min(640px, calc(100vw - 32px)) !important;
  max-width: 640px !important;
}

/* ---------------------------------------------- notices inside the flow */
:is(#authModalOverlay, #completeAccountOverlay) .auth-flow-toast.success {
  border: 0 !important;
  background: var(--moto-success-bg) !important;
  color: var(--moto-success) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-flow-toast.error {
  border: 0 !important;
  background: var(--moto-danger-bg) !important;
  color: var(--moto-danger) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-flow-toast.info {
  border: 0 !important;
  background: var(--moto-blue-bg) !important;
  color: var(--moto-blue) !important;
}

/* A link-like action inside a notice ("Sign up with this email"). */
:is(#authModalOverlay, #completeAccountOverlay) .auth-flow-toast-action {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

:is(#authModalOverlay, #completeAccountOverlay) .phone-status-badge.verified {
  border: 0 !important;
  background-color: var(--moto-success-bg) !important;
  color: var(--moto-success) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .phone-status-badge.unverified {
  border: 0 !important;
  background-color: var(--moto-warning-bg) !important;
  color: var(--moto-warning) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .btn-verify-phone {
  border: 0 !important;
  background: var(--moto-overlay-strong) !important;
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .btn-verify-phone:hover {
  background: var(--moto-red-solid) !important;
  color: #ffffff !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-success-banner {
  border: 0 !important;
  background: var(--moto-success-bg) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-success-banner h3 {
  color: var(--moto-success) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .auth-success-banner p {
  color: var(--moto-muted) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .success-checkmark-circle {
  border-color: var(--moto-success) !important;
  background-color: var(--moto-success-bg) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .success-checkmark-circle svg {
  stroke: var(--moto-success) !important;
}

/* Verify-your-email view: calm status ring, no red glow */
:is(#authModalOverlay, #completeAccountOverlay) .verify-pulse-ring {
  border-color: var(--moto-border-hover) !important;
  background: var(--moto-overlay) !important;
  box-shadow: none !important;
  color: var(--moto-red) !important;
  animation: none !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .verify-pulse-ring.verified {
  border-color: var(--moto-success) !important;
  background: var(--moto-success-bg) !important;
  color: var(--moto-success) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .verify-email-chip {
  border: 1px solid var(--moto-border) !important;
  background: var(--moto-panel-soft) !important;
  color: var(--moto-text) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .verify-info-card {
  border: 1px solid var(--moto-border) !important;
  background: var(--moto-panel-soft) !important;
}

:is(#authModalOverlay, #completeAccountOverlay) .verify-info-icon {
  color: var(--moto-warning) !important;
}

@media (max-width: 480px) {
  :is(#authModalOverlay, #completeAccountOverlay) :is(#loginModal, #signupModal, .auth-modal) .account-box {
    padding: 28px 20px 22px !important;
    border-radius: 18px !important;
  }
}

/* ------------------------------------------------------------ split shell
   One wide dialog with two sides: the brand panel (logo and type, no photos)
   and the form panel. #loginModal and #signupModal swap inside the form panel,
   so the brand panel, the shell and the close button stay put through Log in,
   Sign up and Forgot password. The complete-your-account dialog keeps its
   single card. */
#authModalOverlay {
  --auth-shell-cap: calc(100dvh - 64px);
  --auth-shell-floor: 684px;
  --auth-panel-pad: 24px 36px;
  --auth-photo-opacity: 0.22;
  height: 100dvh !important;
  padding: 32px 20px !important;
  overflow: hidden !important;
}

/* The photo is dark, so it needs less strength on the light canvas */
html[data-theme="light"] #authModalOverlay {
  --auth-photo-opacity: 0.14;
}

#authModalOverlay .auth-shell {
  position: relative;
  display: flex;
  box-sizing: border-box;
  width: min(920px, 100%);
  /* Tall enough for Sign up's first step: Log in, Sign up and Forgot password
     share one height, so the brand panel does not resize between them */
  min-height: min(var(--auth-shell-floor), var(--auth-shell-cap));
  max-height: var(--auth-shell-cap);
  overflow: hidden;
  border: 1px solid var(--moto-border);
  border-radius: 18px;
  background: var(--moto-panel);
  box-shadow: var(--moto-card-shadow);
}

/* The page canvas against the raised form panel, with the logo and the greeting
   in one centered stack over the store photo (Jemmy, 2026-11-13). Its width is
   the query container, so the logo and heading scale with the panel, not the
   window. */
#authModalOverlay .auth-shell__brand {
  position: relative;
  display: flex;
  flex: 0 0 40%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  padding: 28px 30px;
  overflow: hidden;
  border-right: 1px solid var(--moto-border);
  background: var(--moto-black);
  text-align: center;
  container-type: inline-size;
}

/* The store photo, faint behind the logo. It is one file: replace
   photos/auth/login-store.webp to change it on every page. The position keeps
   the store's sign in frame when the tall panel crops the sides. */
#authModalOverlay .auth-shell__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../photos/auth/login-store.webp") 64% 50% / cover no-repeat;
  opacity: var(--auth-photo-opacity);
  pointer-events: none;
}

/* The logo file is a square with wide empty margins. The frame crops to the
   mark at its own proportions. */
#authModalOverlay .auth-shell__logo {
  position: relative;
  display: block;
  flex: none;
  width: min(290px, 90cqi);
  height: auto;
  aspect-ratio: 290 / 104;
  object-fit: cover;
  object-position: 50% 42%;
}

#authModalOverlay .auth-shell__logo.logo-light,
html[data-theme="light"] #authModalOverlay .auth-shell__logo.logo-dark {
  display: none;
}

html[data-theme="light"] #authModalOverlay .auth-shell__logo.logo-light {
  display: block;
}

/* Beside the form the panel says it in words alone (Jemmy, 2026-11-13); the logo
   is only for phones, where the panel shrinks to it and the words are hidden. */
@media (min-width: 768px) and (min-height: 521px) {
  #authModalOverlay .auth-shell__logo,
  html[data-theme="light"] #authModalOverlay .auth-shell__logo.logo-light {
    display: none;
  }
}

/* The logo's own lettering: --font-display at its fixed cut (DESIGN.md 2.6), in
   three lines, "WELCOME / BACK TO / MOTOLECTRON". Sized so its widest line,
   "MOTOLECTRON", fits the panel's text column. */
#authModalOverlay .auth-shell__headline {
  position: relative;
  margin: 0;
  color: var(--moto-text);
  font-family: var(--font-display);
  font-size: clamp(1rem, 10.4cqi, 2.25rem);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-synthesis: none;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

#authModalOverlay .auth-shell__brand-word {
  color: var(--moto-red);
  font-family: inherit;
}

/* "Welcome / back to" on Log in, "Welcome / to" on Create account (homepage.js
   sets .is-signup). Both are two lines in one cell, so the headline never moves,
   and the hidden one is out of the accessibility tree too. */
#authModalOverlay .auth-shell__greeting {
  display: inline-grid;
  justify-items: center;
  font-family: inherit; /* a global * rule sets Inter on every element */
}

#authModalOverlay .auth-shell__greeting > span {
  grid-area: 1 / 1;
  font-family: inherit;
  transition: opacity 180ms ease, visibility 0s;
}

#authModalOverlay .auth-shell__greeting > .is-new,
#authModalOverlay .auth-shell.is-signup .auth-shell__greeting > .is-back {
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}

#authModalOverlay .auth-shell.is-signup .auth-shell__greeting > .is-new {
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 0s;
}

#authModalOverlay .auth-shell__panel {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* The close button belongs to the shell: it stays on screen while the form scrolls.
   The solid fill keeps the X readable over fields scrolling under it. */
#authModalOverlay .auth-shell > .close-modal-btn {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 3;
  background: var(--moto-panel-soft) !important;
}

#authModalOverlay .auth-shell > .close-modal-btn:hover:not(:disabled) {
  background: var(--moto-panel-hover) !important;
}

/* The card that is showing fills the panel and is what scrolls */
#authModalOverlay .auth-shell .auth-modal {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--moto-overlay-strong) transparent;
}

#authModalOverlay :is(#loginModal, #signupModal) .account-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-height: 100%;
  max-height: none !important;
  padding: var(--auth-panel-pad) !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
}

#authModalOverlay .auth-shell .auth-modal-title {
  margin: 0 0 16px !important;
  font-size: 1.5rem !important;
}

/* Create account's title stands a little clear of its stepper (Jemmy, 2026-11-13) */
#authModalOverlay .auth-shell .signup-stepper {
  margin-top: 2px;
}

#authModalOverlay .auth-shell .auth-modal-subtitle {
  margin: -8px 0 16px !important;
  font-size: 0.94rem !important;
}

#authModalOverlay .auth-shell .login-ui-form {
  gap: 12px !important;
}

#authModalOverlay .auth-shell .inputForm:hover:not(:focus-within, .has-error) {
  border-color: var(--moto-border-hover) !important;
}

/* The form's gap spaces the divider evenly; the legacy margins would stack on it */
#authModalOverlay .auth-shell .auth-divider {
  margin: 2px 0 !important;
}

/* "Google" and "Facebook" side by side under "Or continue with", one per row
   when they do not fit */
#authModalOverlay .auth-shell .auth-social-row {
  flex-wrap: wrap;
  margin-top: 0 !important;
}

#authModalOverlay .auth-shell .auth-social-row .btn {
  flex: 1 1 200px !important;
  margin-top: 0 !important;
  white-space: nowrap;
}

/* The agreement under Log in's social buttons. Create account has none: its
   last step has the consent checkbox, and a Google or Facebook sign-up ticks one
   on Complete your account (homepage.js showCompleteAccountPrompt). */
#authModalOverlay .auth-shell .auth-legal {
  margin: 0;
  color: var(--moto-muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

#authModalOverlay .auth-shell .auth-legal a {
  color: var(--moto-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

#authModalOverlay .auth-shell .auth-legal a:hover {
  color: var(--moto-text);
}

#authModalOverlay .auth-shell .auth-legal a:focus-visible {
  outline: 2px solid var(--moto-red);
  outline-offset: 2px;
}

#authModalOverlay .auth-shell .auth-switch-text {
  margin-top: 2px !important;
}

/* The code boxes span the form on the same edges as the fields around them */
#authModalOverlay .auth-shell .otp-boxes-wrapper {
  justify-content: flex-start !important;
}

#authModalOverlay .auth-shell .otp-digit-box {
  flex: 1 1 0;
  width: auto !important;
  min-width: 0;
  font-family: inherit !important;
  font-variant-numeric: tabular-nums;
}

/* homepage.css forces every form to display:flex, which beat the inline
   display:none that clears the new-password form for its success banner */
#authModalOverlay .auth-shell .login-ui-form[style*="display: none"] {
  display: none !important;
}

/* The question and its action read as one line on the wide panel */
#authModalOverlay #signup-verify-view .auth-options-row {
  justify-content: center !important;
}

/* Tablets: the brand panel gives way before the form does, and the social
   buttons take a row each, so the floor rises with Sign up's first step */
@media (max-width: 1023px) {
  #authModalOverlay {
    --auth-shell-floor: 744px;
    --auth-panel-pad: 24px 32px;
  }

  #authModalOverlay .auth-shell__brand {
    flex-basis: 38%;
    padding: 28px;
  }
}

/* Phones, portrait or landscape: one column. The brand panel shrinks to the
   centered logo, between the close button's margins, so the form stays the focus.
   The hidden photo layer is never downloaded. */
@media (max-width: 767px), (max-height: 520px) {
  #authModalOverlay {
    --auth-shell-cap: calc(100dvh - 32px);
    --auth-panel-pad: 12px 20px 22px;
    padding: 16px !important;
  }

  #authModalOverlay .auth-shell {
    flex-direction: column;
    width: min(520px, 100%);
    min-height: 0;
  }

  #authModalOverlay .auth-shell__brand {
    flex: none;
    padding: 6px 56px 0;
    overflow: visible;
    border-right: 0;
    background: transparent;
    container-type: normal;
  }

  #authModalOverlay .auth-shell__brand::before,
  #authModalOverlay .auth-shell__headline {
    display: none;
  }

  #authModalOverlay .auth-shell__logo {
    width: 168px;
    margin-bottom: 0;
  }

  #authModalOverlay .auth-shell__panel {
    flex: 1 1 auto;
  }

  #authModalOverlay .auth-shell > .close-modal-btn {
    top: 10px !important;
    right: 10px !important;
  }

  #authModalOverlay .auth-shell .auth-modal-title {
    margin-bottom: 18px !important;
    font-size: 1.5rem !important;
  }

  #authModalOverlay .auth-shell .auth-modal-subtitle {
    margin: -8px 0 18px !important;
  }

  #authModalOverlay .auth-shell .login-ui-form {
    gap: 14px !important;
  }
}

/* ------------------------------------------ "Verification Required" prompt
   The storefront's "log in first" prompt (#customAlertDialog on each page). */
#customAlertDialog {
  background: var(--moto-backdrop) !important;
}

#customAlertDialog .custom-dialog-box {
  border: 1px solid var(--moto-border) !important;
  border-radius: 20px !important;
  background: var(--moto-panel) !important;
  box-shadow: none !important;
  color: var(--moto-text) !important;
}

#customAlertDialog .custom-dialog-box svg {
  stroke: var(--moto-red) !important;
}

#customAlertDialog .custom-dialog-box h3 {
  color: var(--moto-text) !important;
}

#customAlertDialog .custom-dialog-box p {
  color: var(--moto-muted) !important;
}

#customAlertDialog :is(.btn-cancel, .btn-confirm) {
  min-height: 44px !important;
  border-radius: var(--btn-radius) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

#customAlertDialog .btn-cancel {
  border: 0 !important;
  background: var(--moto-overlay-strong) !important;
  color: var(--moto-text) !important;
}

#customAlertDialog .btn-confirm {
  border: 0 !important;
  background: var(--moto-red-solid) !important;
  color: #ffffff !important;
}

#customAlertDialog .btn-confirm:hover {
  background: var(--moto-red-dark) !important;
}

@media (prefers-reduced-motion: reduce) {
  :is(#authModalOverlay, #completeAccountOverlay) :is(.button-submit, .auth-social-row .btn, .close-modal-btn, .inputForm) {
    transition-duration: 0.01ms !important;
  }

  /* The needle sweep repeats until the request ends: it stops for people who ask for less motion (the gauge stays, still) */
  :is(#authModalOverlay, #completeAccountOverlay) .auth-busy,
  :is(#authModalOverlay, #completeAccountOverlay) .auth-busy__needle,
  #authModalOverlay .auth-modal-view {
    animation: none !important;
  }
}
