/* Proxera website onboarding — the intake form.
   Light, quiet, one column of fields with a rail that tells the client where
   they are. Tenant accent arrives from tenants/<slug>.json as --accent. */

:root {
  --paper: #ffffff;
  --sheet: #f6f7f9;
  --ink: #0b0b0c;
  --ink-2: #4b4b52;
  --rule: rgba(11, 11, 12, 0.12);
  --edge: rgba(11, 11, 12, 0.38);
  --accent: #3fc4ff;
  --on-accent: #050505;
  --ok: #14805a;
  --warn: #9a5b00;
  --err: #b42318;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 12px;
  --pill: 999px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- shell */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; letter-spacing: -0.02em; font-size: 14px;
}
.brand .who { display: grid; line-height: 1.2; min-width: 0; }
.brand .who b { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .who span { font: 500 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved { font: 500 12px/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-2); white-space: nowrap; }
.saved[data-state="saving"] { color: var(--warn); }
.saved[data-state="saved"] { color: var(--ok); }

.wrap {
  display: grid; grid-template-columns: 1fr; gap: 0;
  max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 120px;
}
@media (min-width: 900px) {
  .wrap { grid-template-columns: 260px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); }
}

/* ------------------------------------------------------------------ rail */
.rail { padding-top: 28px; }
@media (min-width: 900px) { .rail { position: sticky; top: 76px; align-self: start; } }
.progress { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 420ms var(--ease); }
.steps { list-style: none; margin: 0; padding: 0; display: none; }
@media (min-width: 900px) { .steps { display: grid; gap: 2px; } }
.steps button {
  display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer;
  color: var(--ink-2);
}
.steps button:hover { background: var(--sheet); color: var(--ink); }
.steps button[aria-current="step"] { background: var(--sheet); color: var(--ink); font-weight: 600; }
.steps button[data-done="true"] .n { background: var(--ink); color: #fff; border-color: var(--ink); }
.steps .n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--edge); font: 500 11px/1 var(--mono);
}
.steps button[aria-current="step"] .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rail .meta { display: none; margin-top: 18px; font: 400 12.5px/1.5 var(--font); color: var(--ink-2); }
@media (min-width: 900px) { .rail .meta { display: block; } }
.phone-step { display: none; }
.rail .draft { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.rail .draft .btn { min-height: 36px; font-size: 13px; font-weight: 500; }

/* where an answer appears (2026-09-18) */
.where { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; }
.where span { flex: none; font: 500 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; background: rgba(63, 196, 255, 0.14); color: #0b6b93; }
.where-inline { font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
.anatomy { margin: 0 0 22px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.anatomy summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 10px; }
.anatomy summary::-webkit-details-marker { display: none; }
.anatomy summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-45deg); transition: transform 160ms var(--ease); }
.anatomy[open] summary::before { transform: rotate(45deg); }
.anatomy dl { margin: 0; padding: 0 16px 12px; display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 12px; font-size: 13.5px; }
.anatomy dt { font-weight: 600; }
.anatomy dd { margin: 0; color: var(--ink-2); }

/* uploads (2026-09-18) */
.uploader { display: grid; gap: 10px; margin: 0 0 18px; }
.drop { position: relative; display: grid; gap: 4px; padding: 18px; border: 1px dashed var(--edge); border-radius: var(--radius); cursor: pointer; background: #fff; }
.drop:hover { border-style: solid; background: var(--sheet); }
.drop.full { opacity: 0.6; cursor: not-allowed; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop b { font-weight: 600; font-size: 15px; }
.drop span { font-size: 13.5px; color: var(--ink-2); }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.file { position: relative; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; font-size: 14px; }
.file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file .meta { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.file button { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.file button:hover { color: var(--err); background: var(--sheet); }
.file .pct { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width 200ms var(--ease); }
.file[data-state="done"] .meta { color: var(--ok); }
.file[data-state="pending"] .meta { color: var(--warn); }
.file[data-state="failed"] { border-color: rgba(180, 35, 24, 0.5); }
.file[data-state="failed"] .meta { color: var(--err); white-space: normal; }
.help code { font: 12.5px/1 var(--mono); background: var(--sheet); padding: 2px 6px; border-radius: 4px; }

/* ----------------------------------------------------------------- panel */
.panel { padding-top: 28px; max-width: 720px; }
.panel:focus, .panel:focus-visible { outline: none; }
.panel h1 { margin: 0 0 8px; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 600; text-wrap: balance; }
.panel .lede { margin: 0 0 28px; color: var(--ink-2); font-size: 16.5px; max-width: 60ch; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; display: flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ''; width: 2px; height: 12px; background: var(--accent); }

.note {
  display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--sheet); border: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-2); margin: 0 0 22px;
}
.note b { color: var(--ink); font-weight: 600; }
.note.warn { border-color: rgba(154, 91, 0, 0.35); background: #fff8ec; }

.field { display: grid; gap: 6px; margin: 0 0 18px; }
.field label { font-weight: 600; font-size: 14.5px; letter-spacing: -0.005em; }
.field label small { font-weight: 400; color: var(--ink-2); margin-left: 6px; font-size: 13px; }
.field .help { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.field .err { font-size: 13.5px; color: var(--err); margin: 0; min-height: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="url"], .field input[type="number"],
.field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; background: #fff;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(63, 196, 255, 0.28); outline: none; }
.field[data-invalid="true"] input, .field[data-invalid="true"] textarea, .field[data-invalid="true"] select { border-color: var(--err); }
.grid2 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; margin: 0 0 14px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ink); flex: none; }

/* repeatable cards */
.cards { display: grid; gap: 14px; margin: 0 0 16px; }
.card { border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 18px 6px; background: #fff; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.card .head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card .head .idx { font: 500 11px/1 var(--mono); letter-spacing: 0.12em; color: var(--accent); margin-right: 10px; }
.card .head button { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13.5px; padding: 6px 8px; border-radius: 6px; }
.card .head button:hover { color: var(--err); background: var(--sheet); }
.add { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: var(--pill); border: 1px dashed var(--edge); background: transparent; cursor: pointer; font-weight: 500; font-size: 14.5px; }
.add:hover { border-style: solid; }
.rows { display: grid; gap: 8px; margin: 0 0 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.row input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 8px; }
.row button { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; padding: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--edge); font-size: 14px; cursor: pointer; user-select: none; }
.chip input { accent-color: var(--ink); }
.chip:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }

/* review */
.review { display: grid; gap: 14px; }
.review section { border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.review section h3 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; }
.review section h3 button { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.review dl { margin: 0; display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 12px; font-size: 14.5px; }
.review dt { color: var(--ink-2); }
.review dd { margin: 0; overflow-wrap: anywhere; }
.review dd.empty { color: var(--warn); font-style: italic; }
.review ul { margin: 0; padding-left: 18px; font-size: 14.5px; }

/* bottom bar */
.bar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 40px); padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(10px); border-top: 1px solid var(--rule);
}
.bar .inner { display: flex; width: 100%; max-width: 1180px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--pill); border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform 160ms var(--ease), background-color 160ms var(--ease); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(0.94); }
.btn.ghost { background: transparent; border-color: var(--edge); color: var(--ink); }
.btn.ghost:hover { background: var(--sheet); }
.btn.quiet { background: transparent; color: var(--ink-2); padding: 0 10px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* done */
.done { text-align: left; }
.done .big { font-size: clamp(30px, 4vw, 44px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 600; margin: 0 0 12px; }
.json { font: 12.5px/1.5 var(--mono); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; max-height: 320px; overflow: auto; white-space: pre; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
