/* ============================================================================
   AUTH FLOW — production styles matching design/assets/auth-app.jsx
   (handoff docs/05). Phone-first column on .theme-floor (dark).
   ========================================================================== */

html, body { margin: 0; height: 100%; }
body { background: var(--bg); }

/* BUG-001: our display:flex rules on banners/field-errors would otherwise
   override the UA's [hidden] { display:none } and show empty error chrome */
[hidden] { display: none !important; }

.auth-stage {
  height: 100vh;
  height: 100dvh; /* dynamic viewport: tracks the mobile URL bar (BUG-015) */
  overflow-y: auto; /* auth forms taller than the viewport scroll here, inside the locked page */
  display: flex;
  justify-content: center;
  background: var(--bg);
}
.auth-phone {
  width: 100%;
  max-width: 402px;
  min-height: 100%; /* fill the stage (the stage owns viewport sizing — BUG-015) */
  display: flex;
  flex-direction: column;
}

.auth-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 72px 24px 32px;
}
.auth-screen--center {
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  gap: 20px;
  text-align: center;
}

.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth-logo img { width: 56px; height: 56px; object-fit: contain; }
.auth-logo .auth-logo-sub {
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-lo);
}

.auth-spacer { flex: 1; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-title { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.05; color: var(--text-hi); }
.auth-sub { color: var(--text-mid); font-size: 15px; margin-top: 4px; line-height: 1.5; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-lo);
}
.auth-field.has-error .auth-label { color: var(--stop); }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input {
  width: 100%; height: 56px; padding: 0 16px; box-sizing: border-box;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-family: var(--font-ui); font-size: 16px;
  color: var(--text-hi); outline: none; transition: border-color 120ms;
}
.auth-input:focus { border-color: var(--accent); }
.auth-field.has-error .auth-input { border-color: var(--stop); }
.auth-input--pass { padding-right: 48px; }
.auth-eye {
  position: absolute; right: 12px; background: none; border: none;
  color: var(--text-lo); cursor: pointer; padding: 4px; display: grid;
}
.auth-field-error { font-size: 13px; color: var(--stop); display: flex; gap: 6px; align-items: center; }

.auth-banner {
  padding: 12px 14px; background: var(--stop-soft); border-radius: var(--r-md);
  font-size: 14px; color: var(--stop); display: flex; gap: 8px; align-items: center;
}

.auth-primary {
  min-height: 60px; font-size: 18px; margin-top: 4px;
}
.auth-primary[disabled] { opacity: 0.45; cursor: default; }
.auth-primary.is-loading { opacity: 0.7; }

.auth-link {
  background: none; border: none; color: var(--text-mid); cursor: pointer;
  font-size: 15px; padding: 8px 0; text-align: center; font-family: var(--font-ui);
}
.auth-link--accent { color: var(--accent); display: flex; align-items: center; gap: 6px; justify-content: center; }
.auth-back {
  background: none; border: none; color: var(--text-mid); cursor: pointer;
  align-self: flex-start; display: flex; align-items: center; gap: 6px;
  font-size: 15px; padding: 0 0 32px; font-family: var(--font-ui);
}

.auth-badge {
  width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center;
}
.auth-badge--accent { background: var(--accent-soft); color: var(--accent); width: 64px; height: 64px; border-radius: 20px; }
.auth-badge--go { background: var(--go-soft); color: var(--go); }
.auth-badge--stop { background: var(--stop-soft); color: var(--stop); }

.auth-code-row { display: flex; gap: 8px; margin: 8px 0; justify-content: center; }
.auth-code-digit {
  width: 44px; height: 56px; text-align: center; font-size: 24px; font-weight: 700;
  font-family: var(--font-display); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  color: var(--text-hi); outline: none;
}
.auth-code-digit.is-filled { border-color: var(--accent); }
.auth-code-row.has-error .auth-code-digit { border-color: var(--stop); }

.auth-rules { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.auth-rule { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-lo); }
.auth-rule.is-met { color: var(--go); }

.auth-note { font-size: 13px; color: var(--text-lo); text-align: center; line-height: 1.5; }
.auth-email-pill {
  padding: 10px 14px; background: var(--surface-2); border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 13px; color: var(--text-mid);
  overflow-wrap: anywhere;
}
.auth-email-pill span { color: var(--text-lo); }

.auth-qr {
  background: #fff; border-radius: var(--r-md); padding: 12px;
  display: grid; place-items: center; align-self: center;
}
.auth-qr img, .auth-qr svg { width: 180px; height: 180px; display: block; }
.auth-secret {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-mid);
  background: var(--surface-2); border-radius: var(--r-md); padding: 10px 14px;
  text-align: center; letter-spacing: 0.08em; overflow-wrap: anywhere;
}

.auth-name-row { display: flex; gap: 10px; }
.auth-name-row .auth-field { flex: 1; }

/* Splash */
.auth-splash {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 24px;
}
.auth-splash img { width: 88px; height: 88px; object-fit: contain; animation: authFadeIn 400ms var(--ease-out) both; }
.auth-splash-word {
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-lo);
  animation: authFadeIn 400ms 200ms var(--ease-out) both;
}
.auth-dots { display: flex; gap: 6px; animation: authFadeIn 400ms 500ms var(--ease-out) both; }
.auth-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: authDot 1.2s ease-in-out infinite;
}
.auth-dots i:nth-child(2) { animation-delay: 200ms; }
.auth-dots i:nth-child(3) { animation-delay: 400ms; }

@keyframes authFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes authPopIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
@keyframes authDot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.anim-pop { animation: authPopIn 320ms var(--ease-out) both; }
.anim-fade { animation: authFadeIn 320ms 100ms var(--ease-out) both; }

