/* Sign-in, invite and password pages. WASABI brand (decision 26): tokens, fonts and mark from the landing page.
   Colours exist only in the two :root blocks below. Light is the default; dark follows the system. */
:root {
  --canvas: #f6f2e8;
  --surface: #fbf8f1;
  --sunk: #efe9db;
  --ink: #17170f;
  --ink-2: #4a4a3e;
  --ink-3: #5c5b4e;
  --rule: #ddd6c4;
  --accent: #a3bf34;
  --accent-soft: #e3ecbd;
  --accent-ink: #4c5c10;
  --danger: #a3341f;
  /* The photo wall stays dark in both themes. */
  --wall: #17170f;
  --wall-tile: #2a2b22;
  --wall-ink: #f6f2e8;
  --wall-ink-2: #c3c0b2;
  --tone-0: #3c4a12; --tone-1: #5a3b2a; --tone-2: #2d3a3a; --tone-3: #4a3f22; --tone-4: #33302a; --tone-5: #46351f;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-text: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #12130e;
    --surface: #1b1c16;
    --sunk: #23241d;
    --ink: #edeadf;
    --ink-2: #c3c0b2;
    --ink-3: #9a988a;
    --rule: #2e2f27;
    --accent: #b5d14a;
    --accent-soft: #2f3615;
    --accent-ink: #c8e06a;
    --danger: #f08a73;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--accent-ink); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--canvas); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Layout: the form on the left, a moving wall of the businesses WASABI serves on the right. Form only under 900px. */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { display: block; height: 30px; width: auto; }
.brand-word { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: 0.04em; }
.soon {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.soon::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 1px; background: var(--accent); }

.auth-main { display: flex; flex-direction: column; padding: 32px clamp(20px, 5vw, 72px); }
.auth-top { flex: none; }
.auth-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 0; }
.auth-foot { flex: none; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-3); font-size: 0.8125rem; }
.auth-foot a { color: var(--ink-3); }

/* The wall. A fixed dark panel in both themes so the photos read the same. */
.auth-show {
  position: relative; overflow: hidden; margin: 12px; border-radius: 20px;
  background: var(--wall); color: var(--wall-ink); isolation: isolate;
}
.show-cols {
  position: absolute; inset: 0 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.show-col { overflow: visible; }
.show-track { display: flex; flex-direction: column; gap: 16px; will-change: transform; }
.show-col:nth-child(1) .show-track { animation: wall-up 70s linear infinite; }
.show-col:nth-child(2) .show-track { animation: wall-down 84s linear infinite; }
.show-col:nth-child(3) .show-track { animation: wall-up 62s linear infinite; }
.auth-show:hover .show-track { animation-play-state: paused; }
@keyframes wall-up { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 8px)); } }
@keyframes wall-down { from { transform: translateY(calc(-50% - 8px)); } to { transform: translateY(0); } }

.tile {
  position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden;
  background: var(--wall-tile);
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0) 58%, rgb(0 0 0 / 0.5)); }
.tile-tag {
  position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 14px;
  font-weight: 600; font-size: 1rem; line-height: 1.25; color: var(--wall-ink);
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.35);
}
/* No photo yet: a coloured tile with the business name. */
.tile.no-img img { display: none; }
.tile.tone-0.no-img { background: var(--tone-0); }
.tile.tone-1.no-img { background: var(--tone-1); }
.tile.tone-2.no-img { background: var(--tone-2); }
.tile.tone-3.no-img { background: var(--tone-3); }
.tile.tone-4.no-img { background: var(--tone-4); }
.tile.tone-5.no-img { background: var(--tone-5); }

.show-copy {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 120px clamp(24px, 4vw, 56px) clamp(28px, 4vw, 48px);
  background: linear-gradient(180deg, rgb(23 23 15 / 0) 0%, rgb(23 23 15 / 0.86) 42%, var(--wall) 100%);
}
.show-copy .display { color: var(--wall-ink); margin: 0 0 12px; max-width: 16ch; }
.show-copy .lede { color: var(--wall-ink-2); max-width: 40ch; margin: 0 0 18px; }
.show-copy .soon { color: var(--wall-ink-2); }
.display {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
  font-size: clamp(2rem, 3.2vw, 3rem);
}
.lede { font-size: 1.0625rem; line-height: 1.55; }

.card { width: 100%; max-width: 400px; }
h1 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-size: 2rem;
  margin: 0 0 8px;
}
.sub { color: var(--ink-2); margin: 0 0 28px; }
.sub a { font-weight: 600; }

/* Forms (DESIGN-SYSTEM 3.6): label above, helper below, error below on blur. */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 6px; }
.req { color: var(--ink-3); font-weight: 400; }
.control { position: relative; display: flex; }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 6px;
  font: inherit;
  transition: border-color 160ms ease-out;
}
.field input:hover { border-color: var(--ink-3); }
.field input:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 0; border-color: var(--ink); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[readonly] { background: var(--sunk); color: var(--ink-2); }
.control input { padding-right: 96px; }
.toggle {
  position: absolute; right: 4px; top: 4px; bottom: 4px; min-width: 44px; padding: 0 12px;
  background: transparent; color: var(--ink-2); border: 0; border-radius: 4px; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
}
.toggle:hover { color: var(--ink); background: var(--sunk); }
.toggle-link { background: none; border: 0; padding: 8px 0; min-height: 36px; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.hint { color: var(--ink-3); font-size: 0.875rem; margin: 6px 0 0; }
.err { color: var(--danger); font-size: 0.875rem; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; width: 100%;
  border: 1px solid transparent; border-radius: 6px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
  touch-action: manipulation;
}
.btn-primary { background: var(--ink); color: var(--canvas); }
.btn-primary:hover { background: var(--ink-2); color: var(--canvas); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn-secondary:hover { border-color: var(--ink-3); color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 20px; padding: 12px 14px;
  border: 1px solid var(--danger); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.banner svg { flex: none; margin-top: 2px; color: var(--danger); }
.banner.note { border-color: var(--accent-ink); }
.banner.note svg { color: var(--accent-ink); }
.banner p { margin: 0; }

.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--ink-3); font-size: 0.875rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

details.forgot { margin-top: 24px; border-top: 1px solid var(--rule); padding-top: 16px; }
details.forgot summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details.forgot p { color: var(--ink-2); margin: 8px 0 0; }

.facts { list-style: none; padding: 0; margin: 0 0 24px; border-top: 1px solid var(--rule); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; }
.facts span { color: var(--ink-3); }
.facts strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.num { font-family: var(--font-mono); }
.quiet { color: var(--ink-3); font-size: 0.875rem; margin: 20px 0 0; }
.loading { color: var(--ink-2); display: flex; align-items: center; gap: 10px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-show { display: none; }
  .auth-body { align-items: flex-start; padding: 40px 0 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .field input { transition: none; }
  .spin { animation-duration: 1.6s; }
  .show-track { animation: none !important; }
}
