/*
 * public/m33-static/login.css — the sign-in page's own styles
 * (lib/views/htmls/login.ejs; ADR 0082 D6, rule 10a).
 *
 * Loaded after shell.css, which owns the tokens and the .m33-login-* base.
 * Served from /m33/ before the auth gate, so it loads with no session. The
 * passkey offer's CSS ships with its markup in lib/vega-passkeys-client.
 */

/* ── Card, brand and form ─────────────────────────────────────────── */
.m33-login-page { background: #0a0c16; }
.m33-login-card { max-width: 380px; padding: 44px 36px 32px; border-radius: 14px; }
.m33-login-logo { width: 60px; height: 60px; }
.m33-login-logo-wrap { margin-bottom: 16px; }
.m33-login-agency { font-size: 21px; font-weight: 300; letter-spacing: 0.14em;  text-indent: 0.14em; text-transform: uppercase; color: var(--m33-text);  position: relative; padding-bottom: 13px; margin: 0 0 12px; }
.m33-login-agency { color: var(--m33-text);  text-shadow: -1px -1px 1px rgba(0,0,0,0.72), 1px 1px 1px rgba(255,255,255,0.16); }
.m33-login-agency .m33-agency-mark { font-weight: 600; }
.m33-login-agency::after { content: ''; position: absolute; bottom: 0;  left: 50%; transform: translateX(-50%); width: 36px; height: 1px;  background: rgba(255,255,255,0.22); }
.m33-login-title { font-size: 14px; margin: 0 0 22px; }
.m33-login-subtitle { font-size: 11px; margin-bottom: 28px; }
.m33-login-form { gap: 16px; }
.m33-login-field { gap: 6px; }
.m33-login-field > span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--m33-text-muted); }
.m33-login-field input[type="email"],.m33-login-field input[type="password"],.m33-login-field input[type="text"],.m33-login-field select {  background: var(--m33-card); border: 1px solid var(--m33-border); border-radius: 8px;  color: var(--m33-text); padding: 11px 13px; font-size: 14px;  width: 100%; box-sizing: border-box; outline: none;  transition: border-color 120ms, box-shadow 120ms; font-family: inherit;}
/* The sign-in choice (Turing's ontology): the field's box, with a Lucide chevron. */
.m33-login-field select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%238b8fa3%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E");  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.m33-login-field select:focus,.m33-login-field input:focus {  border-color: var(--m33-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--m33-accent) 20%, transparent 80%);}
.m33-login-pw-wrap { position: relative; display: flex; align-items: stretch; }
.m33-login-pw-wrap > input { padding-right: 42px; flex: 1; }
.m33-login-form .m33-login-submit { margin-top: 6px; padding: 11px 16px; font-size: 13px; width: 100%; border-radius: 8px; font-weight: 500;  background: transparent; border: 1px solid var(--m33-border, rgba(255,255,255,0.18)); color: var(--m33-text, #e0e0e0);  cursor: pointer; transition: background 150ms, border-color 150ms; }
.m33-login-form .m33-login-submit:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.30); }
.m33-login-form .m33-login-submit:active { background: rgba(255,255,255,0.10); }
.m33-login-passkey { margin-top: 0; }
/* shell.css gives .m33-login-passkey `display: flex`, and ANY author rule
   setting display beats the UA stylesheet's `[hidden] { display: none }`.
   So the hidden attribute did nothing: the button showed on every device,
   including ones with no platform authenticator and no passkey, where
   pressing it makes the browser fall back to "use a passkey from a mobile
   or other device" and a QR code. Caught by reading computed style in a real
   browser, which is the only place this is visible. */
.m33-login-passkey[hidden] { display: none; }
.m33-login-forgot { display: block; text-align: center; font-size: 12px; color: var(--m33-text-muted); text-decoration: none; margin-top: -4px; }
.m33-login-forgot:hover { color: var(--m33-text); }
.m33-login-foot { margin-top: 18px; padding-top: 14px; }
.m33-login-build { margin-top: 6px; font-size: 10px; opacity: 0.55; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }

/* ── Login-loop diagnostic popup ──────────────────────────────────── */
/* Shown when a sign-in attempt lands back on /login. Above everything; the
   backdrop blocks interaction until dismissed. */
.m33-login-popup-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.72); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; box-sizing: border-box; }
.m33-login-popup-backdrop.open { display: flex; }
.m33-login-popup { background: #1a1d28; color: #e6e8ee; border: 1px solid rgba(240,107,107,0.45); border-radius: 12px; max-width: 420px; width: 100%; padding: 20px 22px; box-shadow: 0 10px 60px rgba(0,0,0,0.6); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.m33-login-popup h2 { margin: 0 0 8px; font-size: 16px; color: #f06b6b; }
.m33-login-popup p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; opacity: 0.9; }
.m33-login-popup ul { margin: 0 0 14px; padding-left: 20px; font-size: 13px; line-height: 1.6; opacity: 0.9; }
.m33-login-popup .diag { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; padding: 8px 10px; background: rgba(0,0,0,0.4); border-radius: 6px; margin-bottom: 14px; word-break: break-all; }
.m33-login-popup button { background: rgba(91,108,255,0.22); color: #fff; border: 1px solid rgba(91,108,255,0.5); padding: 8px 16px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; min-height: 44px; min-width: 80px; }
.m33-login-popup button:hover { background: rgba(91,108,255,0.32); }

/* ── Boot transition (login → waking the agent → app) ─────────────── */
/* On a successful sign-in the card fades and this overlay takes over: the
   33fg mark inside a white comet orbit (drawn by login/cosmos.js), with a
   status line driven by real readiness: POST /login ok → /api/healthz ok →
   navigate. */
.m33-login-card { transition: opacity 400ms ease, transform 400ms ease; }
.m33-login-card.m33-fading { opacity: 0; transform: scale(0.98); pointer-events: none; }
#m33-boot { position: fixed; inset: 0; background: #0a0c16; display: none; align-items: center; justify-content: center; z-index: 999; opacity: 0; transition: opacity 500ms ease; }
#m33-boot.open { display: flex; }
#m33-boot.visible { opacity: 1; }
.m33-boot-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; transition: filter 350ms ease; }
.m33-boot-wrap.arrive { filter: brightness(1.45) saturate(1.15); }
.m33-boot-loader { position: relative; width: 120px; height: 120px; }
.m33-boot-loader::before { content: ""; position: absolute; inset: 16px; border-radius: 50%;  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);  animation: m33BreatheAura 3.4s ease-in-out infinite; }
@keyframes m33BreatheAura { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.m33-boot-mark { position: absolute; inset: 24px; }
.m33-boot-mark img { width: 100%; height: 100%; }
.m33-boot-cosmos { position: absolute; inset: -20px; width: 160px; height: 160px; }
.m33-boot-status { font-size: 12px; color: var(--m33-text-muted, rgba(225,228,237,0.55)); min-height: 18px; text-align: center; transition: opacity 300ms; }
@media (prefers-reduced-motion: reduce) { .m33-boot-loader::before { animation: none; } }

/* ── Passkey offer ───────────────────────────────────────────────────
   The card lib/views/htmls/login/passkey-offer.ejs draws in the boot
   overlay after a password sign-in. Rules unchanged from the <style> the
   page took from lib/vega-passkeys-client.js loginOfferCss(), which came
   after this sheet: kept last for the same cascade. */
#m33-passkey-offer { display: none; align-items: center; justify-content: center; padding: 20px; }
#m33-passkey-offer.open { display: flex; }
.m33-passkey-offer-card { max-width: 380px; text-align: center; color: var(--m33-text, #e1e4ed);
  background: var(--m33-card, #12141f); border: 1px solid var(--m33-border, rgba(255,255,255,0.12));
  border-radius: 14px; padding: 30px 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.m33-passkey-offer-card h2 { font-size: 16px; margin: 12px 0 8px; font-weight: 600; }
.m33-passkey-offer-card p { font-size: 13px; line-height: 1.55; margin: 0 0 20px; opacity: 0.75; }
.m33-passkey-offer-actions { display: flex; flex-direction: column; gap: 8px; }
.m33-passkey-offer-actions button { padding: 10px 16px; font: inherit; font-size: 13px;
  border-radius: 8px; cursor: pointer; background: transparent;
  border: 1px solid var(--m33-border, rgba(255,255,255,0.18)); color: inherit;
  transition: background 150ms, border-color 150ms; min-height: 40px; }
.m33-passkey-offer-actions button:hover { background: rgba(255,255,255,0.06); }
.m33-passkey-offer-actions button:disabled { opacity: 0.5; cursor: default; }
.m33-passkey-offer-primary { border-color: var(--m33-accent, #5b6cff) !important;
  background: color-mix(in oklab, var(--m33-accent, #5b6cff) 22%, transparent) !important; }
#m33-passkey-offer-msg { font-size: 12px; margin-top: 12px; min-height: 16px; opacity: 0.85; }
