/* Shared layout for /login and /mfa/setup -- part of the redesigned Eliana
   system, not a generic SaaS login template and not old-dashboard styling.
   Deep navy canvas, the same dimensional particle field the Today screen
   uses, restrained motion, real focus states. */

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  overflow: hidden;
}

.auth-shell .particle-field {
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  background: var(--surface-elevated);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel), var(--edge-glow);
  padding: var(--space-8);
}

.auth-card--wide {
  max-width: 34rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.auth-brand__mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, var(--cyan-bright), var(--cyan-dim));
  color: var(--canvas-deep);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.auth-brand__name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--ivory);
}

.auth-card h1 {
  font-size: var(--text-xl);
  margin: 0 0 var(--space-2);
}

.auth-card p.auth-intro {
  margin: 0 0 var(--space-6);
}

.auth-field {
  margin-bottom: var(--space-4);
}

.auth-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-quiet);
  margin-bottom: var(--space-2);
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-elevated-2);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
}

.auth-field input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-color: var(--cyan);
}

.auth-submit {
  width: 100%;
  margin-top: var(--space-2);
}

.auth-alert {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--critical-wash);
  border: 1px solid rgba(226, 86, 76, .35);
  color: var(--ivory);
  font-size: var(--text-sm);
}

.auth-footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--text-2xs);
  color: var(--text-quiet);
}

/* MFA QR enrollment -- the QR itself is generated server-side (see
   lib/qr_code.js) as light-on-dark-brand-color modules on a plain white
   background, since a QR reader needs real contrast regardless of the
   page's own dark theme; the white card around it is deliberate, not a
   theming bug. */
.auth-qr {
  display: flex;
  justify-content: center;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.auth-qr img {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 1 / 1;
}

.auth-note {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--surface-elevated-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

/* MFA secret / manual key entry */
.auth-secret {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--surface-elevated-2);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  word-break: break-all;
  color: var(--cyan-bright);
  margin-bottom: var(--space-4);
  user-select: all;
}

.auth-otpauth {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-quiet);
  background: var(--surface-elevated-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  word-break: break-all;
  margin-bottom: var(--space-6);
  user-select: all;
}

.auth-recovery-codes {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.auth-recovery-codes li {
  background: var(--surface-elevated-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--ivory);
  text-align: center;
}

.auth-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.auth-confirm-row input[type='checkbox'] {
  margin-top: 3px;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--cyan);
}

.auth-confirm-row label {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

@media (max-width: 480px) {
  .auth-card { padding: var(--space-6); }
  .auth-recovery-codes { grid-template-columns: 1fr; }
}
