/* ==========================================================
   Auth screens (sign-in, verification, recovery)
   Dark, restrained, no product identity.
   ========================================================== */

:root {
  --auth-bg: #0b0e13;
  --auth-card: #12161e;
  --auth-border: #1f2632;
  --auth-text: #e6e9ef;
  --auth-muted: #8b93a3;
  --auth-accent: #4f7cff;
  --auth-accent-press: #3d66e0;
  --auth-error-bg: #2a151a;
  --auth-error-border: #57222c;
  --auth-error-text: #f2b8c0;
  --auth-focus: #7ea2ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.login-page {
  background:
    radial-gradient(1100px 500px at 70% -10%, #131a26 0%, transparent 60%),
    var(--auth-bg);
  color: var(--auth-text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 36px 32px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Neutral geometric mark — intentionally meaningless */
.auth-mark {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 2px solid var(--auth-accent);
  border-radius: 9px;
  position: relative;
  opacity: 0.9;
}
.auth-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--auth-accent), transparent 80%);
  opacity: 0.55;
}

.auth-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
}

.auth-sub {
  margin: 0 0 22px;
  text-align: center;
  color: var(--auth-muted);
  font-size: 13.5px;
}

.auth-error {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--auth-error-border);
  background: var(--auth-error-bg);
  color: var(--auth-error-text);
  border-radius: 8px;
  font-size: 13px;
}

.field { margin-bottom: 16px; }

.field label,
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--auth-muted);
  letter-spacing: 0.02em;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  background: #0d1119;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  color: var(--auth-text);
  font-size: 15px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input::placeholder { color: #4a5261; letter-spacing: 0.2em; }

/* ---------- One-time-code: six digit slots ---------- */

.otp-group {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

/* Digits are ephemeral, so they are shown rather than masked. */
.field .otp-box {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: 56px;
  height: 58px;
  padding: 0;
  border-radius: 10px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  caret-color: var(--auth-accent);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.field .otp-box:hover { border-color: #2b3547; }

.field .otp-box:focus,
.field .otp-box:focus-visible {
  outline: none;
  border-color: var(--auth-accent);
  background: #111827;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.18);
}

.otp-box::selection { background: rgba(79, 124, 255, 0.35); }

.otp-group.is-error .otp-box { border-color: var(--auth-error-border); }

.otp-group.is-error { animation: otp-shake 220ms ease; }

.otp-group.is-complete .otp-box {
  border-color: var(--auth-accent);
  opacity: 0.75;
}

@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

.field .otp-fallback {
  font-size: 24px;
  text-align: center;
  letter-spacing: 0.35em;
}

.field input:focus-visible,
.pw-toggle:focus-visible,
.auth-btn:focus-visible,
.auth-alt a:focus-visible {
  outline: 2px solid var(--auth-focus);
  outline-offset: 2px;
  border-radius: 8px;
}

.pw-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.pw-group input { padding-right: 64px; }

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
}
.pw-toggle:hover { color: var(--auth-text); background: #1a202c; }

.auth-btn {
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--auth-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.auth-btn:hover { background: var(--auth-accent-press); }
.auth-btn:active { transform: translateY(1px); }

.auth-alt {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.auth-alt a {
  color: var(--auth-muted);
  font-size: 13px;
  text-decoration: none;
}
.auth-alt a:hover { color: var(--auth-text); text-decoration: underline; }

@media (max-width: 420px) {
  .auth-card { padding: 28px 20px 24px; border-radius: 10px; }
  .otp-group { gap: 6px; }
  .field .otp-box { height: 54px; font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
