/* ==========================================================================
   Wazon — auth pages (login, register)
   Loaded after wf-landing.css (design tokens) and wf-marketing.css
   (legacy auth layout). Every rule is prefixed with html.wf-auth so it
   overrides the legacy styles without !important.
   ========================================================================== */

html.wf-auth,
html.wf-auth body {
  height: auto;
  min-height: 100%;
  overflow: auto;
}

html.wf-auth body.wf-auth {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout: single column → split at 1024px ---------- */
html.wf-auth .wf-shell {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  overflow: visible;
}

/* ---------- showcase panel (desktop only) ---------- */
html.wf-auth .wf-stage {
  display: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: var(--s-6) var(--s-7);
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  color: var(--text);
  flex-direction: column;
  gap: var(--s-5);
}
/* soft light from the top-left + faint dotted texture that fades out */
html.wf-auth .wf-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    radial-gradient(50% 50% at 100% 100%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%);
  pointer-events: none;
}
html.wf-auth .wf-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 10%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 70% 55%, #000, transparent 75%);
  mask-image: radial-gradient(70% 60% at 70% 55%, #000, transparent 75%);
  pointer-events: none;
}
/* retire the old glow + spinning rings */
html.wf-auth .wf-stage-glow,
html.wf-auth .wf-stage-orb { display: none; }

html.wf-auth .wf-stage-brand { flex: none; animation: wfa-rise var(--t-slow) var(--ease-out) both; }
html.wf-auth .wf-stage-brand .wf-brand { display: inline-flex; margin: 0; }
html.wf-auth .wf-brand-mark { height: auto; }
html.wf-auth .wf-brand-mark img { height: 36px; width: auto; max-width: 160px; }
html.wf-auth .wf-brand-mark.is-auto img.wf-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  html.wf-auth .wf-brand-mark.is-auto img.wf-logo-light { display: none; }
  html.wf-auth .wf-brand-mark.is-auto img.wf-logo-dark { display: block; }
}

/* body: stacked on small laptops, side by side from 1280px */
html.wf-auth .wf-stage-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--s-6);
  align-items: center;
}

html.wf-auth .wf-stage-top { animation: none; max-width: 30rem; }
html.wf-auth .wf-stage-headline {
  margin: 0;
  max-width: 13ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.1rem + 1.9vw, 3rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--text);
  text-wrap: balance;
  animation: wfa-rise var(--t-slow) var(--ease-out) 80ms both;
}
html.wf-auth .wf-stage-headline span {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--primary);
}
html.wf-auth .wf-stage-copy {
  display: block;
  -webkit-line-clamp: unset;
  margin: var(--s-4) 0 0;
  max-width: 28rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  animation: wfa-rise var(--t-slow) var(--ease-out) 160ms both;
}

html.wf-auth .wf-stage-points {
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-3);
}
html.wf-auth .wf-stage-points li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  animation: wfa-slide var(--t-slow) var(--ease-out) both;
}
html.wf-auth .wf-stage-points li:nth-child(1) { animation-delay: 260ms; }
html.wf-auth .wf-stage-points li:nth-child(2) { animation-delay: 340ms; }
html.wf-auth .wf-stage-points li:nth-child(3) { animation-delay: 420ms; }
html.wf-auth .wf-stage-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--primary);
}
html.wf-auth .wf-stage-ico .wfl-icon { width: 18px; height: 18px; }

/* phone + backdrop + floating cards */
html.wf-auth .wf-stage-visual {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-2) 0;
}
html.wf-auth .wf-stage-disc {
  position: absolute;
  z-index: 0;
  width: min(88%, 440px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 18%, transparent), transparent 72%);
  animation: wfa-breathe 7s ease-in-out infinite;
  pointer-events: none;
}
html.wf-auth .wf-stage-disc::before,
html.wf-auth .wf-stage-disc::after {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--primary) 22%, transparent);
}
html.wf-auth .wf-stage-disc::after { inset: -6%; border-style: solid; border-color: color-mix(in srgb, var(--primary) 10%, transparent); }

html.wf-auth .wf-stage-visual .wf-phone {
  position: relative;
  z-index: 1;
  height: min(600px, 100%);
  max-height: 100%;
  transform: none;
  animation: wfa-phone 1000ms var(--ease-out) 200ms both;
}

html.wf-auth .wf-stage-chip {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}
html.wf-auth .wf-stage-chip b { display: block; font-size: 0.85rem; font-weight: 600; line-height: 1.3; color: var(--text); }
html.wf-auth .wf-stage-chip small { display: block; font-size: 0.72rem; line-height: 1.3; color: var(--text-muted); }
html.wf-auth .wf-stage-chip-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--tint);
  color: var(--primary);
}
html.wf-auth .wf-stage-chip-ico .wfl-icon { width: 17px; height: 17px; }
/* pop in, then drift very slightly (transform only) */
html.wf-auth .wf-stage-chip-a {
  /* hug the phone's left edge, over the empty wallpaper, never past the panel */
  top: 27%;
  left: max(0px, calc(50% - 250px));
  animation:
    wfa-pop 600ms var(--ease-out) 1100ms both,
    wfa-drift 6s ease-in-out 1700ms infinite;
}
html.wf-auth .wf-stage-chip-b {
  top: 41%;
  right: max(0px, calc(50% - 250px));
  animation:
    wfa-pop 600ms var(--ease-out) 1400ms both,
    wfa-drift 6s ease-in-out 2000ms infinite reverse;
}

/* ---------- form panel ---------- */
html.wf-auth .wf-auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding:
    calc(var(--s-6) + env(safe-area-inset-top))
    max(var(--s-4), env(safe-area-inset-right))
    calc(var(--s-6) + env(safe-area-inset-bottom))
    max(var(--s-4), env(safe-area-inset-left));
  background: var(--bg);
  overflow: visible;
}
html.wf-auth .wf-auth-panel::before { display: none; }

html.wf-auth .wf-auth-box {
  width: 100%;
  max-width: 400px;
  animation: wfa-rise var(--t-slow) var(--ease-out) both;
}

/* logo shown above the form on mobile only */
html.wf-auth .wf-auth-brand {
  display: inline-flex;
  margin-bottom: var(--s-7);
  min-height: 44px;
  align-items: center;
}
html.wf-auth .wf-auth-brand .wf-brand-mark img { height: 32px; }

html.wf-auth .wf-auth-kicker {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--primary);
}
html.wf-auth .wf-auth-kicker::before { display: none; }

html.wf-auth .wf-auth-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
html.wf-auth .wf-auth-sub {
  margin: var(--s-2) 0 var(--s-6);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}
html.wf-auth .wf-auth-sub strong { color: var(--text); font-weight: 600; }

/* ---------- fields ---------- */
html.wf-auth .wf-field { margin-bottom: var(--s-4); }
html.wf-auth .wf-label {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}
html.wf-auth .wf-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-sans);
  font-size: 1rem;             /* 16px: stops iOS zooming on focus */
  color: var(--text);
  outline: none;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
html.wf-auth .wf-input::placeholder { color: var(--text-muted); opacity: 0.7; }
html.wf-auth .wf-input:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--border-strong)); }
html.wf-auth .wf-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
html.wf-auth .wf-control.has-toggle .wf-input { padding-right: 52px; }

/* mobile: one control (code + number), same height/border as .wf-input */
html.wf-auth .wf-phone-group {
  --wf-phone-h: 48px;
  --wf-phone-code-w: 6.75rem;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden !important;
  gap: 0;
  padding: 0;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
html.wf-auth .wf-phone-group:hover {
  border-color: color-mix(in srgb, var(--text) 30%, var(--border-strong));
}
html.wf-auth .wf-phone-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
html.wf-auth .wf-phone-group .wf-phone-code {
  width: var(--wf-phone-code-w);
}
html.wf-auth .wf-phone-group > .select2-container {
  flex: 0 0 var(--wf-phone-code-w) !important;
  width: var(--wf-phone-code-w) !important;
  max-width: 42% !important;
  height: 100% !important;
  margin: 0 !important;
  display: block !important;
}
html.wf-auth .wf-phone-group .select2-container .select2-selection--single,
html.wf-auth .wf-phone-group .select2-container--default .select2-selection--single,
html.wf-auth .wf-phone-group .select2-container--default.select2-container--focus .select2-selection--single,
html.wf-auth .wf-phone-group .select2-container--default.select2-container--open .select2-selection--single {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 1.35rem 0 0.65rem !important;
  border: 0 !important;
  border-right: 1px solid var(--border-strong) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)) !important;
  outline: none !important;
  box-shadow: none !important;
}
html.wf-auth .wf-phone-group .select2-container--default .select2-selection--single .select2-selection__rendered {
  display: flex !important;
  align-items: center !important;
  float: none !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  color: var(--text) !important;
}
html.wf-auth .wf-phone-group .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 0 !important;
  right: 2px !important;
  width: 18px !important;
  height: 100% !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
html.wf-auth .wf-phone-group .select2-container--default .select2-selection--single .select2-selection__arrow b {
  position: static !important;
  margin: 0 !important;
  border-color: var(--text-muted) transparent transparent transparent !important;
}
html.wf-auth .wf-phone-group .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--text-muted) transparent !important;
}
html.wf-auth .wf-phone-group .wf-phone-number,
html.wf-auth .wf-phone-group input.wf-input.wf-phone-number,
html.wf-auth .wf-phone-group input.wf-phone-number {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 0.95rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
}
html.wf-auth .wf-phone-group .wf-phone-number:hover,
html.wf-auth .wf-phone-group .wf-phone-number:focus,
html.wf-auth .wf-phone-group input.wf-input.wf-phone-number:hover,
html.wf-auth .wf-phone-group input.wf-input.wf-phone-number:focus {
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}
html.wf-auth .wf-field.has-error .wf-phone-group {
  border-color: var(--danger);
}
html.wf-auth .wf-field.has-error .wf-phone-group:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}

/* Select2 country: closed = flag + dial; options = dial + muted name */
html.wf-auth .wf-cc-opt,
.wf-cc-dropdown .wf-cc-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1;
}
.wf-cc-dropdown .wf-cc-opt.is-option {
  align-items: center;
  width: 100%;
}
html.wf-auth .wf-cc-flag,
.wf-cc-dropdown .wf-cc-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text, #111) 12%, transparent);
  flex: 0 0 auto;
}
.wf-cc-dropdown .wf-cc-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
html.wf-auth .wf-cc-dial,
.wf-cc-dropdown .wf-cc-dial {
  font-family: var(--font-sans, inherit);
  font-size: 0.95rem;
  font-weight: 600;
  color: inherit;
  line-height: 1.15;
}
.wf-cc-dropdown .wf-cc-name {
  display: block;
  font-family: var(--font-sans, inherit);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--tblr-secondary, var(--text-muted, #9aa8a1));
  white-space: normal;
  word-break: break-word;
}
.wf-cc-dropdown.select2-dropdown {
  min-width: 14rem;
  background: var(--tblr-bg-surface, var(--surface, #fff)) !important;
  color: var(--tblr-body-color, var(--text, #111)) !important;
  border: 1px solid var(--tblr-border-color, var(--border-strong, #d0d5d2)) !important;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 20, 0.14);
  z-index: 2000;
}
.wf-cc-dropdown .select2-search--dropdown {
  padding: 8px;
  background: var(--tblr-bg-surface, var(--surface, #fff)) !important;
}
.wf-cc-dropdown .select2-search--dropdown .select2-search__field {
  background: var(--tblr-bg-surface-secondary, var(--surface-2, #f1f4f2)) !important;
  color: var(--tblr-body-color, var(--text, #111)) !important;
  border: 1px solid var(--tblr-border-color, var(--border-strong, #d0d5d2)) !important;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.95rem;
  outline: none;
}
.wf-cc-dropdown .select2-results > .select2-results__options {
  background: var(--tblr-bg-surface, var(--surface, #fff)) !important;
}
.wf-cc-dropdown .select2-results__option,
.select2-container--default .wf-cc-dropdown .select2-results__option {
  padding: 8px 12px;
  background: transparent !important;
  color: var(--tblr-body-color, var(--text, #111)) !important;
}
.wf-cc-dropdown .select2-results__option[aria-selected='true'],
.select2-container--default .wf-cc-dropdown .select2-results__option[aria-selected='true'] {
  background: var(--tblr-bg-surface-secondary, var(--surface-2, #f1f4f2)) !important;
  color: var(--tblr-body-color, var(--text, #111)) !important;
}
.wf-cc-dropdown .select2-results__option--highlighted,
.wf-cc-dropdown .select2-results__option--highlighted[aria-selected],
.wf-cc-dropdown .select2-results__option--highlighted[aria-selected='true'],
.select2-container--default .wf-cc-dropdown .select2-results__option--highlighted,
.select2-container--default .wf-cc-dropdown .select2-results__option--highlighted[aria-selected],
.select2-container--default .wf-cc-dropdown .select2-results__option--highlighted[aria-selected='true'] {
  background: var(--tblr-primary, var(--primary, #0f7a4a)) !important;
  color: var(--on-primary, #fff) !important;
}
.wf-cc-dropdown .select2-results__option .wf-cc-dial,
.wf-cc-dropdown .select2-results__option--highlighted .wf-cc-dial,
.wf-cc-dropdown .select2-results__option--highlighted .wf-cc-name,
.wf-cc-dropdown .select2-results__option--highlighted .wf-cc-opt,
.wf-cc-dropdown .select2-results__option[aria-selected='true'] .wf-cc-dial {
  color: inherit !important;
}
.wf-cc-dropdown .select2-results__option[aria-selected='true']:not(.select2-results__option--highlighted) .wf-cc-name {
  color: var(--tblr-secondary, var(--text-muted, #9aa8a1)) !important;
}

html.wf-auth .wf-toggle {
  right: 2px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease);
}
html.wf-auth .wf-toggle:hover { color: var(--text); }
html.wf-auth .wf-toggle svg { width: 18px; height: 18px; }

/* inline field error: text only, no boxed banner */
html.wf-auth .wf-error {
  margin-top: var(--s-2);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
  gap: var(--s-2);
  animation: wfa-fade-down var(--t-med) var(--ease-out);
}
html.wf-auth .wf-error svg { width: 16px; height: 16px; margin-top: 2px; }
html.wf-auth .wf-field.has-error .wf-input {
  border-color: var(--danger);
  background: var(--surface);
}
html.wf-auth .wf-field.has-error .wf-input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}

/* ---------- alerts ---------- */
html.wf-auth .wf-alert {
  margin-bottom: var(--s-5);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.5;
  animation: wfa-fade-down var(--t-med) var(--ease-out);
}
html.wf-auth .wf-alert.is-success {
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
  color: var(--success);
}

/* ---------- remember / forgot row ---------- */
html.wf-auth .wf-row {
  margin: var(--s-1) 0 var(--s-5);
  gap: var(--s-3);
}
html.wf-auth .wf-check {
  min-height: 44px;
  gap: var(--s-2);
  font-size: 0.9rem;
  color: var(--text-muted);
}
html.wf-auth .wf-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
html.wf-auth .wf-link-muted {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  font-family: var(--font-sans);
}
html.wf-auth .wf-link-muted:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

html.wf-auth .wf-recaptcha-slot { margin: 0 0 var(--s-5); }

/* ---------- primary submit ---------- */
html.wf-auth .wf-submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-sans);
  font-size: 0.975rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
html.wf-auth .wf-submit::after { display: none; }   /* no looping shine */
html.wf-auth .wf-submit:hover { background: var(--primary-hover); transform: none; box-shadow: var(--shadow-sm); }
html.wf-auth .wf-submit:active { transform: scale(0.97); }
/* on-primary is often dark (black text on green) — spinner must stay bright */
html.wf-auth .wf-submit.wf-btn-loading .wf-spinner {
  --wf-spinner-track: rgba(255, 255, 255, 0.32);
  --wf-spinner-color: #fff;
}

/* ---------- footer links ---------- */
html.wf-auth .wf-auth-switch {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.925rem;
  color: var(--text-muted);
}
html.wf-auth .wf-auth-switch a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
html.wf-auth .wf-auth-switch a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
html.wf-auth .wf-auth-switch .wf-link-muted { min-height: 44px; }

html.wf-auth .wf-secure {
  margin-top: var(--s-4);
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}
html.wf-auth .wf-secure svg { width: 14px; height: 14px; color: var(--text-muted); }
html.wf-auth .wf-secure a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
html.wf-auth .wf-secure a:hover { color: var(--text); }

/* ---------- focus ---------- */
html.wf-auth :where(a, button):focus-visible,
html.wf-auth .wf-check input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- desktop split ---------- */
@media (min-width: 1024px) {
  html.wf-auth .wf-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
  html.wf-auth .wf-stage {
    display: flex;
    position: sticky;
    top: 0;
    height: 100dvh;
  }
  html.wf-auth .wf-auth-brand { display: none; }
  html.wf-auth .wf-auth-panel { padding-inline: var(--s-7); }
}
@media (min-width: 1280px) {
  html.wf-auth .wf-shell { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  html.wf-auth .wf-stage { padding: var(--s-6) var(--s-8); }
}
/* wide: copy left, phone right */
@media (min-width: 1280px) {
  html.wf-auth .wf-stage-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--s-6);
  }
  html.wf-auth .wf-stage-visual { height: 100%; }
}
/* short screens: drop the bullet list before the phone gets too small */
@media (min-width: 1024px) and (max-height: 820px) {
  html.wf-auth .wf-stage-points { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) and (max-height: 900px) {
  html.wf-auth .wf-stage-copy { display: none; }
}

/* ---------- motion ---------- */
@keyframes wfa-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes wfa-slide {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes wfa-phone {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes wfa-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes wfa-drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes wfa-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.05); opacity: 1; }
}
@keyframes wfa-fade-down {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.wf-auth *, html.wf-auth *::before, html.wf-auth *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- animated field errors ---------- */
/* the input gives a short shake and the red ring fades in; the message slides down */
html.wf-auth .wf-field.has-error .wf-input {
  animation: wfa-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}
html.wf-auth .wf-error.is-visible {
  display: flex;
  animation: wfa-error-in 280ms var(--ease-out) both;
}
@keyframes wfa-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
@keyframes wfa-error-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- read-only verified email (account setup) ---------- */
html.wf-auth .wf-control-verified { position: relative; }
html.wf-auth .wf-control-verified .wf-input {
  padding-right: 110px;
  background: var(--surface-2);
  color: var(--text-muted);
  box-shadow: none;
  cursor: default;
}
html.wf-auth .wf-control-verified .wf-input:focus { border-color: var(--border-strong); box-shadow: none; }
html.wf-auth .wf-verified {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
}
html.wf-auth .wf-verified svg { width: 13px; height: 13px; }

/* ---------- confirmation dialog ---------- */
html.wf-modal-open, html.wf-modal-open body { overflow: hidden; }

.wf-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.wf-modal[hidden] { display: none; }

.wf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 9, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}
.wf-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: var(--s-6);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  color: var(--text);
  text-align: center;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition:
    opacity 220ms var(--ease),
    transform 320ms var(--ease-out);
}
.wf-modal-dialog:focus { outline: none; }
.wf-modal.is-open .wf-modal-backdrop { opacity: 1; }
.wf-modal.is-open .wf-modal-dialog { opacity: 1; transform: none; }

.wf-modal-x {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.wf-modal-x:hover { background: var(--surface-2); color: var(--text); }
.wf-modal-x .wfl-icon { width: 18px; height: 18px; }

.wf-modal-ico {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto var(--s-4);
  border-radius: 18px;
  background: var(--tint);
  color: var(--primary);
}
.wf-modal.is-open .wf-modal-ico { animation: wfa-pop 520ms var(--ease-out) 120ms both; }
.wf-modal-ico svg { width: 28px; height: 28px; }

.wf-modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.wf-modal-text { margin: var(--s-2) 0 0; font-size: 0.95rem; color: var(--text-muted); }

.wf-modal-email {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.wf-modal-email strong {
  max-width: 100%;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.wf-modal-email .wf-link-muted {
  min-height: 36px;
  background: none;
  border: 0;
  padding: 0 var(--s-2);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}
.wf-modal-email .wf-link-muted:hover { text-decoration: underline; text-underline-offset: 3px; }

.wf-modal-notes {
  margin: var(--s-5) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-2);
  text-align: left;
}
.wf-modal-notes li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.wf-modal-notes .wfl-icon { width: 16px; height: 16px; margin-top: 2px; flex: none; color: var(--primary); }

.wf-modal .wf-alert { margin: var(--s-4) 0 0; text-align: left; }

.wf-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.wf-btn-secondary {
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.wf-btn-secondary:hover { background: var(--surface-2); }
.wf-btn-secondary:active { transform: scale(0.97); }
.wf-modal :where(button):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
/* the dialog lives outside .wf-auth-box, so re-apply the submit styling */
html.wf-auth .wf-modal .wf-submit { width: 100%; }

@media (max-width: 420px) {
  .wf-modal-dialog { padding: var(--s-6) var(--s-5); }
  .wf-modal-actions { grid-template-columns: 1fr; }
  .wf-modal-actions .wf-submit { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .wf-modal-backdrop, .wf-modal-dialog { transition: none; }
  html.wf-auth .wf-field.has-error .wf-input { animation: none; }
}

/* ---------- OTP verify animation ---------- */
/* row → clean circle → orbit around → success message */
html.wf-auth #otpPane.is-otp-busy .wf-field[data-field="otp"] > .wf-label,
html.wf-auth #otpPane.is-otp-busy .wf-otp-resend,
html.wf-auth #otpPane.is-otp-busy .wf-auth-switch {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
html.wf-auth #otpPane.is-otp-busy .wf-field[data-field="otp"] {
  margin-bottom: var(--s-3);
}
html.wf-auth .wf-otp-stage {
  --otp-box: 46px;
  --otp-radius: 72px;
  position: relative;
  min-height: 56px;
  margin-top: 2px;
  overflow: visible;
  transition: min-height 420ms cubic-bezier(0.22, 1, 0.36, 1), margin 420ms ease;
}
html.wf-auth .wf-otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 2;
}
html.wf-auth .wf-otp-box {
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  caret-color: var(--primary);
  transition:
    border-color 220ms var(--ease, ease),
    box-shadow 220ms var(--ease, ease),
    background-color 220ms var(--ease, ease),
    color 220ms var(--ease, ease);
}
html.wf-auth .wf-otp-box.is-filled {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-strong));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
html.wf-auth .wf-otp-box.is-pop {
  animation: wfa-otp-pop 340ms cubic-bezier(0.34, 1.45, 0.64, 1) both;
}
html.wf-auth .wf-otp-box:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent),
    0 0 18px color-mix(in srgb, var(--primary) 28%, transparent);
}
html.wf-auth .wf-otp-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--otp-radius) * 2);
  height: calc(var(--otp-radius) * 2);
  margin: calc(var(--otp-radius) * -1) 0 0 calc(var(--otp-radius) * -1);
  border-radius: 999px;
  border: 2px dashed color-mix(in srgb, var(--primary, #0f7a4a) 55%, transparent);
  box-shadow:
    0 0 0 10px color-mix(in srgb, var(--primary, #0f7a4a) 7%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--primary, #0f7a4a) 12%, transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transform: scale(0.7);
  transition: opacity 360ms ease, transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}
html.wf-auth .wf-otp-success {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.86);
  transition:
    opacity 280ms ease 60ms,
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1) 40ms;
}
html.wf-auth .wf-otp-success-ring {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--success, #16a34a) 48%, transparent);
  opacity: 0;
  transform: scale(0.55);
}
html.wf-auth .wf-otp-success-mark {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 2px solid var(--success, #16a34a);
  background: color-mix(in srgb, var(--success, #16a34a) 12%, var(--surface, #fff));
  color: var(--success, #16a34a);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--success, #16a34a) 18%, transparent);
}
html.wf-auth .wf-otp-success-mark svg { width: 28px; height: 28px; }
html.wf-auth .wf-otp-success-mark svg path {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
}
html.wf-auth .wf-otp-success-msg {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--success, #16a34a);
  opacity: 0;
  transform: translateY(6px);
}
html.wf-auth .wf-submit.is-otp-ok {
  background: var(--primary, #0f7a4a) !important;
  border-color: var(--primary, #0f7a4a) !important;
  color: var(--on-primary, #0a0f0d) !important;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary, #0f7a4a) 28%, transparent);
}
html.wf-auth .wf-submit:disabled:not(.wf-btn-loading):not(.is-otp-ok) {
  opacity: 0.45;
  cursor: not-allowed;
}

/* step 1+2: leave the row, sit on a clean circle, then spin around */
html.wf-auth .wf-otp-stage.is-verifying,
html.wf-auth .wf-otp-stage.is-orbiting,
html.wf-auth .wf-otp-stage.is-success {
  min-height: 196px;
  margin-block: 10px 6px;
}
html.wf-auth .wf-otp-stage.is-verifying .wf-otp-orbit,
html.wf-auth .wf-otp-stage.is-orbiting .wf-otp-orbit {
  opacity: 1;
  transform: scale(1);
}
html.wf-auth .wf-otp-stage.is-orbiting .wf-otp-orbit {
  animation: wfa-otp-orbit-spin 2.8s linear infinite;
}
html.wf-auth .wf-otp-stage.is-verifying .wf-otp-boxes,
html.wf-auth .wf-otp-stage.is-orbiting .wf-otp-boxes,
html.wf-auth .wf-otp-stage.is-success .wf-otp-boxes {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  gap: 0;
  z-index: 2;
}
html.wf-auth .wf-otp-stage.is-verifying .wf-otp-box,
html.wf-auth .wf-otp-stage.is-orbiting .wf-otp-box {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--otp-box);
  height: var(--otp-box);
  margin: calc(var(--otp-box) / -2) 0 0 calc(var(--otp-box) / -2);
  pointer-events: none;
  font-size: 1.15rem;
  border-color: color-mix(in srgb, var(--primary, #0f7a4a) 70%, var(--border-strong, #ccc));
  background: color-mix(in srgb, var(--primary, #0f7a4a) 8%, var(--surface, #fff));
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--primary, #0f7a4a) 16%, transparent),
    0 0 0 1px color-mix(in srgb, var(--primary, #0f7a4a) 18%, transparent);
  /* sit on circle; digits stay upright via counter-rotate */
  transform: rotate(var(--otp-a)) translateY(calc(var(--otp-radius) * -1)) rotate(calc(var(--otp-a) * -1));
  transition: transform 560ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease, box-shadow 220ms ease;
}
html.wf-auth .wf-otp-stage.is-orbiting .wf-otp-box {
  /* walk around the circle while digits stay upright */
  transition: none;
  animation: wfa-otp-digit-orbit 2.8s linear infinite;
}
html.wf-auth .wf-otp-box:nth-child(1) { --otp-a: 0deg; }
html.wf-auth .wf-otp-box:nth-child(2) { --otp-a: 60deg; }
html.wf-auth .wf-otp-box:nth-child(3) { --otp-a: 120deg; }
html.wf-auth .wf-otp-box:nth-child(4) { --otp-a: 180deg; }
html.wf-auth .wf-otp-box:nth-child(5) { --otp-a: 240deg; }
html.wf-auth .wf-otp-box:nth-child(6) { --otp-a: 300deg; }

/* step 3: collapse into success mark + message */
html.wf-auth .wf-otp-stage.is-success .wf-otp-orbit {
  opacity: 0;
  transform: scale(0.55);
  animation: none;
}
html.wf-auth .wf-otp-stage.is-success .wf-otp-boxes {
  animation: none;
  opacity: 0;
  visibility: hidden;
  filter: blur(5px);
  transform: scale(0.35);
  transition: opacity 320ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 320ms ease, visibility 0s linear 320ms;
  pointer-events: none;
}
html.wf-auth .wf-otp-stage.is-success .wf-otp-box {
  animation: none !important;
  transform: rotate(var(--otp-a)) translateY(0) rotate(calc(var(--otp-a) * -1)) scale(0.55);
  color: transparent;
}
html.wf-auth .wf-otp-stage.is-success .wf-otp-success {
  opacity: 1;
  transform: none;
}
html.wf-auth .wf-otp-stage.is-success .wf-otp-success-ring {
  animation: wfa-otp-ring 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.wf-auth .wf-otp-stage.is-success .wf-otp-success-mark {
  animation: wfa-otp-mark 560ms cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
html.wf-auth .wf-otp-stage.is-success .wf-otp-success-mark svg path {
  animation: wfa-otp-tick 420ms ease 160ms both;
}
html.wf-auth .wf-otp-stage.is-success .wf-otp-success-msg {
  animation: wfa-otp-msg 420ms ease 220ms both;
}

/* wrong code */
html.wf-auth .wf-otp-stage.is-error .wf-otp-boxes {
  animation: wfa-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
html.wf-auth .wf-otp-stage.is-error .wf-otp-box {
  border-color: color-mix(in srgb, var(--danger, #dc2626) 70%, var(--border-strong, #ccc));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #dc2626) 16%, transparent);
}

@media (max-width: 380px) {
  html.wf-auth .wf-otp-stage {
    --otp-box: 40px;
    --otp-radius: 62px;
  }
  html.wf-auth .wf-otp-boxes { gap: 6px; }
  html.wf-auth .wf-otp-box { height: 48px; font-size: 1.15rem; }
  html.wf-auth .wf-otp-stage.is-verifying,
  html.wf-auth .wf-otp-stage.is-orbiting,
  html.wf-auth .wf-otp-stage.is-success { min-height: 172px; }
  html.wf-auth .wf-otp-success-mark { width: 56px; height: 56px; border-radius: 14px; }
  html.wf-auth .wf-otp-success-ring { width: 84px; height: 84px; }
}

@keyframes wfa-otp-pop {
  0%   { transform: scale(0.72); }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes wfa-otp-orbit-spin {
  to { transform: rotate(360deg); }
}
/* move each digit around the circle; counter-rotate keeps the number upright */
@keyframes wfa-otp-digit-orbit {
  from {
    transform: rotate(var(--otp-a)) translateY(calc(var(--otp-radius) * -1)) rotate(calc(var(--otp-a) * -1));
  }
  to {
    transform: rotate(calc(var(--otp-a) + 360deg)) translateY(calc(var(--otp-radius) * -1)) rotate(calc(var(--otp-a) * -1 - 360deg));
  }
}
@keyframes wfa-otp-ring {
  0%   { opacity: 0; transform: scale(0.45); }
  55%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0.55; transform: scale(1); }
}
@keyframes wfa-otp-mark {
  0%   { transform: scale(0.55); opacity: 0; }
  70%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes wfa-otp-tick {
  to { stroke-dashoffset: 0; }
}
@keyframes wfa-otp-msg {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.wf-auth .wf-otp-box.is-pop,
  html.wf-auth .wf-otp-stage.is-orbiting .wf-otp-orbit,
  html.wf-auth .wf-otp-stage.is-orbiting .wf-otp-box,
  html.wf-auth .wf-otp-stage.is-success .wf-otp-success-ring,
  html.wf-auth .wf-otp-stage.is-success .wf-otp-success-mark,
  html.wf-auth .wf-otp-stage.is-success .wf-otp-success-mark svg path,
  html.wf-auth .wf-otp-stage.is-success .wf-otp-success-msg,
  html.wf-auth .wf-otp-stage.is-error .wf-otp-boxes {
    animation: none !important;
  }
  html.wf-auth .wf-otp-stage.is-success .wf-otp-success-mark svg path,
  html.wf-auth .wf-otp-stage.is-success .wf-otp-success-msg {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: none;
  }
}
