/* auth.css — the (mock) email + password gate, owned by auth.js */
.auth-layer { display: none; }
.auth-layer.is-open {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 400; overflow-y: auto; overscroll-behavior: contain;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1.5px 1.5px, var(--dot) 1.2px, transparent 1.6px); background-size: 22px 22px;
}
html.is-gated body { overflow: hidden; }
.au-wrap { width: min(440px, 100%); }
.au-card {
  position: relative; padding: 30px 28px 22px;
  background: var(--card); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: 10px 10px 0 var(--ink);
  animation: au-in 0.45s var(--ease-spring) both;
}
@keyframes au-in { from { opacity: 0; transform: translateY(16px) rotate(-1.5deg); } }
.au-tape { position: absolute; top: -12px; left: 50%; width: 120px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: color-mix(in srgb, var(--acid) 80%, transparent); border: 1px solid rgba(14,14,16,.25); }
.au-top { display: flex; align-items: center; gap: 10px; }
.au-kicker { font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }
.au-tabs { display: flex; gap: 6px; margin-top: 20px; border-bottom: var(--bw) solid var(--line); }
.au-tab {
  position: relative; bottom: -2px; padding: 9px 16px 10px; font-family: var(--f-mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: transparent; color: var(--ink-2); border: var(--bw) solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.au-tab.is-on { background: var(--card); color: var(--ink); border-color: var(--line); border-bottom-color: var(--card); }
.au-tab:not(.is-on):hover { color: var(--ink); background: var(--paper); }
.au-h { margin: 18px 0 6px; font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 38px; line-height: 1.02; }
.au-sub { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.au-form { display: flex; flex-direction: column; gap: 12px; }
.au-form.is-shake { animation: au-shake 0.35s; }
@keyframes au-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.au-field { position: relative; display: flex; flex-direction: column; gap: 5px; }
.au-l { font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--ink-2); }
.au-in {
  width: 100%; height: 46px; padding: 0 64px 0 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: var(--bw) solid var(--line); border-radius: var(--r-md); outline: none;
  transition: box-shadow 0.15s, background 0.15s;
}
.au-in:focus { background: var(--card); box-shadow: 4px 4px 0 var(--ink); }
.au-eye { position: absolute; right: 7px; top: 27px; height: 32px; padding: 0 10px; font-family: var(--f-mono); font-size: 11px; font-weight: 700; background: transparent; border: 1.5px solid var(--line); border-radius: var(--r-pill); }
.au-eye:hover { background: var(--acid); }
.au-hint { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.au-err { min-height: 18px; margin: 0; font-family: var(--f-mono); font-size: 12.5px; font-weight: 600; color: var(--hot); }
.au-err:empty { min-height: 0; }
.au-go { height: 50px; justify-content: center; font-size: 16px; }
.au-go:disabled { opacity: 0.6; }
.au-swap { margin: 14px auto 0; display: block; background: none; border: 0; font-size: 14px; color: var(--ink-2); }
.au-swap b { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hot); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.au-mock { margin: 16px 0 0; padding-top: 12px; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); font-family: var(--f-mono); font-size: 11px; line-height: 1.5; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .au-card.is-enter, .au-form.is-shake { animation: none; } }
.au-at { position: relative; display: block; }
.au-at-sign { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--f-mono); font-size: 16px; font-weight: 700; color: var(--ink-2); pointer-events: none; }
.au-at .au-in { padding-left: 32px; }
.au-hint.is-err { color: var(--hot); font-weight: 600; }
.au-hint.is-ok { color: var(--ink); font-weight: 600; }

/* ---------- phones: everything up to the submit button fits a 360x640 screen ---------- */
@media (max-width: 700px) {
  .auth-layer.is-open {
    place-items: start center;
    padding: max(14px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  /* with the keyboard up, the layer ends right above it so the field + button can be scrolled into view */
  .auth-layer.is-open.is-kb { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100%); }
  .au-wrap { margin-block: auto; }   /* centred when it fits, top-aligned (never clipped) when it doesn't */
  .au-card { padding: 18px 16px 14px; border-radius: var(--r-md); box-shadow: 6px 6px 0 var(--ink); margin-top: 6px; }
  .au-tape { top: -10px; width: 96px; height: 20px; }
  .au-top { gap: 8px; }
  .au-tabs { margin-top: 12px; }
  .au-tab { flex: 1; min-height: 44px; padding: 8px 10px; }
  .au-h { margin: 12px 0 4px; font-size: 30px; }
  .au-sub { margin-bottom: 12px; font-size: 14px; line-height: 1.4; }
  .au-sub-more { display: none; }
  .au-form { gap: 10px; }
  .au-field { gap: 4px; }
  .au-l { font-size: 11px; }
  .au-in { height: 44px; }
  .au-eye { top: 22px; height: 36px; min-width: 52px; }
  .au-hint { font-size: 11px; line-height: 1.35; }
  .au-hint.is-soft { display: none; }   /* "at least 8 characters" is the placeholder on phones */
  .au-go { height: 48px; margin-top: 2px; position: sticky; bottom: 8px; z-index: 1; }
  .au-swap { margin-top: 8px; min-height: 44px; }
  .au-mock { margin-top: 8px; padding-top: 10px; }
}
@media (max-width: 380px) { .au-h { font-size: 28px; } }
/* short landscape phones: drop the intro line, the form is what matters */
@media (max-height: 520px) and (max-width: 1024px) { .au-sub { display: none; } .auth-layer.is-open { place-items: start center; } }

/* touch: 44px targets */
@media (hover: none), (pointer: coarse) {
  .au-tab { min-height: 44px; }
  .au-swap { min-height: 44px; }
  .au-eye { min-height: 36px; }
}
.au-notice { margin: 0 0 14px; padding: 10px 12px; font-size: 14px; line-height: 1.4; background: color-mix(in srgb, var(--pi-lime, #c6ff7a) 45%, var(--card)); border: 1.5px solid var(--line); border-radius: var(--r-md); }
