/*
 * Shared login presentation. Authentication, focus, history and viewport
 * behavior stay owned by frontend.js; tokens reuse Storefront Styling.
 */
.commerce-auth-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.commerce-auth-modal {
  all: initial;
  --commerce-auth-accent: #0f766e;
  --commerce-auth-heading: #172033;
  --commerce-auth-muted: #617086;
  --commerce-auth-surface: #ffffff;
  --commerce-auth-surface-soft: #f7f8fa;
  --commerce-auth-border: #e5e9ef;
  --commerce-auth-radius: 8px;
  --commerce-auth-radius-lg: 12px;
  --commerce-auth-field-radius: 8px;
  --commerce-auth-control-height: 44px;
  --commerce-auth-body-font-size: 16px;
  --commerce-auth-button-font-size: 15px;
  --commerce-auth-font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --commerce-auth-font-display: var(--commerce-auth-font-sans);
  --commerce-auth-font-interface: var(--commerce-auth-font-sans);
  --commerce-auth-ink: var(--commerce-auth-heading);
  --commerce-auth-line: var(--commerce-auth-border);
  --commerce-auth-surface-strong: var(--commerce-auth-surface);
  --commerce-auth-accent-soft: color-mix(in srgb, var(--commerce-auth-accent) 8%, var(--commerce-auth-surface));
  --commerce-auth-modal-radius: var(--commerce-auth-radius-lg);
  --commerce-auth-control-radius: var(--commerce-auth-field-radius);
  --commerce-auth-action-height: max(44px, var(--commerce-auth-control-height));
  --commerce-auth-input-bg: var(--commerce-auth-surface);
  --commerce-auth-input-border: color-mix(in srgb, var(--commerce-auth-muted) 50%, var(--commerce-auth-border));
  --commerce-auth-input-border-hover: var(--commerce-auth-accent);
  --commerce-auth-input-shadow: none;
  --commerce-auth-input-border-focus: var(--commerce-auth-accent);
  --commerce-auth-focus-color: var(--commerce-auth-accent);
  --commerce-auth-focus-ring: 0 0 0 2px color-mix(in srgb, var(--commerce-auth-accent) 20%, transparent);
  --commerce-auth-input-placeholder: var(--commerce-auth-muted);
  --commerce-auth-input-error-border: #b42318;
  --commerce-auth-input-error-shadow: none;
  --commerce-auth-input-disabled-bg: var(--commerce-auth-surface-soft);
  --commerce-auth-input-disabled-text: var(--commerce-auth-muted);
  --commerce-auth-notice-error-bg: #fff3f1;
  --commerce-auth-notice-error-text: #b42318;
  --commerce-auth-notice-error-border: #fecaca;
  --commerce-auth-notice-success-bg: #eaf6ee;
  --commerce-auth-notice-success-text: #067647;
  --commerce-auth-notice-success-border: #a7f3d0;
  --commerce-auth-button-bg: var(--commerce-auth-heading);
  --commerce-auth-button-bg-hover: var(--commerce-auth-button-bg);
  --commerce-auth-button-text: #ffffff;
  --commerce-auth-button-text-hover: var(--commerce-auth-button-text);
  --commerce-auth-button-border: var(--commerce-auth-button-bg);
  --commerce-auth-button-border-hover: var(--commerce-auth-button-bg-hover);
  --commerce-auth-button-shadow: none;
  --commerce-auth-button-hover-transform: none;
  --commerce-auth-button-hover-filter: none;
  --commerce-auth-button-transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
  --commerce-auth-secondary-button-bg: var(--commerce-auth-surface-strong);
  --commerce-auth-secondary-button-bg-hover: var(--commerce-auth-surface-soft);
  --commerce-auth-secondary-button-text: var(--commerce-auth-ink);
  --commerce-auth-secondary-button-text-hover: var(--commerce-auth-secondary-button-text);
  --commerce-auth-secondary-button-border: var(--commerce-auth-input-border);
  --commerce-auth-secondary-button-border-hover: var(--commerce-auth-accent);
  --commerce-auth-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  --commerce-auth-modal-shadow: var(--commerce-auth-shadow);
  --commerce-auth-modal-backdrop: color-mix(in srgb, var(--commerce-auth-ink) 42%, transparent);
  --commerce-auth-modal-space: 24px;
  --commerce-auth-modal-gap: 16px;
  --commerce-auth-modal-width: 420px;
  --commerce-auth-modal-motion-duration: 420ms;
  --commerce-auth-country-motion-duration: 360ms;
  --commerce-auth-premium-easing: cubic-bezier(0.22, 1, 0.36, 1);
  /* The shared feedback adapter must resolve the selected Plugin/Theme source,
   * rather than unrelated --ca-* values inherited from the hosting theme. */
  --ca-color-surface: var(--commerce-auth-surface-strong);
  --ca-color-text: var(--commerce-auth-ink);
  --ca-color-muted: var(--commerce-auth-muted);
  --ca-color-border: var(--commerce-auth-border);
  --ca-color-primary: var(--commerce-auth-accent);
  --ca-color-error: var(--commerce-auth-input-error-border);
  --ca-font-ui: var(--commerce-auth-font-interface);
  font-family: var(--commerce-auth-font-sans);
  font-size: var(--commerce-auth-body-font-size);
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  color: var(--commerce-auth-ink);
  text-align: start;
  text-transform: none;
  letter-spacing: normal;
  -webkit-text-size-adjust: 100%;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--commerce-auth-modal-space);
  isolation: isolate;
  overscroll-behavior: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--commerce-auth-modal-motion-duration) ease;
}

.commerce-auth-modal[hidden],
.commerce-auth-modal [hidden] {
  display: none !important;
}

.commerce-auth-modal *,
.commerce-auth-modal *::before,
.commerce-auth-modal *::after {
  box-sizing: border-box;
  max-width: none;
}

.commerce-auth-modal :where(button, input, textarea, select, label, p, h1, h2, h3, span, strong, small) {
  font-family: var(--commerce-auth-font-sans);
  line-height: inherit;
}

.commerce-auth-modal :where(h1, h2, h3, p, form, ul, ol, li) {
  margin: 0;
  padding: 0;
}

.commerce-auth-modal :where(button, input, textarea, select) {
  min-width: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-transform: none;
  text-indent: 0;
  text-shadow: none;
  letter-spacing: normal;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.commerce-auth-modal :where(a) { color: inherit; text-decoration: none; }
.commerce-auth-modal :where(ul, ol, li) { list-style: none; }
.commerce-auth-modal :where(img, svg) { display: block; height: auto; }
.commerce-auth-modal .commerce-auth-control-icon { width: 18px; height: 18px; flex: none; stroke: currentColor; }

.commerce-auth-modal--visible { opacity: 1; pointer-events: auto; }
.commerce-auth-modal .commerce-auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--commerce-auth-modal-backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--commerce-auth-modal-motion-duration) ease;
}
.commerce-auth-modal--visible .commerce-auth-modal__backdrop { opacity: 1; }
.commerce-auth-modal--locked .commerce-auth-modal__backdrop { cursor: default; }

.commerce-auth-modal .commerce-auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, var(--commerce-auth-modal-width));
  max-height: calc(100dvh - var(--commerce-auth-modal-space) * 2);
  border: 1px solid var(--commerce-auth-border);
  border-radius: var(--commerce-auth-modal-radius);
  background: var(--commerce-auth-surface-strong);
  box-shadow: var(--commerce-auth-modal-shadow);
  overflow: visible;
  opacity: 0;
  transform: translateY(12px) scale(0.975);
  transform-origin: center;
  transition: opacity var(--commerce-auth-modal-motion-duration) ease, transform var(--commerce-auth-modal-motion-duration) var(--commerce-auth-premium-easing);
}
.commerce-auth-modal--visible .commerce-auth-modal__dialog { opacity: 1; transform: translateY(0) scale(1); }
.commerce-auth-modal .commerce-auth-modal__layout { max-height: inherit; overflow: hidden; border-radius: inherit; }
.commerce-auth-modal .commerce-auth-modal__content {
  max-height: inherit;
  padding: var(--commerce-auth-modal-space);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.commerce-auth-modal .commerce-auth-flow__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--commerce-auth-modal-gap);
  min-height: 36px;
  margin-bottom: var(--commerce-auth-modal-space);
}
.commerce-auth-modal .commerce-auth-modal__logo-shell { display: flex; align-items: center; min-width: 0; }
.commerce-auth-modal .commerce-auth-modal__brand-logo { width: auto; max-width: 160px; max-height: 36px; object-fit: contain; }
.commerce-auth-modal .commerce-auth-modal__brand-wordmark {
  font-family: var(--commerce-auth-font-display);
  font-size: calc(var(--commerce-auth-body-font-size) * 1.125);
  font-weight: 700;
  color: var(--commerce-auth-ink);
  overflow-wrap: anywhere;
}
.commerce-auth-modal .commerce-auth-modal__close {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  margin-inline-start: auto;
  border: 0;
  border-radius: var(--commerce-auth-control-radius);
  background: transparent;
  color: var(--commerce-auth-muted);
  box-shadow: none;
  cursor: pointer;
  transition: var(--commerce-auth-button-transition);
}
.commerce-auth-modal .commerce-auth-modal__close:hover { background: var(--commerce-auth-surface-soft); color: var(--commerce-auth-ink); }
.commerce-auth-modal .commerce-auth-modal__close .commerce-auth-control-icon { width: 18px; height: 18px; pointer-events: none; }
.commerce-auth-modal .commerce-auth-flow__utility { display: flex; }
.commerce-auth-modal .commerce-auth-flow__navigation { display: flex; margin-bottom: var(--commerce-auth-modal-gap); }
.commerce-auth-modal .commerce-auth-flow__back {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0; border: 0; border-radius: var(--commerce-auth-control-radius);
  background: transparent; color: var(--commerce-auth-muted); box-shadow: none;
  font-size: calc(var(--commerce-auth-body-font-size) * .75); font-weight: 500; cursor: pointer;
}
.commerce-auth-modal .commerce-auth-flow__back:hover { color: var(--commerce-auth-ink); }
.commerce-auth-modal .commerce-auth-step { display: none; animation: commerceAuthFade 240ms ease; }
.commerce-auth-modal .commerce-auth-step.is-active { display: block; }
.commerce-auth-modal .commerce-auth-step__header { margin-bottom: 22px; text-align: start; }
.commerce-auth-modal .commerce-auth-step__title {
  font-family: var(--commerce-auth-font-display);
  font-size: calc(var(--commerce-auth-body-font-size) * 1.5);
  font-weight: 700; line-height: 1.25; letter-spacing: -.02em;
  color: var(--commerce-auth-ink); text-align: start;
}
.commerce-auth-modal .commerce-auth-step__description {
  margin-top: 8px; color: var(--commerce-auth-muted);
  font-size: calc(var(--commerce-auth-body-font-size) * .875); line-height: 1.55; text-align: start;
}
.commerce-auth-modal .commerce-auth-form { display: grid; gap: var(--commerce-auth-modal-gap); }
.commerce-auth-modal .commerce-auth-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.commerce-auth-modal .commerce-auth-field { display: grid; min-width: 0; }
.commerce-auth-modal .commerce-auth-field__label,
.commerce-auth-modal .commerce-auth-country__search-label {
  display: block; margin: 0 0 6px; color: var(--commerce-auth-ink);
  font-size: calc(var(--commerce-auth-body-font-size) * .8125); font-weight: 600; text-transform: none; letter-spacing: normal;
}
.commerce-auth-modal .commerce-auth-field__required { color: var(--commerce-auth-accent); }
.commerce-auth-modal .commerce-auth-field__optional { font-size: calc(var(--commerce-auth-body-font-size) * .75); font-weight: 400; color: var(--commerce-auth-muted); }
.commerce-auth-modal .commerce-auth-phone-field {
  display: flex; align-items: stretch; min-height: var(--commerce-auth-action-height);
  border: 1px solid var(--commerce-auth-input-border); border-radius: var(--commerce-auth-control-radius);
  background: var(--commerce-auth-input-bg); box-shadow: var(--commerce-auth-input-shadow); overflow: visible;
}
.commerce-auth-modal .commerce-auth-phone-field:focus-within { border-color: var(--commerce-auth-input-border-focus); box-shadow: var(--commerce-auth-focus-ring); }
.commerce-auth-modal .commerce-auth-country { position: relative; display: flex; align-items: center; flex: 0 0 auto; }
.commerce-auth-modal .commerce-auth-country::after { content: ""; height: 22px; border-inline-end: 1px solid var(--commerce-auth-border); }
.commerce-auth-modal .commerce-auth-country__trigger {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; width: auto;
  min-height: calc(var(--commerce-auth-action-height) - 2px); padding: 0 10px;
  border: 0; border-radius: var(--commerce-auth-control-radius) 0 0 var(--commerce-auth-control-radius);
  background: transparent; color: var(--commerce-auth-ink);
  font-size: calc(var(--commerce-auth-body-font-size) * .875); font-weight: 500;
  white-space: nowrap; cursor: pointer;
}
.commerce-auth-modal .commerce-auth-country__flag { flex: none; width: 20px; font-size: 18px; line-height: 1; }
.commerce-auth-modal .commerce-auth-country__flag img { width: 20px; height: 20px; }
.commerce-auth-modal .commerce-auth-country__code { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
.commerce-auth-modal .commerce-auth-country__caret { font-size: 14px; color: var(--commerce-auth-muted); }
.commerce-auth-modal .commerce-auth-country--locked .commerce-auth-country__caret { opacity: .25; }
.commerce-auth-modal .commerce-auth-phone-field__input,
.commerce-auth-modal .commerce-auth-input,
.commerce-auth-modal .commerce-auth-country__search {
  width: 100%; min-width: 0; min-height: var(--commerce-auth-action-height); padding: 0 12px;
  border: 1px solid var(--commerce-auth-input-border); border-radius: var(--commerce-auth-control-radius);
  background: var(--commerce-auth-input-bg); color: var(--commerce-auth-ink);
  font-size: max(16px, var(--commerce-auth-body-font-size)); box-shadow: var(--commerce-auth-input-shadow);
}
.commerce-auth-modal .commerce-auth-phone-field__input { flex: 1 1 auto; min-height: calc(var(--commerce-auth-action-height) - 2px); border: 0; background: transparent; box-shadow: none; }
.commerce-auth-modal .commerce-auth-phone-field__input:focus { outline: 0; box-shadow: none; }
.commerce-auth-modal :is(.commerce-auth-input, .commerce-auth-country__search):hover:not(:disabled) { border-color: var(--commerce-auth-input-border-hover); }
.commerce-auth-modal :is(.commerce-auth-input, .commerce-auth-country__search):focus { border-color: var(--commerce-auth-input-border-focus); box-shadow: var(--commerce-auth-focus-ring); outline: 0; }
.commerce-auth-modal :is(.commerce-auth-input, .commerce-auth-phone-field__input, .commerce-auth-country__search)::placeholder { color: var(--commerce-auth-input-placeholder); opacity: .75; }
.commerce-auth-modal :is(.commerce-auth-input, .commerce-auth-country__search):disabled { background: var(--commerce-auth-input-disabled-bg); color: var(--commerce-auth-input-disabled-text); }
.commerce-auth-modal .commerce-auth-phone-field:has(input:disabled) { background: var(--commerce-auth-input-disabled-bg); }
.commerce-auth-modal :is(.commerce-auth-input, .commerce-auth-country__search)[aria-invalid="true"],
.commerce-auth-modal .commerce-auth-phone-field:has([aria-invalid="true"]) { border-color: var(--commerce-auth-input-error-border); box-shadow: var(--commerce-auth-input-error-shadow); }

.commerce-auth-modal .commerce-auth-form__actions { display: grid; gap: 10px; }
.commerce-auth-modal .commerce-auth-channel-choice { display: grid; gap: 10px; }
.commerce-auth-modal .commerce-auth-channel-choice__label { color: var(--commerce-auth-muted); font-size: calc(var(--commerce-auth-body-font-size) * .75); text-align: start; }
.commerce-auth-modal .commerce-auth-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--commerce-auth-action-height); padding: 10px 32px;
  border: 1px solid var(--commerce-auth-secondary-button-border); border-radius: var(--commerce-auth-radius);
  background: var(--commerce-auth-secondary-button-bg); color: var(--commerce-auth-secondary-button-text);
  font-family: var(--commerce-auth-font-interface); font-size: var(--commerce-auth-button-font-size);
  font-weight: 600; line-height: 1.45; text-align: center; box-shadow: none;
  cursor: pointer; transition: var(--commerce-auth-button-transition);
}
.commerce-auth-modal .commerce-auth-button:hover:not(:disabled) {
  border-color: var(--commerce-auth-secondary-button-border-hover);
  background: var(--commerce-auth-secondary-button-bg-hover); color: var(--commerce-auth-secondary-button-text-hover);
}
.commerce-auth-modal .commerce-auth-button--primary,
.commerce-auth-modal .commerce-auth-channel-choice > .commerce-auth-button--channel:first-child,
.commerce-auth-modal .commerce-auth-channel-choice > .commerce-auth-button--channel[hidden] + .commerce-auth-button--channel {
  border-color: var(--commerce-auth-button-border); background: var(--commerce-auth-button-bg);
  color: var(--commerce-auth-button-text); box-shadow: var(--commerce-auth-button-shadow);
}
.commerce-auth-modal .commerce-auth-button--primary:hover:not(:disabled),
.commerce-auth-modal .commerce-auth-channel-choice > .commerce-auth-button--channel:first-child:hover:not(:disabled),
.commerce-auth-modal .commerce-auth-channel-choice > .commerce-auth-button--channel[hidden] + .commerce-auth-button--channel:hover:not(:disabled) {
  border-color: var(--commerce-auth-button-border-hover); background: var(--commerce-auth-button-bg-hover);
  color: var(--commerce-auth-button-text-hover); transform: var(--commerce-auth-button-hover-transform); filter: var(--commerce-auth-button-hover-filter);
}
.commerce-auth-modal .commerce-auth-button__channel-icon { display: block; width: 18px; height: 18px; object-fit: contain; flex: none; }
.commerce-auth-modal .commerce-auth-button__icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.commerce-auth-modal .commerce-auth-button__icon--google svg { width: 18px; height: 18px; }
.commerce-auth-modal .commerce-auth-form__divider { display: flex; align-items: center; gap: 12px; margin: 6px 0; color: var(--commerce-auth-muted); font-size: calc(var(--commerce-auth-body-font-size) * .75); }
.commerce-auth-modal .commerce-auth-form__divider::before,
.commerce-auth-modal .commerce-auth-form__divider::after { content: ""; height: 1px; flex: 1; background: var(--commerce-auth-border); }
.commerce-auth-modal .commerce-auth-inline-link {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0; border: 0;
  border-radius: var(--commerce-auth-control-radius); background: transparent; color: var(--commerce-auth-accent);
  font: inherit; font-weight: 600; box-shadow: none; cursor: pointer;
}
.commerce-auth-modal .commerce-auth-inline-link:hover { color: var(--commerce-auth-accent-dark, var(--commerce-auth-accent)); background: transparent; }
.commerce-auth-modal :is(.commerce-auth-button, .commerce-auth-modal__close, .commerce-auth-flow__back, .commerce-auth-inline-link, .commerce-auth-country__trigger, .commerce-auth-country__option):focus-visible { outline: 2px solid var(--commerce-auth-focus-color); outline-offset: 2px; }
.commerce-auth-modal button:disabled { opacity: .5; cursor: not-allowed; }
.commerce-auth-modal .commerce-auth-button.is-busy { opacity: 1; pointer-events: none; transform: none; cursor: wait; }
.commerce-auth-modal .commerce-auth-button.is-busy::after {
  content: ""; position: absolute; inset-inline-end: 12px; top: calc(50% - 7px);
  width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: commerceAuthSpin 700ms linear infinite;
}
.commerce-auth-modal .commerce-auth-button.is-busy .commerce-auth-button__channel-icon,
.commerce-auth-modal .commerce-auth-button.is-busy .commerce-auth-button__icon { visibility: hidden; }
.commerce-auth-modal .commerce-auth-firebase-recaptcha { min-height: 0; }
.commerce-auth-modal .commerce-auth-firebase-recaptcha:empty { display: none; }
.commerce-auth-modal[data-commerce-auth-mode="verify_phone"] :is([data-commerce-auth-google-login], [data-commerce-auth-google-divider]) { display: none !important; }

.commerce-auth-modal .commerce-auth-otp-phone-chip { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--commerce-auth-ink); }
.commerce-auth-modal .commerce-auth-otp-phone-chip strong { font-size: calc(var(--commerce-auth-body-font-size) * .9375); font-weight: 600; }
.commerce-auth-modal .commerce-auth-otp-channel { display: inline-flex; align-items: center; }
.commerce-auth-modal .commerce-auth-otp-channel__image { width: 18px; height: 18px; object-fit: contain; }
.commerce-auth-modal .commerce-auth-change-number { margin-top: 6px; color: var(--commerce-auth-muted); font-size: calc(var(--commerce-auth-body-font-size) * .75); }
.commerce-auth-modal .commerce-auth-otp { display: grid; gap: 0; }
.commerce-auth-modal .commerce-auth-otp__input-shell { position: relative; min-height: 48px; }
.commerce-auth-modal .commerce-auth-otp__native-input {
  position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--commerce-auth-control-radius);
  background: transparent; color: transparent; caret-color: transparent; font-size: 16px; opacity: .01;
}
.commerce-auth-modal .commerce-auth-otp__native-input:focus { outline: 0; }
.commerce-auth-modal .commerce-auth-otp__inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; pointer-events: none; }
.commerce-auth-modal .commerce-auth-otp__input {
  display: grid; place-items: center; width: 100%; height: max(48px, var(--commerce-auth-action-height));
  border: 1px solid var(--commerce-auth-input-border); border-radius: var(--commerce-auth-control-radius);
  background: var(--commerce-auth-input-bg); box-shadow: var(--commerce-auth-input-shadow); color: var(--commerce-auth-ink);
  font-size: calc(var(--commerce-auth-body-font-size) * 1.375); font-weight: 600;
}
.commerce-auth-modal .commerce-auth-otp__input.is-active,
.commerce-auth-modal .commerce-auth-otp__input-shell:focus-within .commerce-auth-otp__input.is-active { border-color: var(--commerce-auth-input-border-focus); box-shadow: var(--commerce-auth-focus-ring); }
.commerce-auth-modal .commerce-auth-otp__input-shell:has([aria-invalid="true"]) .commerce-auth-otp__input { border-color: var(--commerce-auth-input-error-border); box-shadow: var(--commerce-auth-input-error-shadow); }
.commerce-auth-modal .commerce-auth-otp__meta { margin: 10px 0 20px; color: var(--commerce-auth-muted); font-size: calc(var(--commerce-auth-body-font-size) * .75); }
.commerce-auth-modal .commerce-auth-otp__meta p { margin: 0; }
.commerce-auth-modal .commerce-auth-otp__recovery { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--commerce-auth-border); }
.commerce-auth-modal .commerce-auth-otp__recovery-title { margin-bottom: 8px; color: var(--commerce-auth-muted); font-size: calc(var(--commerce-auth-body-font-size) * .75); text-align: start; }
.commerce-auth-modal .commerce-auth-otp__recovery-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
.commerce-auth-modal .commerce-auth-button--recovery,
.commerce-auth-modal .commerce-auth-button--recovery:hover:not(:disabled) {
  width: auto; min-height: 32px; padding: 0; border: 0; border-radius: var(--commerce-auth-control-radius);
  background: transparent; color: var(--commerce-auth-accent); box-shadow: none;
  font-size: calc(var(--commerce-auth-body-font-size) * .75);
}
.commerce-auth-modal .commerce-auth-security-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; color: var(--commerce-auth-muted); font-size: max(11px, calc(var(--commerce-auth-body-font-size) * .6875)); text-align: center; }
.commerce-auth-modal .commerce-auth-security-note .commerce-auth-control-icon { width: 14px; height: 14px; color: var(--commerce-auth-accent); }

/* Existing feedback owner sets text, roles and associated field attributes. */
.commerce-auth-modal .commerce-auth-flow__notice { margin-bottom: var(--commerce-auth-modal-gap); padding: 10px 12px; border: 1px solid var(--commerce-auth-notice-error-border); border-radius: var(--commerce-auth-control-radius); background: var(--commerce-auth-notice-error-bg); color: var(--commerce-auth-notice-error-text); font-size: calc(var(--commerce-auth-body-font-size) * .8125); line-height: 1.5; }
.commerce-auth-modal .commerce-auth-flow__notice[data-state="success"] { border-color: var(--commerce-auth-notice-success-border); background: var(--commerce-auth-notice-success-bg); color: var(--commerce-auth-notice-success-text); }
.commerce-auth-modal .commerce-auth-flow__notice[data-state="loading"] { border-color: var(--commerce-auth-border); background: var(--commerce-auth-surface-soft); color: var(--commerce-auth-muted); }
.commerce-auth-modal .commerce-auth-flow__notice.ca-feedback { margin-bottom: var(--commerce-auth-modal-gap); }

/* The JS owner moves this layer into the dialog and anchors its desktop panel. */
.commerce-auth-modal .commerce-auth-country__layer { position: absolute; z-index: 10; inset: 0; opacity: 0; pointer-events: none; transition: opacity var(--commerce-auth-country-motion-duration) ease; }
.commerce-auth-modal--country-open .commerce-auth-country__layer { opacity: 1; }
.commerce-auth-modal .commerce-auth-country__dismiss { display: none; }
.commerce-auth-modal .commerce-auth-country__dropdown {
  position: absolute; z-index: 1; width: 320px; max-height: min(420px, calc(100dvh - 24px)); padding: 12px;
  border: 1px solid var(--commerce-auth-border); border-radius: var(--commerce-auth-control-radius);
  background: var(--commerce-auth-surface-strong); box-shadow: var(--commerce-auth-modal-shadow); overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-8px) scale(.985); transform-origin: top left;
  transition: opacity var(--commerce-auth-country-motion-duration) ease, transform var(--commerce-auth-country-motion-duration) var(--commerce-auth-premium-easing);
}
.commerce-auth-modal--country-open .commerce-auth-country__dropdown { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.commerce-auth-modal .commerce-auth-country__search { margin: 0; }
.commerce-auth-modal .commerce-auth-country__list { display: grid; gap: 0; max-height: min(220px, calc(100dvh - 150px)); margin-top: 8px; overflow-y: auto; overscroll-behavior: contain; }
.commerce-auth-modal .commerce-auth-country__option {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  width: 100%; min-height: var(--commerce-auth-action-height); padding: 8px; border: 0;
  border-radius: min(4px, var(--commerce-auth-control-radius)); background: transparent; color: var(--commerce-auth-ink);
  font-size: calc(var(--commerce-auth-body-font-size) * .8125); font-weight: 400; text-align: start; cursor: pointer;
}
.commerce-auth-modal .commerce-auth-country__option .commerce-auth-country__flag { font-size: 18px; }
.commerce-auth-modal .commerce-auth-country__option small { color: var(--commerce-auth-muted); font-size: calc(var(--commerce-auth-body-font-size) * .75); font-weight: 400; }
.commerce-auth-modal .commerce-auth-country__option:hover { background: var(--commerce-auth-surface-soft); }
.commerce-auth-modal .commerce-auth-country__option.is-selected { background: color-mix(in srgb, var(--commerce-auth-accent) 8%, var(--commerce-auth-surface-strong)); color: var(--commerce-auth-accent); }
.commerce-auth-modal .commerce-auth-country__empty { margin: 16px 0; color: var(--commerce-auth-muted); font-size: calc(var(--commerce-auth-body-font-size) * .8125); text-align: center; }

.commerce-auth-modal :is(.commerce-auth-sr-only, .screen-reader-text) {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
@keyframes commerceAuthFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes commerceAuthSpin { to { transform: rotate(360deg); } }

@media (max-width: 40rem) {
  .commerce-auth-modal {
    --commerce-auth-modal-space: 20px;
    top: var(--commerce-auth-visual-top, 0px); right: auto; bottom: auto; left: var(--commerce-auth-visual-left, 0px);
    width: var(--commerce-auth-visual-width, 100%); height: var(--commerce-auth-visual-height, 100dvh);
    align-items: flex-end; padding: 0; overflow: hidden;
  }
  .commerce-auth-modal .commerce-auth-modal__dialog {
    width: 100%; max-height: min(calc(var(--commerce-auth-visual-height, 100dvh) - 8px), 760px);
    border-width: 1px 0 0; border-radius: var(--commerce-auth-modal-radius) var(--commerce-auth-modal-radius) 0 0;
    transform: translateY(24px) scale(.99); transform-origin: bottom center;
  }
  .commerce-auth-modal--visible .commerce-auth-modal__dialog { transform: translateY(0) scale(1); }
  .commerce-auth-modal .commerce-auth-modal__content { padding-bottom: max(var(--commerce-auth-modal-space), env(safe-area-inset-bottom)); }
  .commerce-auth-modal .commerce-auth-modal__close { width: 44px; height: 44px; margin: -4px -8px -4px 0; }
  .commerce-auth-modal .commerce-auth-step__title { font-size: calc(var(--commerce-auth-body-font-size) * 1.375); }
  .commerce-auth-modal .commerce-auth-flow__back { min-height: 36px; }
  .commerce-auth-modal .commerce-auth-inline-link { min-height: 32px; }
  .commerce-auth-modal .commerce-auth-button--recovery { min-height: 36px; }
  .commerce-auth-modal .commerce-auth-country__layer { overflow: hidden; border-radius: inherit; }
  .commerce-auth-modal--country-open .commerce-auth-country__layer { pointer-events: auto; }
  .commerce-auth-modal .commerce-auth-country__dismiss {
    position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; min-height: 0; padding: 0;
    border: 0; border-radius: inherit; background: var(--commerce-auth-modal-backdrop); box-shadow: none; cursor: default;
  }
  .commerce-auth-modal .commerce-auth-country__dropdown {
    top: auto !important; right: 0; bottom: 0; left: 0 !important; width: 100% !important;
    height: min(420px, calc(100% - 24px)); max-height: calc(100% - 24px); display: flex; flex-direction: column;
    padding-bottom: max(12px, env(safe-area-inset-bottom)); border-width: 1px 0 0;
    border-radius: var(--commerce-auth-modal-radius) var(--commerce-auth-modal-radius) 0 0;
    transform: translateY(24px); transform-origin: bottom center;
  }
  .commerce-auth-modal--country-open .commerce-auth-country__dropdown { transform: translateY(0); }
  .commerce-auth-modal .commerce-auth-country__list { flex: 1 1 auto; min-height: 0; max-height: none; }
  .commerce-auth-modal--keyboard-visible .commerce-auth-modal__dialog { max-height: var(--commerce-auth-visual-height, 100dvh); }
}
@media (max-width: 360px) {
  .commerce-auth-modal .commerce-auth-form__grid { grid-template-columns: 1fr; gap: var(--commerce-auth-modal-gap); }
  .commerce-auth-modal .commerce-auth-otp__inputs { gap: 6px; }
  .commerce-auth-modal .commerce-auth-country__trigger { gap: 4px; padding-inline: 8px; }
  .commerce-auth-modal .commerce-auth-button { padding-inline: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .commerce-auth-modal *, .commerce-auth-modal *::before, .commerce-auth-modal *::after {
    scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
  }
}

/* Retain the pre-existing non-owned tracking compatibility rules. */
@media (max-width: 1024px) {
  .commerce-auth-public-track {
    margin: 24px 0;
  }

  .commerce-auth-public-track__shell,
  .commerce-auth-public-track .commerce-auth-track-card {
    padding: 20px;
    border-radius: 22px;
  }

  .commerce-auth-public-track__grid,
  .commerce-auth-public-track .commerce-auth-track-card__meta {
    grid-template-columns: 1fr;
  }

  .commerce-auth-public-track__title,
  .commerce-auth-public-track .commerce-auth-track-card__title {
    font-size: 26px;
  }

  .commerce-auth-public-track .commerce-auth-track-card__top {
    flex-direction: column;
    align-items: flex-start;
  }

}
