.auth {
  position: relative;
  display: flex;
  flex-direction: column;

  height: 100%;
  background: var(--surface-page);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.auth__wash {
  pointer-events: none;
  position: absolute;
  inset: 0 0 55% 0;
  background:
    radial-gradient(
      ellipse 120% 80% at 50% -20%,
      color-mix(in srgb, var(--brand-100) 70%, transparent),
      transparent 65%
    );
}

.auth__portal {
  position: relative;
  z-index: var(--z-base);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(env(safe-area-inset-top), var(--space-10)) var(--space-6) var(--space-10);
}

.auth__portal-inner {
  width: 100%;
  max-width: 25rem;
  display: flex;
  flex-direction: column;
}

.auth__logo-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-10);
}

.auth__well {
  background-color: var(--surface-zone-well);
  border-radius: 12px;
  padding: var(--space-6);
}

.auth__stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.auth__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-6);
  text-align: center;
}

.auth__logo-fallback {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.auth__logo-mark {
  width: var(--space-8);
  height: var(--space-8);
  border-radius: var(--radius-lg);
  object-fit: contain;
  flex-shrink: 0;
}

.auth__wordmark-text {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
}

.auth__wordmark-name {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.auth__welcome {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: center;
}

.auth__welcome-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

.auth__welcome-subtitle {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.auth__header {
  display: none;
  flex-direction: column;
  gap: var(--space-2);
}

.auth__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.auth__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
  color: var(--text-primary);
}

.auth__subtitle {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.auth__lead { display: flex; flex-direction: column; gap: var(--space-2); }
.auth__lead-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}
.auth__lead-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.auth__choices { display: flex; flex-direction: column; gap: var(--space-3); }
.auth__choice {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--surface-base);
  box-shadow: inset 0 0 0 1.5px var(--input-border);
  color: var(--text-primary);
  text-decoration: none;
  transition: box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.auth__choice:hover { box-shadow: inset 0 0 0 1.5px var(--brand-600); }
.auth__choice:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.auth__choice--primary { box-shadow: inset 0 0 0 1.5px var(--brand-600); background: var(--brand-50); }
.auth__choice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--space-12);
  height: var(--space-12);
  border-radius: var(--radius-full);
  background: var(--brand-100);
  color: var(--brand-600);
}
.auth__choice-icon .material-symbols-rounded { font-size: var(--text-2xl); }
.auth__choice-body { display: flex; flex-direction: column; gap: var(--space-0-5); flex: 1; min-width: 0; }
.auth__choice-title { font-family: var(--font-display); font-size: var(--text-base); font-weight: var(--weight-semibold); }
.auth__choice-text { font-family: var(--font-display); font-size: var(--text-sm); color: var(--text-secondary); }
.auth__choice-go { color: var(--text-tertiary); font-size: var(--text-xl); }

.auth__form-body { display: flex; flex-direction: column; gap: var(--space-6); }
.auth__fields { display: flex; flex-direction: column; gap: var(--space-4); }
.auth__field { display: flex; flex-direction: column; gap: var(--space-2); }
.auth__label-row { display: flex; align-items: center; justify-content: space-between; }
.auth__label { font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); }

.auth__input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--surface-base);
  border: 1.5px solid var(--input-border);
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.auth__input-wrap:focus-within {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 var(--space-1) color-mix(in srgb, var(--brand-600) 18%, transparent);
}
.auth__input-icon { color: var(--text-tertiary); font-size: var(--text-xl); transition: color var(--duration-fast) var(--ease-out); }
.auth__input-wrap:focus-within .auth__input-icon { color: var(--brand-600); }
.auth__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font-family: var(--font-display);

  font-size: var(--text-base);
  color: var(--text-primary);
}
.auth__input::placeholder { color: var(--input-placeholder); }

.auth__field .field_with_errors,
.auth__label-row .field_with_errors { display: contents; }
.auth__input-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
}
.auth__input-toggle .material-symbols-rounded { font-size: var(--text-xl); }
.auth__input-toggle:hover { color: var(--text-secondary); }
.auth__input-toggle:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

.auth__meta-row { display: flex; align-items: center; justify-content: space-between; }
.auth__remember { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.auth__checkbox {
  width: 1.1875rem; height: 1.1875rem; margin: 0;
  accent-color: var(--brand-600);
  cursor: pointer;
}
.auth__remember-label { font-family: var(--font-display); font-size: var(--text-sm); color: var(--text-secondary); }
.auth__link {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--brand-600);
  text-decoration: none;
}
.auth__link:hover { text-decoration: underline; }

.auth__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  color: var(--text-on-accent);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-lg), 0 var(--space-2) var(--space-5) calc(var(--space-0-5) * -1) color-mix(in srgb, var(--brand-600) 35%, transparent);
  transition: filter var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.auth__submit:hover { filter: brightness(1.05); }
.auth__submit:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.auth__submit:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.auth__submit .material-symbols-rounded { font-size: var(--text-xl); }

.auth__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.auth__hint .material-symbols-rounded { font-size: var(--text-base); }

.auth__legal {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  text-align: center;
  color: var(--text-tertiary);
}
.auth__legal a { color: inherit; text-decoration: underline; }

.auth__back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
}
.auth__back:hover { color: var(--text-primary); }
.auth__back .material-symbols-rounded { font-size: var(--text-lg); }

.auth__confirm { display: flex; flex-direction: column; align-items: center; gap: var(--space-6); text-align: center; }
.auth__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  border-radius: var(--radius-full);
  background: var(--brand-100);
  box-shadow: var(--shadow-lg), 0 var(--space-2) var(--space-6) color-mix(in srgb, var(--brand-400) 30%, transparent);
}
.auth__badge .material-symbols-rounded { font-size: var(--text-4xl); color: var(--brand-600); font-variation-settings: 'wght' 500; }
.auth__confirm-header { display: flex; flex-direction: column; gap: var(--space-3); }
.auth__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.auth__chip .material-symbols-rounded { font-size: var(--text-lg); color: var(--brand-600); }
.auth__actions { display: flex; flex-direction: column; gap: var(--space-4); width: 100%; }
.auth__resend { display: flex; align-items: center; justify-content: center; gap: var(--space-1-5); font-family: var(--font-display); font-size: var(--text-sm); color: var(--text-secondary); }
.auth__resend-form { display: contents; }
.auth__resend-btn {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--brand-600);
}
.auth__resend-btn:disabled { color: var(--text-tertiary); cursor: not-allowed; }
.auth__resend-timer { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-tertiary); }
.auth__rule { width: 100%; height: 1px; background: var(--border-default); }
.auth__reassure { display: flex; align-items: center; justify-content: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-sm); color: var(--text-tertiary); }
.auth__reassure .material-symbols-rounded { font-size: var(--text-base); color: var(--status-success); }

.auth__strength { display: flex; flex-direction: column; gap: var(--space-2); }
.auth__strength-bars { display: flex; gap: var(--space-1-5); }
.auth__strength-bar { flex: 1; height: 5px; border-radius: var(--radius-sm); background: var(--surface-sunken); transition: background var(--duration-fast) var(--ease-out); }
.auth__strength-meta { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-size: var(--text-xs); }
.auth__strength-meta-label { color: var(--text-tertiary); }
.auth__strength-meta-value { font-weight: var(--weight-semibold); color: var(--text-tertiary); }

.auth__error {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--status-error-bg);
  border: 1px solid color-mix(in srgb, var(--status-error) 30%, transparent);
  text-align: left;
}
.auth__error .material-symbols-rounded { font-size: var(--text-xl); color: var(--status-error); flex-shrink: 0; }
.auth__error-body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.auth__error-text { font-family: var(--font-display); font-size: var(--text-sm); color: var(--status-error-text); line-height: var(--leading-snug); margin: 0; }

.auth__notice {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--status-success-bg);
  border: 1px solid color-mix(in srgb, var(--status-success) 30%, transparent);
  text-align: left;
}
.auth__notice .material-symbols-rounded { font-size: var(--text-xl); color: var(--status-success); flex-shrink: 0; }
.auth__notice-text { font-family: var(--font-display); font-size: var(--text-sm); color: var(--status-success-text); line-height: var(--leading-snug); margin: 0; }

@media (min-width: 769px) {
  .auth__welcome { display: none; }
  .auth__header { display: flex; text-align: left; }
  .auth__portal { padding: var(--space-12) var(--space-6); }
  .auth__logo-zone { margin-bottom: var(--space-12); }
}

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