/* id.unidy.com: the pages where a password or a code is typed. The tokens are the
   public site's (public-www/src/styles/global.css), so both feel like one place. */
:root {
  --paper: #ffffff;
  --paper-sunken: #f5f5f7;
  --ink: #16171a;
  --ink-soft: #55565b;
  --ink-faint: #65666b;
  --line: #e4e4e7;
  --line-strong: #c9c9ce;
  --signal: #0a5bd3;
  --action: #0a5bd3;
  --action-hover: #1667dd;
  --on-action: #ffffff;
  --signal-deep: #073f94;
  --signal-wash: #eef3fd;
  --allow: #0b7a53;
  --allow-wash: #e9f5f0;
  --hold: #a8560d;
  --hold-wash: #fbf1e6;
  --danger: #c0262d;
  --danger-hover: #a91f26;
  --logo-cut: var(--paper);
  color-scheme: light dark;
}

/* Dark follows the device unless the footer chose Light or Dark (assets/theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0d0e11;
    --paper-sunken: #131519;
    --ink: #f2f2f4;
    --ink-soft: #a9aeba;
    --ink-faint: #7d8390;
    --line: #26282e;
    --line-strong: #3a3d45;
    --signal: #7fa8ff;
    --signal-deep: #b6cbff;
    --signal-wash: #161b26;
    --allow: #5fd3a3;
    --allow-wash: #10231c;
    --hold: #f0a45b;
    --hold-wash: #2a1c0e;
    --danger: #d93036;
    --danger-hover: #e5484d;
  }
}

:root[data-theme='dark'] {
  --paper: #0d0e11;
  --paper-sunken: #131519;
  --ink: #f2f2f4;
  --ink-soft: #a9aeba;
  --ink-faint: #7d8390;
  --line: #26282e;
  --line-strong: #3a3d45;
  --signal: #7fa8ff;
  --signal-deep: #b6cbff;
  --signal-wash: #161b26;
  --allow: #5fd3a3;
  --allow-wash: #10231c;
  --hold: #f0a45b;
  --hold-wash: #2a1c0e;
  --danger: #d93036;
  --danger-hover: #e5484d;
  color-scheme: dark;
}

:root[data-theme='light'] { color-scheme: light; }

* { box-sizing: border-box; }

/* The wordmark on top of the card, and the site's footer. */
body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper-sunken);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  display: grid;
  grid-template-rows: 1fr auto;
}

/* The public site's width and side margins (public-www, global.css: --measure, --gutter). */
.wrap {
  --gutter: clamp(16px, 5vw, 48px);
  width: 100%;
  max-width: calc(1180px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main {
  width: 100%;
  max-width: 472px;
  margin: 0 auto;
  padding: clamp(16px, 6vh, 56px) 16px 48px;
}

.brand {
  display: block;
  width: 96px;
  margin: 0 auto 28px;
  color: var(--signal);
}

.brand svg { display: block; width: 100%; height: auto; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 28px;
}

h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead { margin: 0 0 24px; color: var(--ink-soft); }

label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 0.95rem; }

input[type='email'], input[type='password'], input[type='text'] {
  width: 100%;
  min-height: 52px;
  margin: 0 0 18px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

input.code { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; }

.button {
  display: flex;
  width: 100%;
  min-height: 50px;
  padding: 0 1.5em;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--action);
  color: var(--on-action);
  font: inherit;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, transform 0.25s ease-out;
}

.button:hover { background: var(--action-hover); }
.button:active { transform: scale(0.97); transition-duration: 0.1s; }

.button.secondary { background: transparent; color: var(--signal); border-color: var(--signal); margin-top: 10px; }
.button.secondary:hover { background: var(--signal-wash); }
.button.upstream { gap: 12px; }
.button.danger { background: var(--danger); color: #ffffff; }
.button.danger:hover { background: var(--danger-hover); }

.notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--hold-wash);
  color: var(--hold);
  font-size: 0.95rem;
}

.notice.good { background: var(--allow-wash); color: var(--allow); }

.links { margin: 22px 0 0; display: grid; gap: 8px; font-size: 0.95rem; }
.links a, .quiet a { color: var(--signal); }

.qr { display: block; width: 200px; height: 200px; margin: 0 auto 16px; image-rendering: pixelated; border-radius: 8px; }

.key {
  display: block;
  margin: 0 0 20px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper-sunken);
  font: 0.95rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  text-align: center;
}

.codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 24px;
  padding: 16px;
  list-style: none;
  border-radius: 14px;
  background: var(--paper-sunken);
  font: 1rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.quiet { margin: 18px 0 0; color: var(--ink-faint); font-size: 0.9rem; text-align: center; }

.trap { position: absolute; left: -10000px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.passkeys { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 8px; }
.passkeys li { padding: 10px 14px; border: 1px solid var(--line, #e4e4e7); border-radius: 12px; }

.site { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.site p { margin: 0; }
.site-logo { border-radius: 10px; }
.consent-head { margin: 18px 0 6px; font-weight: 700; }
.consent-hint { margin: 0 0 8px; color: var(--ink-soft); font-size: 0.95rem; }
.consent { margin: 0 0 8px; padding: 0; list-style: none; }
.consent.gets { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.consent.gets li { padding: 12px 14px; border-top: 1px solid var(--line); }
.consent.gets li:first-child { border-top: 0; }
.consent.gets li.fixed { color: var(--ink-soft); font-size: 0.95rem; background: var(--paper-sunken); }
.consent.not { padding-left: 20px; list-style: disc; color: var(--ink-soft); }
.consent.not li { margin: 2px 0; }
.tick { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; cursor: pointer; }
.tick input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--signal); }
.tick-text { display: grid; gap: 2px; min-width: 0; }
.tick-label { color: var(--ink-soft); font-size: 0.9rem; }
.tick-text strong { overflow-wrap: anywhere; }
.tick-text em { color: var(--ink-soft); }
.consent-pick { display: grid; gap: 8px; margin: 10px 0 0 32px; padding: 0; border: 0; }
.consent-pick label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-weight: 400; cursor: pointer; }
.consent-pick input { accent-color: var(--signal); }
.consent-pick strong { overflow-wrap: anywhere; }
.consent-pick legend { padding: 0; margin: 18px 0 2px; }
.consent-pick details summary { cursor: pointer; color: var(--ink-soft); }
.consent-pick details label { margin-top: 8px; }
.pick-note { color: var(--ink-soft); font-size: 0.9rem; }
/* Share as: who the website sees, each identity a tile, the one chosen outlined in the signal colour. */
.consent-identity { gap: 8px; margin: 0 0 8px; }
.consent-identity label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); transition: border-color 0.15s ease, background-color 0.15s ease; }
.consent-identity label:hover { border-color: var(--line-strong); }
.consent-identity label:has(input:checked) { border-color: var(--signal); background: var(--signal-wash); box-shadow: inset 0 0 0 1px var(--signal); }
.consent-identity label:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: 2px; }
.consent-identity input { grid-row: 1 / span 2; width: 18px; height: 18px; margin: 0; }
.consent-identity strong { font-weight: 600; }
.consent-identity .pick-note { grid-column: 2; }
@media (prefers-reduced-motion: reduce) { .consent-identity label { transition: none; } }
.consent-actions { display: grid; gap: 8px; margin-top: 18px; }
.consent-actions .button { width: 100%; margin: 0; }
.button.quiet { background: transparent; color: var(--ink-soft); border-color: transparent; }
.button.quiet:hover { color: var(--ink); background: var(--paper-sunken); }

/* The developer guide: the site's width, its code and tables. */
main.wide { max-width: 880px; }
.guide h2 { margin: 32px 0 10px; font-size: 1.2rem; }
.guide h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.guide a { color: var(--signal); }
.guide pre { margin: 0 0 16px; padding: 12px 14px; overflow-x: auto; border-radius: 12px; background: var(--paper-sunken); font: 0.85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.guide code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; }
.guide table { width: 100%; margin: 0 0 16px; border-collapse: collapse; font-size: 0.92rem; display: block; overflow-x: auto; }
.guide th, .guide td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.back { margin: 18px 0 0; text-align: center; font-size: 0.92rem; }
.back a { color: var(--ink-soft); text-decoration: none; }
.back a:hover { color: var(--ink); text-decoration: underline; }

/* The public site's footer (public-www, Footer.astro): 12px, grey, the wordmark and its line on
   the left, five groups sharing the rest, then one line. */
.bottom {
  background: var(--paper-sunken);
  border-top: 1px solid var(--line);
  padding: clamp(40px, 6vw, 64px) 0 24px;
  font-size: 0.75rem;
  line-height: 1.3334;
  letter-spacing: -0.01em;
  color: var(--ink-faint);
}
.bottom a { color: var(--ink-soft); text-decoration: none; }
.bottom a:hover { text-decoration: underline; text-underline-offset: 3px; }
.top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 4fr);
  gap: 32px clamp(24px, 4vw, 64px);
  padding-bottom: clamp(28px, 4vw, 40px);
  border-bottom: 1px solid var(--line-strong);
}
.brand-col { display: grid; align-content: start; gap: 14px; }
.bottom .footer-brand { display: block; width: 76px; color: var(--signal); }
.footer-brand svg { display: block; width: 100%; height: auto; }
.bottom .footer-brand:hover { text-decoration: none; }
.moat {
  max-width: 22ch;
  margin: 0;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.groups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px 24px; }
.group { display: grid; align-content: start; gap: 0.8em; }
.group-label { margin: 0; color: var(--ink); font-weight: 600; }
.groups a { padding: 4px 0; margin: -4px 0; }
.line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; margin-top: 16px; }
.copy { margin: 0 18px 0 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-left: auto; }
.picker { position: relative; }
.picker summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--ink-soft);
}
.picker summary:hover { border-color: var(--ink-faint); color: var(--ink); }
.picker summary::-webkit-details-marker { display: none; }
.chev { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.picker[open] .chev { transform: translateY(1px) rotate(-135deg); }
.picker ul {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 5;
  min-width: 11rem;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(18 20 26 / 14%);
}
.picker li a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.picker li a:hover { background: var(--paper-sunken); text-decoration: none; }
.picker li a[aria-current='true'] { font-weight: 600; }
.themes { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; }
.themes button {
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
}
.themes button:hover { color: var(--ink); }
.themes button[aria-pressed='true'] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(18 20 26 / 12%); }

@media (max-width: 1100px) {
  .top-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { margin-left: 0; margin-top: 4px; width: 100%; }
}
