/* TrustLookup app: sign-in pages and dashboard. Same tokens as the homepage
   (assets/trustlookup.css): paper, navy ink, highlighter yellow, Archivo. */

:root {
  --paper: #f2f3ef;
  --sheet: #ffffff;
  --ink: #102043;
  --ink-soft: #4a5571;
  --ink-faint: #8890a3;
  --marker: #ffe15a;
  --marker-bad: #ffc4bb;
  --rule: #cdd2ca;
  --rule-soft: #e6e9e3;
  --ok: #0d7a47;
  --ok-bg: #e2f2e9;
  --warn: #a86400;
  --warn-bg: #fdf0d8;
  --bad: #c8322a;
  --bad-bg: #fbe6e3;
  --font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }
fieldset { border: 0; min-width: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .875em; background: #e8ebe4; border-radius: 4px; padding: 1px 5px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* ---------- Type ---------- */
.h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); font-weight: 800; font-stretch: 120%; letter-spacing: -0.025em; line-height: 1.1; }
.h2 { font-size: 1.25rem; font-weight: 750; font-stretch: 112%; letter-spacing: -0.01em; line-height: 1.25; }
.lead { font-size: 1.125rem; color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.tiny { font-size: .8125rem; }
.num { font-variant-numeric: tabular-nums; }
.big-num { font-size: 2.25rem; font-weight: 850; font-stretch: 118%; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hl { padding: 0 3px; margin: 0 -3px; background: linear-gradient(transparent 50%, var(--marker) 50%, var(--marker) 92%, transparent 92%); }

.wordmark {
  position: relative; display: inline-block; isolation: isolate;
  font-size: 1.375rem; font-weight: 850; font-stretch: 125%; letter-spacing: -0.02em; line-height: 1; text-decoration: none;
}
.wordmark::before { content: ''; position: absolute; z-index: -1; left: -3px; right: -3px; bottom: -1px; height: 48%; background: var(--marker); border-radius: 2px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 6px; border: 0;
  background: var(--ink); color: var(--paper); font-weight: 650; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, transform .1s ease;
}
.btn:hover { background: #1c3468; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 1.0625rem; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .875rem; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn-ghost:hover { background: var(--sheet); }
.btn-bad { background: var(--bad); color: #fff; }
.btn-bad:hover { background: #a82820; }
.btn-marker { background: var(--marker); color: var(--ink); }
.btn-marker:hover { background: #fff0a6; }
.btn-block { width: 100%; }
.link { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; background: none; border: 0; padding: 0; }
.link:hover { box-shadow: inset 0 -0.45em 0 var(--marker); text-decoration-color: transparent; }
.link-bad { color: var(--bad); }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.label { font-size: .875rem; font-weight: 600; }
.hint { font-size: .8125rem; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 6px;
  border: 1.5px solid var(--rule); background: var(--sheet); transition: border-color .15s ease;
}
.textarea { height: auto; min-height: 140px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--ink); }
.input[aria-invalid='true'] { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.inline-form { display: inline; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }

/* ---------- Notices ---------- */
.notice { border-radius: 8px; padding: 12px 16px; background: var(--sheet); border: 1px solid var(--rule-soft); }
.notice-ok { background: var(--ok-bg); border-color: #bfe0cd; }
.notice-warn { background: var(--warn-bg); border-color: #f1d9a8; }
.notice-bad { background: var(--bad-bg); border-color: #f2c4bd; color: #8e1f19; }
.notice-marker { background: #fff7cf; border-color: #f2e08a; }
.notice .row { margin-top: 8px; }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; background: #e8ebe4; color: var(--ink-soft); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-ink { background: var(--ink); color: var(--paper); }
.pro { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--ink); color: var(--paper); font-size: .6875rem; font-weight: 700; vertical-align: .1em; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding: 24px clamp(20px, 4vw, 40px); }
.auth-main { display: grid; place-items: center; padding: 40px 0; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .h1 { margin-bottom: 8px; }
.auth-card form { margin-top: 28px; }
.auth-card .btn-block { margin-top: 24px; }
.auth-alt { margin-top: 24px; font-size: .9375rem; color: var(--ink-soft); }
.auth-foot { font-size: .8125rem; color: var(--ink-soft); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; overflow-y: auto; padding: 24px 16px; border-right: 1px solid var(--rule-soft); display: flex; flex-direction: column; gap: 24px; }
.side .wordmark { margin-left: 8px; align-self: flex-start; }
.switcher { display: grid; gap: 4px; }
.switcher .select { height: 38px; font-size: .9375rem; }
.switcher-name { padding: 0 8px; font-weight: 650; font-size: .9375rem; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-weight: 550; color: var(--ink-soft); }
.nav a:hover { background: var(--sheet); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--sheet); color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
.nav-group { font-size: .75rem; color: var(--ink-faint); padding: 14px 10px 4px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; font-size: .875rem; }
.side-credits { padding: 12px; border-radius: 8px; background: var(--sheet); border: 1px solid var(--rule-soft); }
.side-credits strong { font-size: 1.25rem; font-weight: 800; font-stretch: 115%; }
.side-user { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 0 4px; }
.side-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar { display: none; }
.content { padding: 36px clamp(20px, 4vw, 48px) 80px; max-width: 1180px; width: 100%; }
.page-head { display: flex; justify-content: space-between; gap: 16px 24px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .lead { margin-top: 6px; }
.section { margin-top: 40px; }
.section > .h2 { margin-bottom: 14px; }
.flash { margin-bottom: 24px; }

.sheet { background: var(--sheet); border: 1px solid #dadfd6; border-radius: 10px; }
.sheet-pad { padding: 20px 22px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule-soft); }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--rule-soft); background: #f7f8f5; border-radius: 0 0 10px 10px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stat { padding: 20px 22px; }
.stat .label { color: var(--ink-soft); font-weight: 550; }
.stat .big-num { margin-top: 8px; }
.stat .hint { margin-top: 8px; }

/* Tables */
.table { width: 100%; font-size: .9375rem; }
.table th { text-align: left; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); padding: 10px 16px; border-bottom: 1px solid var(--rule-soft); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: 8px; }
.trunc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 36px 22px; text-align: center; color: var(--ink-soft); }
.empty .btn { margin-top: 14px; }

/* Key reveal */
.secret { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.secret code { font-size: .9375rem; padding: 10px 12px; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 6px; word-break: break-all; }

/* Chart */
.chart { position: relative; margin: 0; padding-top: 10px; }
.chart-plot { display: grid; grid-template-columns: 44px minmax(0, 1fr); height: 190px; }
.chart-y { position: relative; }
.chart-y span { position: absolute; right: 10px; transform: translateY(50%); font-size: .75rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.chart-area { position: relative; border-bottom: 1px solid var(--rule); }
.chart-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--rule-soft); }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart-col i { display: block; width: 100%; background: var(--ink); border-radius: 4px 4px 0 0; transition: background-color .12s ease; }
.chart-col:hover i { background: #3b5596; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: .875rem; color: var(--ink-soft); }
.chart-x { display: flex; gap: 2px; margin: 6px 0 0 44px; }
.chart-x span { flex: 1; min-width: 0; font-size: .75rem; color: var(--ink-soft); white-space: nowrap; overflow: visible; }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  background: var(--ink); color: var(--paper); border-radius: 6px; padding: 6px 10px; font-size: .8125rem; white-space: nowrap;
}
.chart-tip strong { display: block; }
.meter { height: 8px; border-radius: 4px; background: var(--rule-soft); overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #e8ebe4; border-radius: 8px; width: max-content; }
.tabs a { padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: .875rem; font-weight: 600; color: var(--ink-soft); }
.tabs a[aria-current='true'] { background: var(--sheet); color: var(--ink); }

/* Billing */
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan-card { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.plan-card.is-current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.plan-card .h2 { font-stretch: 125%; }
.plan-card .price { font-size: 1.75rem; font-weight: 850; font-stretch: 118%; letter-spacing: -0.02em; }
.plan-card ul { font-size: .875rem; color: var(--ink-soft); display: grid; gap: 2px; margin: 4px 0 10px; }
.plan-card form, .plan-card .plan-cta { margin-top: auto; }
.plan-card .pill.plan-cta { align-self: flex-start; height: 42px; padding: 0 14px; font-size: .875rem; }

/* Lookup playground and JSON */
.json { font-size: .8125rem; line-height: 1.6; background: var(--ink); color: #e8ebf2; border-radius: 10px; padding: 16px 18px; overflow: auto; max-height: 520px; white-space: pre; }
.facts { display: grid; grid-template-columns: 12rem minmax(0, 1fr); }
.facts > dt, .facts > dd { padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: .9375rem; }
.facts > dt { color: var(--ink-soft); }
.facts > dd { overflow-wrap: anywhere; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-faint); margin-right: 8px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: #d98a1c; }
.dot-bad { background: var(--bad); }

.progress { height: 10px; border-radius: 5px; background: var(--rule-soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); transition: width .4s var(--ease); }

.danger { border-color: #f2c4bd; }
.danger .sheet-head { color: var(--bad); }

@media (max-width: 1080px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule-soft); padding: 16px 20px; }
  .side:not(.is-open) .switcher, .side:not(.is-open) .nav, .side:not(.is-open) .side-foot { display: none; }
  .topbar { display: flex; justify-content: space-between; align-items: center; }
  .side > .wordmark { display: none; }
  .content { padding-top: 24px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts > dd { border-top: 0; padding-top: 0; }
}
@media (max-width: 560px) {
  .chart-x .alt { visibility: hidden; }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .table th, .table td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
