/* FEA Auth pages — Smart Elite light theme */
:root {
  --fea-auth-action: #4f46e5;
  --fea-auth-action-dark: #4338ca;
  --fea-auth-violet: #7c3aed;
  --fea-auth-slate: #64748b;
  --fea-auth-border: #e2e8f0;
  --fea-auth-card-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

/* Page shell: light grey canvas + marketing nav from smart-ui + fea-elite-sync */
body.fea-auth-page.fea-elite-sync.smart-landing-v2 {
  --smart-page: #f8fafc;
  background: #f8fafc !important;
  color: #475569;
}

body.fea-auth-page.fea-elite-sync.smart-landing-v2 .fea-auth-main {
  color: #475569;
}

/* Keep marketing nav row solid white when scrolled (fea-style dark scroll override loads earlier) */
body.fea-auth-page.fea-elite-sync.smart-landing-v2 .fea-nav.fea-nav-unified .fea-nav-inner,
body.fea-auth-page.fea-elite-sync.smart-landing-v2 .fea-nav.fea-nav-unified.scrolled .fea-nav-inner {
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

/* Auth pages: document scrolls when content is taller than the viewport */
html:has(body.fea-auth-viewport-lock) {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

.fea-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.fea-auth-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
}
/* Auth uses <main class="fea-wrap fea-auth-main"> — avoid marketing wrap width/padding fighting the card */
main.fea-auth-main.fea-wrap {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding-bottom: 0;
  padding-left: max(0.35rem, env(safe-area-inset-left));
  padding-right: max(0.35rem, env(safe-area-inset-right));
  box-sizing: border-box;
}

/* Auth shell: column layout; page scrolls (no trapped scroll inside cards) */
body.fea-auth-viewport-lock {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
body.fea-auth-viewport-lock.fea-auth-page {
  min-height: 100dvh;
}
body.fea-auth-viewport-lock .fea-nav {
  flex-shrink: 0;
}
/* Nav in document flow: no duplicate offset under fixed-nav padding (main padding-top removed below) */
body.fea-auth-viewport-lock .fea-nav.fea-nav-unified {
  position: relative;
  top: auto;
  margin-top: 0;
  padding-top: env(safe-area-inset-top, 0px);
}
body.fea-auth-viewport-lock .fea-nav.fea-nav-unified .fea-nav-utility {
  margin-top: 0;
}
body.fea-auth-viewport-lock .fea-nav.fea-nav-unified .fea-nav-utility-inner {
  margin-top: 0;
  padding-top: 0.25rem;
}
body.fea-auth-viewport-lock .fea-auth-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
/* Nav is not position:fixed here — stack height is already in layout; extra padding created a gap */
body.fea-auth-viewport-lock main.fea-auth-main.fea-wrap {
  padding-top: 0 !important;
  padding-bottom: 0;
}
body.fea-auth-viewport-lock .fea-auth-section {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) 1.25rem max(0.75rem, env(safe-area-inset-left));
  box-sizing: border-box;
}
/* One auth card width for login + register: centered, full width on phones, cap on large screens.
   min-width: 0 prevents flex/grid from letting wide form content blow past max-width (register rows). */
body.fea-auth-viewport-lock .fea-auth-container {
  width: min(100%, 450px);
  max-width: 450px;
  min-width: 0;
  flex: 0 1 auto;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  box-sizing: border-box;
}
body.fea-auth-viewport-lock .fea-auth-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
body.fea-auth-viewport-lock .fea-auth-card-login {
  max-height: none;
  overflow: visible;
}
body.fea-auth-viewport-lock .fea-auth-card-register {
  max-height: none;
  overflow: visible;
  display: block;
}
body.fea-auth-viewport-lock .fea-footer-auth-minimal {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 0.35rem;
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}

/* Glass chrome for auth pages: see .fea-nav.fea-nav-unified in fea-style.css */

/* — Login / forgot: centered card; page scrolls when needed */
body.fea-auth-login-shell.fea-auth-viewport-lock {
  min-height: 100dvh;
  overflow-x: hidden;
}
body.fea-auth-login-shell .fea-auth-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.fea-auth-login-shell .fea-auth-login-viewport {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
body.fea-auth-login-shell .fea-auth-section {
  width: 100%;
  display: block;
  padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) 1rem max(0.75rem, env(safe-area-inset-left));
  box-sizing: border-box;
}
body.fea-auth-login-shell .fea-auth-section > .fea-auth-container {
  width: min(100%, 450px);
  max-width: 450px;
  min-width: 0;
}

/* — Register: same; form grows with content, window scrolls */
body.fea-auth-register-shell.fea-auth-viewport-lock {
  min-height: 100dvh;
  overflow-x: hidden;
}
body.fea-auth-register-shell .fea-auth-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.fea-auth-register-shell .fea-auth-register-viewport {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
body.fea-auth-register-shell .fea-auth-section {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) 1rem max(0.75rem, env(safe-area-inset-left));
  box-sizing: border-box;
}
/* Register: explicit center + width cap (same numbers as login container) so layout matches login shell */
body.fea-auth-register-shell .fea-auth-section > .fea-auth-container {
  align-self: center;
  width: min(100%, 450px);
  max-width: 450px;
  min-width: 0;
  flex: 0 1 auto;
}

@media (max-height: 700px) {
  body.fea-auth-viewport-lock.fea-auth-register-shell .fea-nav-unified .fea-nav-inner {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }
  body.fea-auth-viewport-lock.fea-auth-register-shell .fea-logo-text {
    font-size: clamp(0.45rem, 1.85vw + 0.16rem, 0.72rem);
    line-height: 1.15;
  }
  body.fea-auth-viewport-lock.fea-auth-register-shell .fea-nav-unified .fea-logo-img {
    width: 32px;
    height: 32px;
    max-width: 32px;
  }
  body.fea-auth-register-shell .fea-auth-form .fea-field {
    margin-bottom: 0.45rem;
  }
  body.fea-auth-register-shell .fea-auth-form .fea-auth-row-2 {
    gap: 0.45rem;
    margin-bottom: 0.45rem;
  }
  body.fea-auth-register-shell .fea-consent-field {
    margin-bottom: 0.5rem;
  }
  body.fea-auth-register-shell .fea-auth-head-compact {
    margin-bottom: 0.45rem;
  }
  body.fea-auth-register-shell .fea-auth-head-compact .fea-auth-logo {
    width: 34px;
    height: 34px;
    margin-bottom: 0.35rem;
  }
  body.fea-auth-register-shell .fea-auth-register-progress .fea-auth-scroll-indicator {
    margin-bottom: 0.4rem;
  }
  body.fea-auth-register-shell .fea-auth-footer-tight {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
  }
  body.fea-auth-viewport-lock .fea-footer-auth-minimal {
    padding-top: 0.25rem;
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom));
  }
}

/* Ultra-short viewports: keep first form row visible (e.g. 320×568 phones) */
@media (max-height: 400px) {
  body.fea-auth-register-shell .fea-auth-sub {
    display: none;
  }
  body.fea-auth-register-shell .fea-auth-head-compact {
    margin-bottom: 0.35rem;
  }
  body.fea-auth-register-shell .fea-auth-head-compact .fea-auth-logo {
    width: 32px;
    height: 32px;
    margin-bottom: 0.25rem;
  }
  body.fea-auth-register-shell .fea-auth-register-progress .fea-auth-scroll-indicator {
    margin-bottom: 0.3rem;
  }
  body.fea-auth-register-shell .fea-auth-form .fea-field {
    margin-bottom: 0.4rem;
  }
  body.fea-auth-register-shell .fea-auth-form .fea-auth-row-2 {
    gap: 0.35rem;
    margin-bottom: 0.35rem;
  }
}
@media (max-height: 320px) {
  body.fea-auth-register-shell .fea-auth-title {
    font-size: 0.8rem;
  }
  body.fea-auth-register-shell .fea-auth-footer-tight {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
  }
}

/* — Header branding: single line, scales down, clears 44px hamburger + gap */
.fea-auth-page .fea-logo-with-wordmark {
  align-items: center;
  max-width: calc(100% - 48px - 0.5rem);
}
.fea-auth-page .fea-logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: unset;
  max-width: 100%;
  font-size: clamp(0.52rem, 2.35vw + 0.22rem, 0.875rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
@media (min-width: 993px) {
  .fea-auth-page .fea-logo-with-wordmark {
    flex: 0 0 auto;
    max-width: min(22rem, calc(100vw - 28rem));
  }
  .fea-auth-page .fea-logo-text {
    text-overflow: clip;
  }
}

/* Nav links: smart-ui supplies slate + blue hover on .smart-landing-v2 — keep touch targets */
body.fea-auth-page.smart-landing-v2 .fea-nav-actions .fea-nav-link {
  min-height: 44px;
  min-width: 44px;
}

.fea-auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 180px);
  padding: 1.25rem max(1rem, env(safe-area-inset-right)) 1.25rem max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}
.fea-auth-container {
  width: min(90%, 450px);
  max-width: 450px;
  margin: 0 auto;
  padding: 0 0.5rem;
  box-sizing: border-box;
}
.fea-auth-container-wide {
  max-width: 450px;
}
.fea-auth-card {
  background: #ffffff;
  border: 1px solid var(--fea-auth-border);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: var(--fea-auth-card-shadow);
  min-width: 0;
  max-width: 100%;
}
.fea-auth-card .fea-auth-title,
.fea-auth-card .fea-auth-sub,
.fea-auth-card .fea-label,
.fea-auth-card .fea-input,
.fea-auth-card .fea-select,
.fea-auth-card .fea-checkbox-label,
.fea-auth-card .fea-passkey-hint,
.fea-auth-card .fea-consent-hint,
.fea-auth-card .fea-auth-footer,
.fea-auth-card .fea-auth-link,
.fea-auth-card .fea-auth-link-strong {
  min-width: 0;
  max-width: 100%;
}
.fea-auth-card .fea-auth-title,
.fea-auth-card .fea-auth-sub,
.fea-auth-card .fea-label,
.fea-auth-card .fea-passkey-hint,
.fea-auth-card .fea-consent-hint,
.fea-auth-card .fea-checkbox-label span,
.fea-auth-card .fea-auth-footer p {
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.fea-auth-card .fea-select {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Registration: single column; window scrolls (no inner scroll trap) */
.fea-auth-card-register {
  display: block;
  max-height: none;
  padding: 0;
  overflow: hidden;
}
.fea-auth-card-register .fea-auth-head,
.fea-auth-card-register .fea-auth-card-scroll,
.fea-auth-card-register .fea-auth-footer {
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}
.fea-auth-card-register .fea-auth-head {
  padding-top: 1rem;
}
.fea-auth-card-register .fea-auth-card-scroll {
  display: block;
  min-height: 0;
  overflow: visible;
  padding-bottom: 0;
}
.fea-auth-card-register .fea-auth-footer {
  margin-top: 0.5rem;
  padding-top: 0.65rem;
}

/* Register: progress as thin Action Blue bar at top of card */
.fea-auth-card-register .fea-auth-register-progress {
  margin: 0;
  padding: 0.75rem 1.35rem 0.85rem;
  background: #ffffff;
  border-bottom: 1px solid var(--fea-auth-border);
  border-radius: 24px 24px 0 0;
}
.fea-auth-card-register .fea-auth-register-progress .fea-auth-scroll-indicator {
  position: static;
  z-index: auto;
  margin: 0;
  padding: 0;
  background: transparent;
}

.fea-auth-scroll-indicator {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 0.85rem;
  padding-bottom: 0.25rem;
  background: transparent;
}
.fea-auth-scroll-indicator-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fea-auth-slate);
  margin-bottom: 0.4rem;
}
.fea-auth-scroll-pct {
  font-variant-numeric: tabular-nums;
  color: #1e293b;
}
.fea-auth-scroll-indicator-track {
  height: 2px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.fea-auth-scroll-indicator-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--fea-auth-action) 0%, var(--fea-auth-violet) 100%);
  border-radius: inherit;
  transition: transform 0.15s ease-out;
}
.fea-auth-card-login {
  padding: 1.35rem 1.4rem;
}

.fea-forgot-email-hint {
  margin: 0.35rem 0 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--fea-auth-slate);
}
.fea-forgot-security {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: rgba(254, 243, 199, 0.55);
  border: 1px solid rgba(202, 138, 4, 0.55);
}
.fea-forgot-security-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.fea-forgot-security-title svg {
  color: #b45309;
  flex-shrink: 0;
}
.fea-forgot-security-body {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #57534e;
}
.fea-forgot-modal-steps-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
}
.fea-forgot-modal-ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #475569;
}
.fea-forgot-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}
.fea-forgot-modal-footer .fea-btn {
  width: 100%;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
.fea-forgot-modal-primary { text-align: center; }
.fea-auth-head { text-align: center; margin-bottom: 1.5rem; }
.fea-auth-head-compact { margin-bottom: 1rem; }
.fea-auth-head-compact .fea-auth-logo { width: 40px; height: 40px; margin-bottom: 0.5rem; }
.fea-field-tight { margin-bottom: 0.65rem !important; }
.fea-auth-row-tight { margin-bottom: 0.65rem !important; }
.fea-auth-footer-tight { margin-top: 0.85rem; padding-top: 0.75rem; }
.fea-auth-alert-inner { display: flex; align-items: flex-start; gap: 0.625rem; }
.fea-auth-alert-body { flex: 1; min-width: 0; }
.fea-auth-alert-label { font-weight: 600; color: #b91c1c; margin-bottom: 0.25rem; font-size: 0.8125rem; }
.fea-auth-alert-text { color: #991b1b; font-size: 0.75rem; line-height: 1.4; }
.fea-touch-target {
  min-height: 44px;
  min-width: 44px;
  box-sizing: border-box;
}
.fea-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.65rem 0;
  color: var(--fea-auth-slate);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fea-auth-divider::before,
.fea-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--fea-auth-border);
}
.fea-passkey-hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--fea-auth-slate);
  text-align: center;
}
.fea-passkey-hint a { color: var(--fea-auth-action); font-weight: 600; text-decoration: none; }
.fea-passkey-hint a:hover { text-decoration: underline; color: var(--fea-auth-action-dark); }

.fea-footer-auth-minimal {
  text-align: center;
  margin-top: 0;
  padding: 0.55rem 1rem max(0.55rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--fea-auth-border);
  background: #ffffff;
  box-shadow: 0 -1px 0 rgba(15, 23, 42, 0.06);
}
.fea-footer-auth-minimal .fea-footer-brand-line {
  margin: 0 0 0.3rem 0;
  font-size: 0.72rem;
  color: var(--fea-auth-slate);
  line-height: 1.4;
}
.fea-footer-auth-minimal .fea-footer-copy {
  margin: 0;
  font-size: 0.7rem;
  color: #64748b;
}
.fea-auth-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  display: block;
}
.fea-auth-title {
  margin: 0 0 0.25rem 0;
  font-size: clamp(0.95rem, 2.2vw + 0.6rem, 1.25rem);
  font-weight: 700;
  color: #0f172a;
}
.fea-auth-sub {
  margin: 0;
  font-size: clamp(0.75rem, 1.2vw + 0.65rem, 0.875rem);
  color: var(--fea-auth-slate);
}
.fea-auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--fea-radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}
.fea-auth-alert-icon--info {
  display: none;
}
.fea-auth-alert-info .fea-auth-alert-icon--error {
  display: none;
}
.fea-auth-alert-info .fea-auth-alert-icon--info {
  display: block;
}
.fea-auth-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-left: 3px solid #EF4444;
}
.fea-auth-alert-info {
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-left: 3px solid #3b82f6;
}
.fea-auth-alert-info .fea-auth-alert-label {
  color: #0369a1;
}
.fea-auth-alert-info .fea-auth-alert-text {
  color: #0c4a6e;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.fea-auth-alert-error #errorMessageText,
.fea-auth-alert-error .fea-auth-alert-error div { color: #b91c1c; font-size: 0.8125rem; }
.fea-auth-alert-error .fea-auth-alert-label {
  color: #b91c1c;
}
.fea-auth-alert-error .fea-auth-alert-text {
  color: #991b1b;
}
.fea-auth-alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-left: 3px solid #22C55E;
}
.fea-auth-alert-success #successMessageText,
.fea-auth-alert-success div { color: #15803d; font-size: 0.8125rem; }
.fea-auth-form .fea-field { margin-bottom: 1rem; }
.fea-auth-form .fea-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.4rem;
}

/* Input icons + light fields */
.fea-input-has-icon {
  position: relative;
  display: block;
}
.fea-input-has-icon .fea-input-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}
.fea-input-has-icon .fea-input-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
.fea-input-has-icon > .fea-input,
.fea-input-has-icon > .fea-select {
  padding-left: 2.65rem;
  width: 100%;
}
.fea-auth-page .fea-input-has-icon > .fea-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
/* — Auth fields: white surface, slate border, Action Blue focus */
.fea-auth-page .fea-input,
.fea-auth-page .fea-select,
.fea-auth-page .fea-textarea {
  background: #ffffff !important;
  border: 1px solid var(--fea-auth-border) !important;
  border-radius: 0.75rem;
  color: #0f172a;
  box-shadow: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.fea-auth-page .fea-input,
.fea-auth-page .fea-select {
  min-height: 44px;
}
.fea-auth-page .fea-input::placeholder,
.fea-auth-page .fea-textarea::placeholder {
  color: #94a3b8;
}
.fea-auth-page .fea-input:hover,
.fea-auth-page .fea-select:hover,
.fea-auth-page .fea-textarea:hover {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}
.fea-auth-page .fea-input:focus,
.fea-auth-page .fea-select:focus,
.fea-auth-page .fea-textarea:focus,
.fea-auth-page .fea-input:focus-visible,
.fea-auth-page .fea-select:focus-visible,
.fea-auth-page .fea-textarea:focus-visible {
  outline: none !important;
  border-color: var(--fea-auth-action) !important;
  box-shadow: 0 0 0 2px var(--fea-auth-action) !important;
  background: #ffffff !important;
}
.fea-auth-page .fea-input-wrap .fea-input:focus,
.fea-auth-page .fea-input-wrap .fea-input:focus-visible {
  border-color: var(--fea-auth-action) !important;
  box-shadow: 0 0 0 2px var(--fea-auth-action) !important;
}
.fea-input-wrap { position: relative; }
.fea-input-wrap .fea-input {
  width: 100%;
}
.fea-input-wrap:not(.fea-input-has-icon) .fea-input {
  padding-right: 2.75rem;
}
.fea-input-has-icon.fea-input-wrap .fea-input {
  padding-left: 2.65rem;
  padding-right: 2.75rem;
}
.fea-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  color: #94a3b8;
  transition: color 0.2s;
}
.fea-password-toggle:hover { color: var(--fea-auth-action); }
.fea-auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.fea-auth-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.fea-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #475569;
}
.fea-checkbox-label input { margin-right: 0.5rem; width: 1rem; height: 1rem; }
.fea-auth-link { color: var(--fea-auth-action); text-decoration: none; font-weight: 500; }
.fea-auth-link:hover { text-decoration: underline; color: var(--fea-auth-action-dark); }
.fea-auth-link:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35); border-radius: 2px; }
.fea-auth-link-strong { color: var(--fea-auth-action); font-weight: 600; text-decoration: none; }
.fea-auth-link-strong:hover { text-decoration: underline; color: var(--fea-auth-action-dark); }
.fea-password-toggle:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--fea-accent-soft); border-radius: 4px; }
.fea-modal-close:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--fea-accent-soft); }
.fea-required { color: #dc2626; }
.fea-auth-submit { width: 100%; }

/* — Auth primary actions: pill, Action Blue → violet gradient */
.fea-auth-page .fea-auth-card .fea-btn.fea-auth-submit,
.fea-auth-page .fea-auth-card .fea-btn-primary-auth,
.fea-auth-page .fea-auth-card .fea-btn.fea-btn-passkey {
  height: 44px;
  min-height: 44px !important;
  max-height: none;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 50px !important;
  box-sizing: border-box;
}

/* Primary CTA — Action Blue gradient */
.fea-btn-primary-auth {
  width: 100%;
  background: linear-gradient(120deg, #4f46e5 0%, #6366f1 40%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(67, 56, 202, 0.65) !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.28);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.fea-btn-primary-auth:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.36);
  color: #ffffff !important;
}
.fea-btn-primary-auth:active {
  transform: scale(0.99);
}
.fea-btn-primary-auth:focus-visible {
  outline: none;
  border-color: #4338ca !important;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px rgba(79, 70, 229, 0.45),
    0 10px 28px rgba(79, 70, 229, 0.3);
}
.fea-btn-primary-auth:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Biometrics — clean secondary (white + light blue border).
   Must beat `.smart-landing-v2 .fea-btn { color: #fff }` (passkey also has `.fea-btn`). */
.fea-auth-page .fea-auth-card .fea-btn.fea-btn-passkey {
  width: 100%;
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid rgba(59, 130, 246, 0.55) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.fea-auth-page .fea-auth-card .fea-btn.fea-btn-passkey:hover,
.fea-auth-page .fea-auth-card .fea-btn.fea-btn-passkey:visited {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}
.fea-auth-page .fea-auth-card .fea-btn.fea-btn-passkey:active {
  transform: scale(0.99);
}
.fea-auth-page .fea-auth-card .fea-btn.fea-btn-passkey:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px rgba(59, 130, 246, 0.35),
    0 2px 8px rgba(59, 130, 246, 0.12);
}
.fea-auth-page .fea-auth-card .fea-btn.fea-btn-passkey:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fea-auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--fea-auth-border);
}
.fea-auth-footer p { margin: 0; font-size: 0.875rem; color: var(--fea-auth-slate); }
.fea-hint { color: var(--fea-auth-slate); font-size: 0.75rem; margin-top: 0.35rem; display: block; }
.fea-input-code { text-align: center; font-size: 1.25rem; letter-spacing: 0.25em; font-weight: 600; }
.fea-password-strength { margin-top: 0.5rem; }
.fea-strength-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}
.fea-strength-fill { height: 100%; transition: width 0.3s, background 0.3s; border-radius: 2px; }
.strength-text { color: var(--fea-auth-slate); font-size: 0.7rem; display: block; margin-top: 0.25rem; }
.fea-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  z-index: 10060;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(400px, calc(100vw - 2rem));
}
@media (max-width: 480px) {
  .fea-toast-container { left: 1rem; right: 1rem; top: max(1rem, env(safe-area-inset-top)); max-width: none; }
}

/* Modal */
.fea-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10040;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  overflow-y: auto;
}
.fea-modal-content {
  background: #ffffff;
  border: 1px solid var(--fea-auth-border);
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  margin: auto;
  max-height: min(90vh, calc(100vh - 2rem));
  overflow-y: auto;
  box-shadow: var(--fea-auth-card-shadow);
}
.fea-modal-header {
  padding: 1.25rem 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fea-modal-header h3 { margin: 0; font-size: 1.1rem; color: #0f172a; }
.fea-modal-close {
  background: none;
  border: none;
  color: var(--fea-auth-slate);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: var(--fea-radius-xs);
}
.fea-modal-close:hover { color: #0f172a; background: rgba(15, 23, 42, 0.06); }
.fea-modal-body { padding: 1.25rem; }
.fea-modal-icon-wrap {
  width: 48px;
  height: 48px;
  background: rgba(79, 70, 229, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  color: var(--fea-auth-action);
}
.fea-modal-title { margin: 0 0 0.25rem 0; font-size: 0.9375rem; font-weight: 600; color: #0f172a; text-align: center; }
.fea-modal-desc { margin: 0 0 1rem 0; font-size: 0.8125rem; color: #475569; text-align: center; line-height: 1.5; }
.fea-modal-footer { margin: 1rem 0 0; font-size: 0.8125rem; color: #64748b; text-align: center; }

@media (max-width: 768px) {
  .fea-auth-section { padding: 1.5rem 1rem; min-height: calc(100vh - 160px); }
  .fea-auth-card:not(.fea-auth-card-register) {
    padding: 1.5rem;
  }
}
@media (max-width: 720px) {
  .fea-auth-row-2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .fea-auth-card:not(.fea-auth-card-register) {
    padding: 1.25rem;
  }
  .fea-auth-section { padding: 1.25rem 0.75rem; }
}
@media (max-width: 480px) {
  .fea-auth-section { padding: 0.35rem 0.65rem; }
  .fea-auth-title {
    font-size: clamp(0.88rem, 3.5vw + 0.45rem, 1.05rem);
  }
  .fea-auth-card-login .fea-auth-title {
    font-size: clamp(0.82rem, 4vw + 0.35rem, 1rem);
  }
  .fea-auth-sub { font-size: clamp(0.68rem, 2vw + 0.55rem, 0.78rem); line-height: 1.35; }
  /* Compact card gutter; keep Smart Elite radius */
  .fea-auth-card-login {
    padding: 1.1rem 1rem;
    border-radius: 22px;
  }
  .fea-auth-card-register {
    padding: 0;
    border-radius: 22px;
  }
  .fea-auth-card-register .fea-auth-register-progress {
    border-radius: 22px 22px 0 0;
  }
  .fea-auth-head-compact { margin-bottom: 0.65rem; }
  .fea-auth-head-compact .fea-auth-logo {
    width: 32px;
    height: 32px;
    margin-bottom: 0.4rem;
  }
  .fea-auth-form .fea-label { font-size: 0.625rem; margin-bottom: 0.3rem; letter-spacing: 0.05em; }
  .fea-auth-form .fea-field { margin-bottom: 0.55rem; }
  .fea-input,
  .fea-select,
  .fea-auth-form .fea-input {
    min-height: 44px;
    font-size: 0.875rem;
  }
  .fea-btn.fea-auth-submit,
  .fea-btn-primary-auth,
  .fea-auth-card .fea-btn.fea-btn-passkey { min-height: 44px; font-size: 0.875rem; }
  /* Tighter gap: Sign In CTA ↔ divider ↔ Biometrics */
  .fea-auth-card-login .fea-auth-submit { margin-bottom: 0; }
  .fea-auth-divider { margin: 0.3rem 0; gap: 0.5rem; font-size: 0.625rem; }
  .fea-passkey-hint { font-size: 0.625rem; margin-top: 0.3rem; line-height: 1.4; }
  .fea-auth-footer-tight { margin-top: 0.55rem; padding-top: 0.55rem; }
  .fea-auth-card-register .fea-auth-register-progress .fea-auth-scroll-indicator {
    margin-bottom: 0.45rem;
  }
  .fea-auth-scroll-indicator-label { font-size: 0.5625rem; margin-bottom: 0.3rem; }
  .fea-modal-content { max-height: min(88vh, calc(100vh - 1.5rem)); border-radius: var(--fea-radius-sm); }
  .fea-btn-sm { min-height: 44px; padding: 0.45rem 0.85rem; font-size: 0.8125rem; }
}

/* Enroll CTA in auth chrome — match primary gradient */
body.fea-auth-page.fea-elite-sync.smart-landing-v2 .fea-nav-cta {
  background: linear-gradient(120deg, #4f46e5 0%, #6366f1 45%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(67, 56, 202, 0.55) !important;
  min-height: 44px;
  height: 44px;
  border-radius: 50px !important;
  padding: 0 1.1rem;
  font-weight: 700 !important;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.28);
  transition: filter 0.2s, box-shadow 0.2s, transform 0.1s;
  box-sizing: border-box;
}
body.fea-auth-page.fea-elite-sync.smart-landing-v2 .fea-nav-cta:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.36);
  color: #ffffff !important;
}
body.fea-auth-page.fea-elite-sync.smart-landing-v2 .fea-nav-cta:active {
  transform: scale(0.98);
}

/* Consent: accept terms only after opening modal and scrolling to end */
.fea-consent-field { margin-bottom: 1rem; }
.fea-consent-field .fea-checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; cursor: default; }
.fea-consent-field #terms { pointer-events: none; }
.fea-consent-hint { font-size: 0.75rem; color: var(--fea-auth-slate); margin: 0.35rem 0 0.5rem 0; line-height: 1.4; }
.fea-btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; min-height: 36px; }

/* Terms consent modal overlay — above locked auth shell so legal copy always scrolls */
.fea-consent-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; visibility: hidden; opacity: 0; transition: visibility 0.2s, opacity 0.2s; }
.fea-consent-modal.fea-consent-modal-open { visibility: visible; opacity: 1; }
.fea-consent-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); cursor: pointer; }
.fea-consent-modal-box { position: relative; background: #ffffff; border: 1px solid var(--fea-auth-border); border-radius: 20px; max-width: 560px; width: 100%; max-height: min(90vh, 90dvh); display: flex; flex-direction: column; box-shadow: var(--fea-auth-card-shadow); }
.fea-consent-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--fea-auth-border); flex-shrink: 0; }
.fea-consent-modal-header h2 { margin: 0; font-size: 1.1rem; font-weight: 600; color: #0f172a; }
.fea-consent-modal-close { background: none; border: none; color: var(--fea-auth-slate); font-size: 1.5rem; line-height: 1; padding: 0.25rem; cursor: pointer; border-radius: var(--fea-radius-xs); }
.fea-consent-modal-close:hover { color: #0f172a; background: rgba(15, 23, 42, 0.06); }
.fea-consent-modal-body { padding: 1rem 1.25rem; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.fea-consent-modal-intro { font-size: 0.8125rem; color: #475569; margin: 0 0 0.75rem 0; line-height: 1.45; }
.fea-consent-terms-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border: 1px solid var(--fea-auth-border); border-radius: 12px; background: #ffffff; padding: 1rem; max-height: min(280px, 42vh, 42dvh); }
.fea-consent-terms-content { font-size: 0.8125rem; line-height: 1.55; color: #475569; }
.fea-consent-terms-content h3 { font-size: 0.9375rem; margin: 1rem 0 0.5rem 0; color: #1e293b; }
.fea-consent-terms-content h3:first-child { margin-top: 0; }
.fea-consent-terms-content p { margin: 0 0 0.5rem 0; }
.fea-consent-terms-content ul, .fea-consent-terms-content ol { margin: 0 0 0.5rem 0; padding-left: 1.25rem; }
.fea-consent-terms-end { margin-top: 1rem; padding-top: 0.5rem; border-top: 1px dashed var(--fea-auth-border); font-size: 0.75rem; color: var(--fea-auth-action); text-align: center; }
.fea-consent-modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--fea-auth-border); flex-shrink: 0; text-align: center; }
.fea-consent-sign-btn { width: 100%; max-width: 240px; border-radius: 50px !important; }
.fea-consent-sign-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fea-consent-footer-hint { font-size: 0.7rem; color: var(--fea-auth-slate); margin: 0.5rem 0 0 0; }

/* Secondary buttons on auth (outline) */
body.fea-auth-page .fea-btn-outline {
  border-radius: 50px !important;
  border: 1px solid var(--fea-auth-border) !important;
  color: #1e293b !important;
  background: #ffffff !important;
}
body.fea-auth-page .fea-btn-outline:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
}

@media (max-width: 480px) {
  .fea-consent-terms-scroll {
    max-height: min(52vh, 52dvh, 360px);
  }
  .fea-consent-modal-box {
    max-height: min(92vh, 92dvh);
  }
}
