/* ── Sign-in ───────────────────────────────────────────────────────────────
   A themed modal, not a native dialog. Two steps: email, then the code that
   Privy mails. Nothing here is stored in the browser -- the session arrives
   as an httpOnly cookie set by the server.
   ------------------------------------------------------------------------ */

.auth-nav {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
}

.auth-btn {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent, #4fe69a);
  background: transparent;
  border: 1px solid rgba(79, 230, 154, .38);
  border-radius: 3px;
  /* 44px tap target: this sits in the nav where mis-taps are common. */
  min-height: 44px;
  padding: 0 .95rem;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.auth-btn:hover,
.auth-btn:focus-visible {
  background: rgba(79, 230, 154, .1);
  border-color: rgba(79, 230, 154, .7);
}

.auth-who {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .74rem;
  color: rgba(226, 240, 232, .62);
  white-space: nowrap;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */

.auth-modal[hidden] { display: none; }

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 10, 8, .82);
  backdrop-filter: blur(3px);
}

.auth-card {
  width: min(30rem, 100%);
  background: #071410;
  border: 1px solid rgba(79, 230, 154, .22);
  border-radius: 6px;
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.auth-card h2 {
  font-family: var(--font-display, 'Instrument Serif', serif);
  font-size: 1.5rem;
  margin: 0 0 .4rem;
  color: #eaf6ef;
}

.auth-card .metric-note {
  margin: 0 0 1.1rem;
  line-height: 1.55;
}

.auth-card label {
  display: block;
  margin-bottom: .35rem;
}

.auth-card input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: .55rem .7rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .92rem;
  color: #eaf6ef;
  background: #040a08;
  border: 1px solid rgba(79, 230, 154, .28);
  border-radius: 3px;
}

.auth-card input:focus-visible {
  outline: 2px solid rgba(79, 230, 154, .55);
  outline-offset: 1px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.1rem;
}

.auth-actions button {
  flex: 1 1 8rem;
  min-height: 44px;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.auth-actions .primary {
  color: #041009;
  background: var(--accent, #4fe69a);
  border: 1px solid var(--accent, #4fe69a);
}

.auth-actions .primary:hover { background: #6ef0ad; }

.auth-actions .ghost {
  color: rgba(226, 240, 232, .78);
  background: transparent;
  border: 1px solid rgba(226, 240, 232, .22);
}

.auth-actions .ghost:hover { border-color: rgba(226, 240, 232, .45); }

/* The wallet route, kept visually secondary to the email one. */
.auth-alt {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(79, 230, 154, .16);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.auth-alt[hidden] { display: none; }

.auth-or {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(226, 240, 232, .6);
}

.auth-alt .ghost {
  flex: 1;
  min-height: 44px;
  padding: .7rem 1rem;
  border-radius: 2px;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .8rem;
  cursor: pointer;
  color: rgba(226, 240, 232, .78);
  background: transparent;
  border: 1px solid rgba(226, 240, 232, .22);
}

.auth-alt .ghost:hover { border-color: rgba(226, 240, 232, .45); }
.auth-alt .ghost:disabled { opacity: .55; cursor: not-allowed; }

.auth-status {
  margin: .9rem 0 0;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .78rem;
  line-height: 1.5;
}

.auth-status[hidden] { display: none; }
.auth-status[data-kind='error'] { color: var(--toxic, #e0894f); }
.auth-status[data-kind='ok'] { color: var(--accent, #4fe69a); }
.auth-status[data-kind='info'] { color: rgba(226, 240, 232, .7); }

@media (prefers-reduced-motion: reduce) {
  .auth-btn,
  .auth-actions button { transition: none; }
}

@media (max-width: 26rem) {
  .auth-who { display: none; }
  .auth-card { padding: 1.3rem 1.1rem 1.2rem; }
}
