/* The sign-in popup (src/lib/auth/popup.ts). Ported from page-designs server/routes/auth.ts AUTH_CSS.
   Self-contained colours, so it renders the same on every page. Loaded by /login (head) and by
   public/assets/auth.js before it opens the popup anywhere else. */
.bp-auth { --a-navy: #0a2463; --a-blue: #1652d9; --a-blue-deep: #0f3fae; --a-pale: #eaf1fe; --a-line: #dbe3ef; --a-line-strong: #b9cbe8;
  --a-text: #101828; --a-muted: #4a5568; --a-bad: #b42318; --a-good: #127a3e;
  position: relative; width: min(calc(100vw - 2rem), 25rem); max-height: calc(100dvh - 3rem); margin: auto; padding: 0;
  overflow: hidden; border: 1px solid var(--a-line); border-radius: 10px; background: #fff; color: var(--a-text);
  box-shadow: 0 24px 60px rgba(10, 36, 99, 0.28); font: 400 15px/1.5 'Public Sans', system-ui, sans-serif; text-align: left; }
.bp-auth:modal { position: fixed; }
html:has(.bp-auth:modal), html:has(dialog.bp-auth[open][data-mode="shell"]) { overflow: hidden; }
.bp-auth::backdrop, .bp-auth-backdrop { background: rgba(7, 26, 74, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.bp-auth-backdrop { position: fixed; inset: 0; z-index: 1220; display: block; }
dialog.bp-auth[open]:not(:modal) { position: fixed; inset: 0; height: fit-content; z-index: 1221; }
.bp-auth *, .bp-auth *::before, .bp-auth *::after { box-sizing: border-box; }
.bp-auth :where(h2, p, form) { margin: 0; }
.bp-auth svg { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bp-auth-body { padding: 26px 24px 22px; max-height: calc(100dvh - 3rem); overflow-y: auto; overscroll-behavior: contain; }
.bp-auth-body:focus { outline: none; }
.bp-auth-close { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; color: #8a97ab; font-size: 20px; text-decoration: none; }
.bp-auth-close:hover { background: var(--a-pale); color: var(--a-navy); text-decoration: none; }
.bp-auth h2 { padding-right: 36px; color: var(--a-navy); font: 800 20px/1.25 'Archivo', system-ui, sans-serif; letter-spacing: -0.01em; }
.bp-auth-lede { margin: 4px 0 14px !important; color: var(--a-muted); font-size: 14px; line-height: 1.45; }
.bp-auth-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px !important; padding: 8px 12px; border-radius: 6px; font-size: 13px; line-height: 1.4; }
.bp-auth-note svg { margin-top: 2px; }
.bp-auth-note-good { background: #ecf7f0; border: 1px solid #bfe3cc; color: #1f4d33; }
.bp-auth-note-good svg { color: var(--a-good); }
.bp-auth-note-bad { background: #fdf0ef; border: 1px solid #f3c7c2; color: #7a1d14; }
.bp-auth-note-bad svg { color: var(--a-bad); }
.bp-auth-note-wait { background: #fff7e6; border: 1px solid #f0d49b; color: #6b4100; text-align: left; }
.bp-auth label { display: block; margin-bottom: 6px; color: var(--a-navy); font: 700 13.5px/1.3 'Archivo', system-ui, sans-serif; }
.bp-auth input[type="email"] { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--a-line-strong); border-radius: 4px;
  background: #fff; color: var(--a-text); font: 400 16px/1 'Public Sans', system-ui, sans-serif; }
.bp-auth input[type="email"]:focus { border-color: var(--a-blue); outline: none; box-shadow: 0 0 0 3px #d6e4fd; }
.bp-auth-group:has(.bp-auth-error) label { color: var(--a-bad); }
.bp-auth-group:has(.bp-auth-error) input { border-color: var(--a-bad); }
.bp-auth-error { display: flex; align-items: center; gap: 6px; margin-top: 6px !important; color: var(--a-bad); font-size: 13px; }
.bp-auth-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; margin-top: 10px; padding: 0 18px;
  border: 0; border-radius: 4px; background: var(--a-blue); color: #fff; font: 700 15px/1 'Archivo', system-ui, sans-serif; cursor: pointer; }
.bp-auth-btn:hover { background: var(--a-blue-deep); }
.bp-auth-btn:focus-visible, .bp-auth-link:focus-visible, .bp-auth-close:focus-visible { outline: 3px solid #5b9cff; outline-offset: 2px; }
.bp-auth-fine { margin-top: 10px !important; color: #6b7a90; font-size: 12px; line-height: 1.45; }
.bp-auth-sent { text-align: center; }
.bp-auth-sent h2 { padding-right: 0; }
.bp-auth-badge { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 999px;
  background: var(--a-pale); color: var(--a-blue); font-size: 22px; }
.bp-auth-sent .bp-auth-lede { margin-bottom: 0 !important; }
.bp-auth-sent b { color: var(--a-text); font-weight: 600; overflow-wrap: anywhere; }
.bp-auth-resend { margin-top: 12px !important; }
.bp-auth-link { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--a-blue); font: 600 14px/1 'Public Sans', system-ui, sans-serif;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bp-auth-link:hover { color: var(--a-blue-deep); }
.bp-auth-row { display: flex; gap: 8px; }
.bp-auth-row input { flex: 1; min-width: 0; }
.bp-auth-row .bp-auth-btn { width: auto; margin-top: 0; }
.bp-auth-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bp-auth-dev { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--a-line-strong); border-radius: 6px; background: #f8fafd; text-align: left; font-size: 12px; color: var(--a-muted); }
.bp-auth-dev p:first-child { display: flex; align-items: center; gap: 6px; margin-bottom: 4px !important; color: var(--a-navy); font-weight: 700; }
.bp-auth-dev a[data-auth-dev-link] { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 4px; padding: 0 12px; border-radius: 4px;
  background: var(--a-navy); color: #fff; font: 700 13px/1 'Archivo', system-ui, sans-serif; text-decoration: none; }
.bp-auth-dev a[data-auth-dev-link]:hover { background: var(--a-blue); color: #fff; text-decoration: none; }
.bp-auth-dev .bp-auth-devnote { color: var(--a-blue); }
.bp-auth-dev code { font-size: 11.5px; }
.bp-auth-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px !important; color: #8a97ab; font-size: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .bp-auth[open] { animation: bp-auth-in 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
  .bp-auth-sent { animation: bp-auth-pulse 0.45s ease-out; }
}
@keyframes bp-auth-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes bp-auth-pulse { 0% { opacity: 0; transform: scale(0.94); } 60% { transform: scale(1.01); } 100% { opacity: 1; transform: scale(1); } }
@media (max-width: 640px) { .bp-auth { width: calc(100vw - 1.25rem); } .bp-auth-body { padding: 22px 18px 18px; } }
@media (max-height: 44rem) { .bp-auth-body { padding-block: 18px 16px; } .bp-auth-fine { display: none; } }
