/*
 *                                      _╔ΦK╓
 *                                   _╔Φ╬╬╣╣╬╣K,
 *                                 ╓Æ╬╬╣╙ ╓,`╚╬╬╣φ,
 *                                ╬╬╣╙`▄▓████▄,'╚╬╬▒
 *                                ╙`╓▓██████████▄,'%
 *     ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▓████████████████▓▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 *     ███▀▀▀▓███▌▀▀▓█▀▀▀▀▀▀▀▀▀██▀▀▀▀▀▀▀▀▀█▓▀▀▀████▀▀▀██▀▀▀▀▀▀▀▀█▀▀▀▀▀▀▀▀▀▀▓██▓
 *     ███   ╫███▌  ╟█   ▄▄▄▄  ╙█   ▄▄▄▄  └█▌   ▓▌  _▓█  ╓▄▄▄▄▄▄█▌▄▄▄  ┌▄▄▄▓██▓
 *     ███   ╫███▌  ╫█   ███▓  '█   ████   ███▄    ▄███_  └╙╙╙▀▓████▓  ▐██████▓
 *     ███   ╟███▌  ╫█   ____,▄▓█        ▄▓████   ╫██████▓▓▄▄▄  ║███▓  ▐██████▓
 *     ███▌         ▓█   ████████   ██▓   ▀████▌  ╫████        _▓███▓  ▐██████▓
 *     ██████▓▓▓▓▓████▓▓▓████████▓▓▓████▓▓▓█████▓▓█████▓▓▓▓▓▓▓███████▓▓██████▀╙
 *     └└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└└`
 */
/* ============================================================================
   UPRYST — Paper scouting design system · auth surfaces
   Login, signup, forgot, reset, invite, verify-identity.
   Class names are a contract with page scripts — never rename, only restyle.
   ============================================================================ */

:root {
  --bg: #f4efe4;
  --surface: rgba(255, 248, 232, 0.86);
  --surface-raised: #fff8e8;
  --primary: #10110f;
  --primary-ink: #fff8e8;
  --accent: #df2334;
  --accent-dark: #b71929;
  --accent-ink: #fff8e8;
  --accent-tint: rgba(223, 35, 52, 0.08);
  --accent-line: rgba(223, 35, 52, 0.30);
  --success: #31b45f;
  --success-tint: rgba(49, 180, 95, 0.10);
  --success-line: rgba(49, 180, 95, 0.34);
  --text: #10110f;
  --muted: #6c6c62;
  --subtle: #8f8a7f;
  --border: rgba(16, 17, 15, 0.14);
  --border-strong: rgba(16, 17, 15, 0.28);
  --danger: #b42335;
  --danger-tint: rgba(180, 35, 53, 0.09);
  --warn: #b47a1f;
  --display: 'Cabinet Grotesk', system-ui, sans-serif;
  --body: 'Satoshi', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--body);
  background:
    linear-gradient(90deg, rgba(16, 17, 15, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(180deg, rgba(16, 17, 15, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; display: block; -webkit-user-drag: none; user-select: none; pointer-events: none; }
a img, button img { pointer-events: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: fixed; left: 16px; top: 16px; z-index: 1000;
  transform: translateY(-160%);
  background: var(--accent); color: var(--accent-ink);
  border-radius: 6px; padding: 10px 14px; font-weight: 700;
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); }
h1, h2 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: 0; text-wrap: balance; }
::selection { background: var(--accent); color: var(--accent-ink); }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ------------------------------------------------------- left · visual --- */
.auth-visual {
  position: relative;
  overflow: hidden;
  background-image: url('images/hero.webp');
  background-size: cover;
  background-position: center;
}
.auth-visual::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(165deg, rgba(16,17,15,0.18) 0%, rgba(16,17,15,0.78) 100%),
    radial-gradient(80% 50% at 50% 115%, rgba(223,35,52,0.18), transparent 65%);
}
.auth-visual-inner {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 44px 48px;
}
.auth-logo img { width: 120px; }
.auth-quote { max-width: 460px; }
.auth-quote .eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
}
.auth-quote .eyebrow::before { content: ''; width: 30px; height: 2px; background: var(--accent); }
.auth-quote h2 {
  font-size: clamp(30px, 3.2vw, 46px);
  margin-bottom: 14px;
}
.auth-quote p { color: var(--muted); font-size: 16px; max-width: 400px; }

/* --------------------------------------------------------- right · form -- */
.auth-panel {
  display: flex; flex-direction: column;
  padding: 40px 56px;
  background:
    linear-gradient(90deg, rgba(16, 17, 15, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(180deg, rgba(16, 17, 15, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--bg);
  position: relative;
}
.auth-top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 64px;
}
.auth-back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 14px; font-weight: 500;
  min-height: 44px;
  transition: color 0.15s ease;
}
.auth-back:hover { color: var(--text); }
.auth-back svg { width: 14px; height: 14px; }
.auth-switch { font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-form-wrap {
  width: 100%; max-width: 430px;
  margin: auto 0;
  padding-bottom: 40px;
}
.auth-form-wrap h1 {
  font-size: clamp(32px, 3.4vw, 46px);
  margin-bottom: 12px;
}
.auth-form-wrap > p.auth-sub {
  color: var(--muted); font-size: 15.5px; margin-bottom: 36px;
}

/* --------------------------------------------------------- role toggle --- */
.role-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 28px;
}
.role-toggle button {
  padding: 11px 12px; min-height: 44px;
  border-radius: 6px;
  font-size: 14px; font-weight: 600;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.role-toggle button:hover { color: var(--text); }
.role-toggle button.is-active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.role-toggle button .role-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--subtle);
  margin-right: 8px; vertical-align: middle;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.role-toggle button.is-active .role-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}

/* -------------------------------------------------------------- fields --- */
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.field { position: relative; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field input {
  width: 100%; padding: 24px 16px 10px; min-height: 58px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.field input:hover { border-color: var(--border-strong); }
.field input:focus { border-color: var(--accent); background: var(--surface-raised); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field label {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  color: var(--subtle); font-size: 15px; pointer-events: none;
  transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease,
              transform 0.18s ease, letter-spacing 0.18s ease;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 9px; font-size: 10.5px; transform: translateY(0);
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: var(--muted);
}
.field input:focus + label { color: var(--accent); }

.field-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.field-toggle:hover { color: var(--text); background: rgba(16, 17, 15, 0.05); }
.field-toggle svg { width: 18px; height: 18px; }

.row-between {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; gap: 12px; flex-wrap: wrap;
}
.checkbox {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted); cursor: pointer; user-select: none;
  min-height: 32px;
}
.checkbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox .box {
  width: 19px; height: 19px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.checkbox .box svg { width: 12px; height: 12px; color: var(--accent-ink); opacity: 0; transition: opacity 0.15s ease; }
.checkbox input:checked + .box { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked + .box svg { opacity: 1; }
.checkbox input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkbox a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.checkbox a:hover { color: var(--text); }
.row-between a { color: var(--accent); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.row-between a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- captcha ------
   Upryst's human check. The form keeps a compact gate row; active
   challenges open in a centered modal layer so the form does not jump.      */
.captcha-box {
  position: relative;
  z-index: 20;
  background:
    linear-gradient(180deg, rgba(255,248,232,0.72), rgba(244,239,228,0.42)),
    var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: visible;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.72),
    0 18px 42px rgba(16, 17, 15, 0.10);
}
.captcha-box[data-state="loading"],
.captcha-box[data-state="ready"],
.captcha-box[data-state="verifying"],
.captcha-box[data-state="error"] { z-index: 1000; }
.captcha-box[data-state="loading"]::before,
.captcha-box[data-state="ready"]::before,
.captcha-box[data-state="verifying"]::before,
.captcha-box[data-state="error"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    radial-gradient(circle at 50% 34%, rgba(223, 35, 52, 0.14), transparent 26%),
    radial-gradient(circle at 18% 80%, rgba(18, 105, 179, 0.10), transparent 30%),
    rgba(244, 239, 228, 0.74);
  backdrop-filter: blur(13px) saturate(115%);
  -webkit-backdrop-filter: blur(13px) saturate(115%);
  animation: cap-fade 0.16s ease-out both;
}
.captcha-box[data-state="error"] { border-color: rgba(180, 35, 53, 0.42); }
.captcha-box[data-state="answered"] { border-color: var(--success-line); }

/* --- collapsed gate row --- */
.cap-gate {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 70px;
  padding: 13px 15px;
  text-align: left;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.cap-gate:hover {
  background: rgba(16, 17, 15, 0.035);
  box-shadow: inset 0 0 0 1px rgba(223, 35, 52, 0.16);
}
.cap-check {
  position: relative;
  width: 31px; height: 31px; flex-shrink: 0;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.66), rgba(255,255,255,0)),
    var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.cap-check-tick {
  width: 15px; height: 15px; color: var(--accent-ink);
  opacity: 0; transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.captcha-box[data-state="answered"] .cap-check {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 0 5px var(--success-tint);
}
.captcha-box[data-state="answered"] .cap-check-tick { opacity: 1; transform: scale(1); }
.cap-check-spinner {
  position: absolute; inset: -2px;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-radius: 9px;
  opacity: 0;
  animation: cap-spin 0.8s linear infinite paused;
}
.captcha-box[data-state="loading"] .cap-check-spinner,
.captcha-box[data-state="verifying"] .cap-check-spinner { opacity: 1; animation-play-state: running; }
.cap-gate-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cap-gate-text strong { font-size: 15.5px; font-weight: 800; color: var(--text); letter-spacing: 0; }
.cap-gate-text small { font-size: 12.5px; color: var(--muted); }
.captcha-box[data-state="answered"] .cap-gate-text strong { color: var(--accent); }
.cap-gate-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(16,17,15,0.035);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.captcha-box[data-state="answered"] .cap-gate-status {
  color: #fff8e8;
  background: var(--success);
  border-color: transparent;
}

/* --- overlay panel --- */
.cap-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 28px));
  max-height: min(790px, calc(100vh - 32px));
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255,248,232,0.76), rgba(244,239,228,0.34)),
    radial-gradient(circle at 18% 0%, rgba(223,35,52,0.11), transparent 30%),
    var(--surface-raised);
  box-shadow:
    0 34px 120px rgba(16, 17, 15, 0.26),
    0 0 0 1px rgba(255,255,255,0.58) inset;
  z-index: 1002;
  animation: cap-pop 0.18s ease-out both;
}
.cap-panel[hidden] { display: none; }
.cap-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 14px 12px 16px;
  border-bottom: 1px solid var(--border);
}
.cap-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.cap-brand-mark {
  width: 33px;
  height: 33px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, transparent 42%, rgba(223,35,52,.95) 43% 57%, transparent 58%),
    linear-gradient(180deg, #fff8e8, #f0e6d6);
  border: 1px solid var(--accent-line);
  box-shadow: 0 0 28px rgba(223, 35, 52, 0.16);
}
.cap-brand span:last-child { display: grid; gap: 1px; min-width: 0; }
.cap-brand strong { color: var(--text); font-size: 14.5px; font-weight: 850; letter-spacing: 0; }
.cap-brand small { color: var(--subtle); font-size: 11.5px; font-weight: 650; }
.cap-actions { display: inline-flex; align-items: center; gap: 6px; }
.cap-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 16px 12px;
}
.cap-prompt-text { font-size: 17px; color: var(--text); line-height: 1.3; font-weight: 750; letter-spacing: 0; }
.cap-prompt-text b { color: var(--text); font-weight: 700; }
.cap-level {
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-tint);
  color: var(--accent);
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cap-new,
.cap-close {
  display: inline-flex; align-items: center; gap: 6px;
  width: 36px; height: 36px;
  justify-content: center;
  border-radius: 9px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(16,17,15,0.035);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cap-new:hover, .cap-close:hover { background: var(--accent-tint); color: var(--accent); border-color: var(--accent-line); }
.cap-new svg, .cap-close svg { width: 15px; height: 15px; }
.captcha-box[data-state="loading"] .cap-new svg { animation: cap-spin 0.9s linear infinite; }
.cap-body-wrap {
  position: relative;
  padding: 0 16px;
}
.cap-body {
  position: relative;
}
.cap-loading {
  position: absolute;
  inset: 0 16px;
  display: none;
  place-items: center;
  border-radius: 10px;
  background: rgba(244, 239, 228, 0.38);
}
.captcha-box[data-state="verifying"] .cap-loading { display: grid; }
.cap-loading span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(16, 17, 15, 0.18);
  border-top-color: var(--accent);
  animation: cap-spin .72s linear infinite;
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.cap-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0)),
    var(--surface);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.62);
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}
.cap-tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  -webkit-user-drag: none; user-select: none; pointer-events: none;
  transition: transform 0.12s ease;
}
.cap-tile:hover { transform: translateY(-1px); z-index: 1; border-color: var(--border-strong); }
.cap-tile.is-picked {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 2px rgba(223, 35, 52, 0.22),
    0 0 0 3px var(--accent-tint);
}
.cap-tile.is-picked img { transform: scale(0.91); filter: saturate(1.08) contrast(1.03); }
.cap-tile-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.4);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.cap-tile-badge svg { width: 12px; height: 12px; }
.cap-tile.is-picked .cap-tile-badge { opacity: 1; transform: scale(1); }
.cap-tile-skeleton {
  border: 1px solid var(--border);
  background: linear-gradient(100deg, rgba(16,17,15,0.04) 30%, rgba(16,17,15,0.10) 50%, rgba(16,17,15,0.04) 70%);
  background-size: 220% 100%;
  animation: cap-shimmer 1.1s ease-in-out infinite;
}

.cap-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 0;
  padding: 13px 16px 16px;
}
.cap-msg { flex: 1; min-height: 18px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cap-msg[data-tone="error"] { color: var(--danger); }
.captcha-box[data-state="verifying"] .cap-msg::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(16, 17, 15, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cap-spin 0.75s linear infinite;
}
.cap-done {
  min-height: 42px; padding: 0 18px 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px;
  background: var(--primary); color: var(--primary-ink);
  font-size: 14px; font-weight: 850;
  box-shadow: 0 10px 24px rgba(16, 17, 15, 0.18);
  transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.cap-done svg { width: 16px; height: 16px; }
.cap-done:hover:not(:disabled) { background: var(--accent); transform: translateY(-1px); }
.cap-done:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- scene (tap-in-photo) --- */
.cap-scene {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: crosshair;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.62);
}
.cap-scene img { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.cap-scene-marks { position: absolute; inset: 0; pointer-events: none; }
.cap-mark {
  position: absolute;
  width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(238, 243, 249, 0.94);
  border-radius: 50%;
  background: rgba(223, 35, 52, 0.12);
  box-shadow:
    0 0 0 3px rgba(223, 35, 52, 0.34),
    0 8px 18px rgba(16,17,15,.20);
}

/* --- slider --- */
.cap-slider { display: grid; gap: 4px; }
.cap-slider img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); }
.cap-range {
  width: 100%;
  margin: 0;
  height: 44px;
  appearance: none; -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.cap-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: var(--border);
}
.cap-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px;
  margin-top: -12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.cap-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--border); }
.cap-range::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--accent-ink);
}

/* --- drag --- */
.cap-dragwrap { position: relative; padding-bottom: 56px; }
.cap-dragscene { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.cap-dragscene img { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.cap-chip {
  position: absolute;
  left: 32px; bottom: 4px; top: auto;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background:
    radial-gradient(circle at 42% 28%, rgba(255,255,255,.26), transparent 36%),
    var(--surface-raised);
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow:
    0 10px 28px rgba(16, 17, 15, 0.20),
    0 0 0 7px var(--accent-tint);
}
.cap-chip.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.15);
  bottom: auto;
  z-index: 5;
}
.cap-chip img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}
.cap-piece {
  width: 62px;
  height: 62px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.cap-piece img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cap-count {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.cap-count-btn {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(16,17,15,.05);
  color: var(--text);
  font-weight: 800;
}
.cap-count-btn:active { transform: translateY(1px); }

/* --- hold --- */
.cap-hold {
  position: relative;
  width: 100%; min-height: 56px;
  border-radius: 10px;
  border: 1px solid var(--accent-line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
    var(--bg);
  overflow: hidden;
  font-weight: 700; font-size: 15px; color: var(--text);
  cursor: pointer;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.cap-hold-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background:
    linear-gradient(90deg, rgba(223, 35, 52, 0.24), rgba(18, 105, 179, 0.18));
  transition: width 0.05s linear;
}
.cap-hold-label { position: relative; z-index: 1; }

@keyframes cap-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes cap-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cap-pop {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes cap-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .cap-tile, .cap-tile img, .cap-check-tick, .cap-tile-badge { transition: none; }
  .cap-tile-skeleton, .captcha-box[data-state="loading"] .cap-new svg, .cap-check-spinner, .cap-panel, .captcha-box::before { animation: none; }
}
@media (max-width: 520px) {
  .cap-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
  .cap-panel-top { padding: 12px; }
  .cap-prompt { align-items: flex-start; padding: 12px; }
  .cap-body-wrap { padding: 0 12px; }
  .cap-foot { padding: 12px; }
  .cap-prompt-text { font-size: 14.5px; }
  .cap-grid { gap: 6px; }
  .cap-gate-status { display: none; }
}

/* ------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 24px; min-height: 52px;
  border-radius: 6px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent); }

.divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--subtle); font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  margin: 6px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-raised); border-color: var(--subtle); }
.btn-ghost svg { width: 18px; height: 18px; margin-right: 10px; }

.terms {
  font-size: 12.5px; color: var(--subtle); text-align: center;
  margin-top: 22px; line-height: 1.6;
}
.terms a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.terms a:hover { color: var(--text); }

/* ------------------------------------------------------------ messages --- */
.auth-message {
  min-height: 20px;
  margin-top: -2px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}
.auth-message[data-tone="success"] { color: var(--success); }
.auth-message[data-tone="error"] { color: var(--danger); }
.auth-message[data-tone="error"]:not(:empty) {
  background: var(--danger-tint);
  border: 1px solid rgba(255, 138, 138, 0.3);
  border-radius: 6px;
  padding: 10px 14px;
}
.auth-message[data-tone="success"]:not(:empty) {
  background: var(--success-tint);
  border: 1px solid var(--success-line);
  border-radius: 6px;
  padding: 10px 14px;
}

/* ------------------------------------------------- password strength ----- */
.strength { display: grid; gap: 6px; margin-top: -8px; }
.strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.strength-bars span {
  height: 4px; border-radius: 999px;
  background: var(--border);
  transition: background-color 0.2s ease;
}
.strength[data-level="1"] .strength-bars span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .strength-bars span:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] .strength-bars span:nth-child(-n+3) { background: var(--success); }
.strength[data-level="4"] .strength-bars span { background: var(--success); }
.strength-hint { font-size: 12px; color: var(--subtle); }
.strength[data-level="1"] .strength-hint { color: var(--danger); }
.strength[data-level="2"] .strength-hint { color: var(--warn); }
.strength[data-level="3"] .strength-hint,
.strength[data-level="4"] .strength-hint { color: var(--success); }

/* ---------------------------------------------------------- responsive --- */
@media (max-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 24px 22px calc(32px + env(safe-area-inset-bottom, 0px)); }
  .auth-top { margin-bottom: 40px; }
  .auth-form-wrap { margin: 0 auto; padding-bottom: 0; }
  .field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
