/* sign-in, approve, verify, reset, team, closed and 404 pages: the family's sign-in grammar (Pinda's), a white card
   with a terracotta top edge on dotted paper, at app density; the QR code on white is the brightest thing there */

body.auth { min-height: 100dvh; display: flex; flex-direction: column; position: relative; isolation: isolate; }
/* the pinboard's dots: strongest at the top right, gone by the text (Pinda's fade) */
body.auth::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent) 1.1px, transparent 1.5px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(90% 90% at 100% 0%, #000 0%, transparent 75%); mask-image: radial-gradient(90% 90% at 100% 0%, #000 0%, transparent 75%);
}
.auth-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
  background: var(--paper); box-shadow: 0 2px 0 var(--accent);
}
.auth-top .back, .auth-top .who { font-size: 14px; color: var(--muted); text-decoration: none; }
.auth-top .back:hover { color: var(--ink-p); }

.auth-main {
  flex: 1; width: 100%; max-width: 1040px; margin: 0 auto;
  padding: clamp(28px, 7vh, 88px) var(--gutter) max(48px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 360px); gap: clamp(24px, 4vw, 48px);
  justify-content: center; align-items: start;
}
.auth-main.single { grid-template-columns: minmax(0, 480px); }

/* the card: white, 14px, a 1px line, the terracotta top edge */
.auth-form, .auth-main.single > .approve-card {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 14px;
  padding: clamp(22px, 3vw, 32px);
}
.auth-form { display: grid; gap: 22px; }
.auth-form h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 14px; }
.auth-form form, [role="tabpanel"] { display: grid; gap: 16px; }
.auth-form [role="tabpanel"] > h1 { margin-bottom: 4px; }
.wide { width: 100%; }
.small { font-size: 14px; }
.lead { color: var(--muted); }
.form-msg { font-size: 14px; color: var(--muted); min-height: 0; }
.form-msg:empty { display: none; }
.form-msg.bad { color: var(--error); }

/* sign in / create account: Pinda's segmented control */
.tabs { display: flex; padding: 3px; gap: 2px; background: var(--chip); border-radius: 10px; }
.tabs [role="tab"] {
  flex: 1; background: none; border: 0; border-radius: 8px; color: var(--muted); font: 500 14px/1.2 var(--sans);
  padding: 9px 12px; cursor: pointer; min-height: 40px;
}
.tabs [role="tab"]:hover { color: var(--ink-p); }
.tabs [role="tab"][aria-selected="true"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 2px rgb(60 40 20 / .08); }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.closed-note { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.closed-note h2 { font-size: 19px; }
.closed-note p { color: var(--muted); font-size: 15px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }

/* ---- the QR panel: the code on white, framed like a print ---- */
.qr-panel {
  display: grid; gap: 14px; padding: 24px; background: var(--raised); border: 1px solid var(--line);
  border-radius: 14px; position: sticky; top: 24px;
}
.qr-panel h2 { font-size: 19px; }
.qr-panel > p { font-size: 14px; color: var(--muted); }
.qr-frame {
  position: relative; justify-self: start; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  width: 260px; max-width: 100%; aspect-ratio: 1;
}
.qr-frame canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; transition: opacity .3s, filter .3s; }
.qr-frame.dim canvas { opacity: .12; filter: blur(2px); }
.qr-state {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; padding: 18px;
  color: var(--ink-p); font: 600 15px/1.35 var(--sans);
}
.qr-state .btn { justify-self: center; }
.qr-code-line { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.mono.code { letter-spacing: .12em; color: var(--ink-p); }
/* the code's five minutes, as a test strip */
.qr-meter { height: 5px; background: var(--chip); border-radius: 2px; overflow: hidden;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--raised) calc(10% - 1px) 10%); }
.qr-meter i { display: block; height: 100%; width: 100%; background: var(--ink-p); transform-origin: left; transition: transform 1s linear; }

/* ---- approve (phone) and the single-column pages ---- */
.approve-card, .approve-card > div { display: grid; gap: 18px; }
.approve-card h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 15px; padding: 16px 0; border-block: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.big-state { font: 700 24px/1.25 var(--serif); }

/* ---- team page ---- */
.team { width: 100%; max-width: 920px; margin: 0 auto; padding: clamp(28px, 6vh, 64px) var(--gutter) max(64px, env(safe-area-inset-bottom)); display: grid; gap: 24px; }
.team h1 { font-size: clamp(30px, 3.6vw, 40px); letter-spacing: -0.015em; }
.team section { display: grid; gap: 14px; }
.team section + section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 28px); }
.team h2 { font-size: 21px; }
.team .lead { color: var(--muted); max-width: 62ch; }
.rows { display: grid; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .what { font-weight: 600; }
.row .when { font-size: 13px; color: var(--muted); grid-column: 1; }
.row .tag { font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 4px 8px; margin-left: 8px; vertical-align: 2px; }
.row .btn { grid-row: 1 / span 2; grid-column: 2; min-height: 36px; padding: 6px 12px; font-size: 14px; }
.idea { border: 1px dashed var(--line-2); border-radius: 10px; padding: 18px; display: grid; gap: 10px; color: var(--muted); }
.idea strong { color: var(--ink-p); }

/* the re-check over the team page: the one thing that floats, so it takes Pinda's float shadow */
.reauth { position: fixed; inset: 0; background: rgb(33 28 23 / .35); display: grid; place-items: center; padding: var(--gutter); z-index: 10; }
.reauth > div {
  width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 14px; padding: 24px;
  display: grid; gap: 14px; box-shadow: 0 1px 2px rgb(60 40 20 / .06), 0 12px 34px rgb(60 40 20 / .12);
}
.reauth h2 { font-size: 21px; }
.reauth p { color: var(--muted); font-size: 15px; }

@media (max-width: 820px) {
  .auth-main { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
  .qr-panel { position: static; }
}
/* a phone can't scan its own screen: the code is for computers */
@media (max-width: 600px) and (pointer: coarse) {
  .qr-panel { display: none; }
}
@media (max-width: 420px) {
  .inline-form { flex-direction: column; }
  .actions { grid-template-columns: 1fr; }
  .auth-top .back { font-size: 13px; }
}
