/* ============================================================================
   GeniusLaw — CaseCheck Terms & Conditions
   Same design system as the intake agent app:
   SF Pro Display · light + dark · GeniusLaw blues.
============================================================================ */

:root {
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --brand: #2f6bff;
  --brand-strong: #1d54e8;
  --green: #16a34a;
  --red: #e5484d;

  --r-card: 20px;
  --r-sm: 12px;
}

[data-theme="light"] {
  --bg: #f5f8fd;
  --bg-tint: rgba(47, 107, 255, 0.06);
  --card: #ffffff;
  --card-2: #fbfcfe;
  --text: #0b1220;
  --text-2: #41506b;
  --muted: #5e6c84;
  --line: rgba(13, 27, 62, 0.09);
  --line-2: rgba(13, 27, 62, 0.14);
  --chip-bg: #eaf1ff;
  --chip-text: #2f6bff;
  --soft-bg: #f1f5fb;
  --green-bg: rgba(22, 163, 74, 0.12);
  --red-bg: rgba(229, 72, 77, 0.1);
  --shadow-sm: 0 1px 2px rgba(13, 27, 62, 0.05);
  --shadow: 0 1px 2px rgba(13, 27, 62, 0.05), 0 18px 40px -26px rgba(13, 27, 62, 0.28);
}

[data-theme="dark"] {
  --bg: #080d1a;
  --bg-tint: rgba(92, 147, 255, 0.08);
  --card: #0e1626;
  --card-2: #111b2e;
  --text: #eaf1fb;
  --text-2: #b6c6e2;
  --muted: #7e90af;
  --line: rgba(150, 180, 225, 0.12);
  --line-2: rgba(150, 180, 225, 0.2);
  --chip-bg: rgba(92, 147, 255, 0.14);
  --chip-text: #9dbeff;
  --soft-bg: rgba(255, 255, 255, 0.04);
  --green-bg: rgba(22, 163, 74, 0.18);
  --red-bg: rgba(229, 72, 77, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 50px -28px rgba(0, 0, 0, 0.8);
  --brand: #4d86ff;
}

* { box-sizing: border-box; }
html { height: 100%; }

/* The state sections use display:flex/grid, which would beat the UA's
   [hidden] rule — force hidden to always win. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}

.page-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(80% 50% at 78% -5%, var(--bg-tint), transparent 60%),
    radial-gradient(60% 40% at 5% 0%, var(--bg-tint), transparent 55%);
}

/* ----------------------------- nav ------------------------------------- */
.nav { position: sticky; top: 0; z-index: 20; padding: 16px clamp(14px, 3vw, 28px); }
.nav__inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
[data-theme="dark"] .brand__mark { filter: drop-shadow(0 2px 8px rgba(77, 134, 255, 0.5)); }
.brand__word { font-weight: 700; font-size: 17px; letter-spacing: 0.02em; line-height: 1; }
.brand__word b { color: var(--text); }
.brand__word i { color: var(--brand); font-style: normal; }
.brand__word sup { font-size: 8px; color: var(--muted); top: -0.9em; position: relative; }

.nav__right { display: flex; align-items: center; gap: 10px; }
.themebtn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 999px; cursor: pointer; color: var(--text-2);
  background: var(--soft-bg); border: 1px solid var(--line); transition: all 0.2s ease;
}
.themebtn:hover { color: var(--text); border-color: var(--line-2); }
.themebtn .i-moon { display: none; }
[data-theme="dark"] .themebtn .i-sun { display: none; }
[data-theme="dark"] .themebtn .i-moon { display: block; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; padding: 7px 13px;
  border-radius: 999px; color: var(--chip-text); background: var(--chip-bg); white-space: nowrap;
}

/* ----------------------------- layout ---------------------------------- */
.layout {
  flex: 1; position: relative; z-index: 1;
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 10px clamp(14px, 3vw, 28px) 34px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 6px;
}

/* ----------------------------- states ---------------------------------- */
.state { padding: 46px 32px; }
.state--center {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center;
}
.state__badge {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--green); background: var(--green-bg);
}
.state__badge--red { color: var(--red); background: var(--red-bg); }
.state__title { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 0; }
.state__text { font-size: 14.5px; line-height: 1.55; color: var(--text-2); margin: 0; max-width: 420px; }
.state__small { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 4px 0 0; }

/* ------------------------- no-token splash ------------------------------ */
.splash__badge {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--chip-bg); border: 1px solid var(--line);
}
.splash__badge img { width: 36px; height: 36px; }
.splash__features {
  list-style: none; width: 100%; max-width: 420px;
  margin: 14px 0 2px; padding: 16px 0 2px;
  display: flex; flex-direction: column; gap: 13px;
  border-top: 1px solid var(--line);
}
.splash__feature { display: flex; align-items: center; gap: 12px; text-align: left; }
.splash__feature-ic {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  color: var(--brand); background: var(--soft-bg);
}
.splash__feature-tx { display: flex; flex-direction: column; line-height: 1.3; }
.splash__feature-tx b { font-size: 14px; font-weight: 600; color: var(--text); }
.splash__feature-tx span { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.splash__callout {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  color: var(--chip-text); background: var(--chip-bg);
}

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------- terms ----------------------------------- */
.terms { padding: clamp(22px, 4vw, 34px); }
.terms__title { font-size: clamp(24px, 4.5vw, 30px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.terms__hello { font-size: 14.5px; line-height: 1.55; color: var(--text-2); margin: 0 0 18px; }

.terms__doc {
  max-height: 46vh; overflow-y: auto;
  padding: 20px 22px; margin: 0 0 20px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px; line-height: 1.65; color: var(--text-2);
}
.terms__doc h2 { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 18px 0 6px; }
.terms__doc h2:first-child { margin-top: 0; }
.terms__doc p { margin: 0 0 10px; }
.terms__doc:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----------------------------- decision -------------------------------- */
.decide { display: flex; flex-direction: column; gap: 16px; }

.decide__check {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 14.5px; color: var(--text); cursor: pointer; user-select: none;
}
.decide__check input {
  width: 19px; height: 19px; margin: 2px 0 0; flex: none;
  accent-color: var(--brand); cursor: pointer;
}

.decide__name { display: flex; flex-direction: column; gap: 7px; }
.decide__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.decide__name input {
  font: inherit; font-size: 15px; color: var(--text);
  padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--card-2); border: 1px solid var(--line-2);
  outline: none; transition: border-color 0.15s ease;
}
.decide__name input:focus { border-color: var(--brand); }
.decide__name input::placeholder { color: var(--muted); opacity: 0.7; }

.decide__actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.decide__confirm { justify-content: flex-end; }
.decide__confirm-text { flex: 1 1 100%; margin: 0; font-size: 13.5px; color: var(--red); font-weight: 600; text-align: right; }

.btn {
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 12px 24px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--primary { color: #fff; background: var(--brand); }
.btn--primary:not(:disabled):hover { background: var(--brand-strong); }
.btn--primary:not(:disabled):active { transform: translateY(1px); }
.btn--ghost { color: var(--text-2); background: var(--soft-bg); border-color: var(--line); }
.btn--ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn--danger { color: #fff; background: var(--red); }
.btn--danger:hover { filter: brightness(0.94); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn .btn__spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 7px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.decide__error { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--red); text-align: right; }

/* ----------------------------- footer ----------------------------------- */
.foot {
  flex: none; position: relative; z-index: 1;
  display: flex; align-items: center; gap: 9px; justify-content: center; flex-wrap: wrap;
  padding: 26px 22px;
}
.foot__by { font-size: 13px; color: var(--muted); }
.brand--foot { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand--foot .brand__word { font-size: 15px; }

@media (max-width: 520px) {
  .decide__actions .btn { flex: 1; }
  .terms__doc { max-height: 40vh; }
}
