/* Mobile-first: base styles target a phone viewport; the single
   max-width:560px container just centers itself on wider screens. No
   framework, no build step — see docs/decisions.md.

   Design tokens below port the "v3 — real logo integrated, accent
   recalibrated" mini design system from
   /Users/dndungu/Code/dndungu/hq/jobs/sire-founding-pilot/wizard-design.md
   (built as tokens-v2.css in Claude Design project 0ae297ce…). This is a
   wizard-only skin — it intentionally does NOT touch or fork Sire's r17
   tokens.css, which stays the system of record everywhere else on Sire.
   Named to match tokens-v2.css 1:1 so the report fragment's inline
   <style> (internal/report/render.go's reportCSS) can reference the same
   var(--…) names — this file is the single place token values live. */

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

  --page: #ffffff;
  --panel: #ffffff;
  --panel2: #f6f7f9;
  --border: #e6e8ec;
  --border-strong: #d7dae0;

  --ink: #0d0f12;
  --body: #3d424b;
  --ambient: #767c87;

  --logo-blue: #137fec;
  --accent: #0f6fcc;
  --accent-hover: #0c5eb0;
  --accent-active: #0a4e93;
  --accent-tint: #eaf3fd;
  --on-accent: #ffffff;

  --success: #16a34a;
  --success-tint: #eafbf1;
  --warn: #d97706;
  --warn-tint: #fef6e7;
  --danger: #dc2626;
  --danger-tint: #fdecec;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 48px; --sp-9: 72px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(13, 15, 18, .05), 0 1px 1px rgba(13, 15, 18, .03);
  --shadow-md: 0 6px 20px rgba(13, 15, 18, .08);
  --shadow-lg: 0 16px 40px rgba(13, 15, 18, .14);

  /* Aliases so existing markup/JS that references the old names keeps
     working while every value now comes from the v3 palette above. */
  --bg: var(--page);
  --surface: var(--panel);
  --ink-soft: var(--body);
  --ink-faint: var(--ambient);
  --bubble-user: var(--accent);
  --bubble-user-ink: var(--on-accent);
  --bubble-assistant: var(--panel2);
  --bubble-assistant-ink: var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* :not(.active) (specificity 0,2,0) deliberately beats any single-class
   unconditional `display:flex` a screen-scoped class sets below (e.g.
   .landing, .report-loading — both 0,1,0) — without it, those rules tie
   with a bare `.screen{display:none}` on specificity and the later
   source-order declaration wins, which was a real pre-existing bug: a
   screen that had ever been "active" kept rendering (stacked on top of
   whatever screen actually was active) after losing the class. */
.screen:not(.active) { display: none; }
.screen { flex: 1; flex-direction: column; }
.screen.active { display: flex; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- Brand lockup (mark + wordmark) ---------- */
/* SVG path is defined once in a hidden <symbol> in index.html; every
   header instance just <use>s it — crisp at any zoom, no extra request,
   no repeated 4KB path string per screen. */

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: var(--sp-3) var(--sp-5);
  flex-shrink: 0;
}
.brand-mark { display: block; flex-shrink: 0; width: 13.3px; height: 22px; }
.brand-word { font-family: var(--sans); font-weight: 800; color: var(--ink); letter-spacing: -.01em; font-size: 16px; }

/* Landing carries more presence per the design doc's "logo can carry
   more presence here" allowance: 30px mobile / 34px desktop. */
.landing .brand-lockup { padding-block: var(--sp-4) var(--sp-6); }
.landing .brand-mark { width: 18.2px; height: 30px; }
.landing .brand-word { font-size: 19px; }

@media (min-width: 900px) {
  .landing .brand-mark { width: 20.6px; height: 34px; }
  .landing .brand-word { font-size: 20px; }
}

/* ---------- Landing ---------- */

.landing {
  padding: 0 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

.landing h1 {
  font-family: var(--sans);
  font-size: clamp(28px, 2rem + 1.4vw, 40px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  max-width: 20ch;
  margin: 0;
  color: var(--ink);
}

.landing p.lede {
  color: var(--body);
  font-size: 16px;
  margin: 0;
  line-height: 1.6;
}

.landing .report-preview ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.landing .report-preview ul li {
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
  padding-left: 1.5rem;
  position: relative;
}
.landing .report-preview ul li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: .05em;
  color: var(--accent);
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding-inline: var(--sp-6);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  gap: var(--sp-2);
  transition: background-color 150ms cubic-bezier(.2,.7,.3,1),
    border-color 150ms cubic-bezier(.2,.7,.3,1),
    box-shadow 150ms cubic-bezier(.2,.7,.3,1);
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn-outline { background: var(--panel); color: var(--ink); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.btn-wide { width: 100%; min-height: 52px; font-size: 16px; }
.btn-secondary { background: transparent; color: var(--body); border-color: var(--border); }
.btn-link {
  background: none;
  border: none;
  color: var(--ambient);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  padding: .5rem;
}

.privacy-note {
  font-size: 13px;
  color: var(--ambient);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.privacy-note a { color: var(--accent); font-weight: 600; }

/* ---------- Landing: report preview / ICP / quiet line / credibility / objection / reassurance ---------- */
/* New elements added for copy sheet v2 — the checklist bullet styling
   (checkmark, --body/--ambient tokens) that used to live under
   .landing ul.promise now targets .report-preview directly, above, so
   it reads as one system rather than a bolted-on block. */

.report-preview-lead {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 .5rem;
}

.icp-line,
.quiet-line {
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.credibility { display: flex; flex-direction: column; gap: .3rem; }
.credibility-line {
  color: var(--body);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}
.credibility-sub {
  color: var(--ambient);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.objection-note {
  color: var(--ambient);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.start-reassurance {
  color: var(--ambient);
  font-size: 13px;
  text-align: center;
  margin: -.75rem 0 0;
}

.privacy-footnote {
  font-size: 13px;
  text-align: center;
  margin: 0;
}
.privacy-footnote a { color: var(--accent); font-weight: 600; text-decoration: none; }
.privacy-footnote a:hover { text-decoration: underline; }

/* ---------- Chat ---------- */

#screen-chat .brand-lockup { padding-inline: 1rem; }

.phase-rail { padding: 0 1rem; flex-shrink: 0; }
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  font-size: 11px;
  color: var(--ambient);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}
.steps .on { color: var(--accent); }

.progress-track {
  height: 4px;
  background: var(--panel2);
  border-radius: 2px;
  margin-bottom: var(--sp-4);
}
.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  width: 4%;
  transition: width .3s ease;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: .25rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  -webkit-overflow-scrolling: touch;
}

.bubble {
  max-width: 84%;
  padding: .75rem 1rem;
  border-radius: var(--r-lg);
  line-height: 1.5;
  font-size: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.assistant {
  align-self: flex-start;
  background: var(--bubble-assistant);
  color: var(--bubble-assistant-ink);
  border-bottom-left-radius: 6px;
}
.bubble.user {
  align-self: flex-end;
  background: var(--bubble-user);
  color: var(--bubble-user-ink);
  border-bottom-right-radius: 6px;
}
.bubble.system {
  align-self: center;
  background: transparent;
  color: var(--ambient);
  font-size: 13px;
  text-align: center;
}
.bubble.error {
  align-self: center;
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 13px;
  border-radius: var(--r-md);
}

/* Typing indicator — three dots, respects prefers-reduced-motion. */
.typing-dots { display: inline-flex; gap: 5px; align-items: center; height: 14px; padding: 2px 4px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ambient);
  animation: typing-bounce 1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots span { animation: none; opacity: .6; }
}

.chat-input-bar {
  position: sticky;
  bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-end;
}

textarea.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: .7rem .9rem;
  font-size: 16px;
  font-family: var(--sans);
  background: var(--panel);
  color: var(--ink);
  max-height: 6.5rem;
  min-height: 48px;
}
textarea.chat-input:hover { border-color: var(--accent); }
textarea.chat-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.send-btn {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-pill);
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }

.chat-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Report ---------- */

.report-screen {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 2rem;
}
.report-screen .brand-lockup { padding-inline: 1rem; }

.report-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 2rem;
  text-align: center;
  color: var(--body);
}

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

/* ---------- Edge states ---------- */
/* One reusable screen, populated by app.js's showEdgeState() for
   whichever of the three states (session-expired / rate-limited /
   daily-cap) fires — see docs/decisions.md for why this is one screen
   with dynamic tone/copy rather than three near-duplicate ones. */

.edge-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 1rem 1.5rem;
}
.edge-wrap .brand-lockup { padding-inline: 0; }
.edge-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-5);
}

.alert {
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.alert-danger { background: var(--danger-tint); border: 1px solid rgba(220, 38, 38, .24); }
.alert-warn { background: var(--warn-tint); border: 1px solid rgba(217, 119, 6, .24); }
.alert .w {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.alert-danger .w { color: var(--danger); }
.alert-warn .w { color: var(--warn); }
.alert p { margin: 0; color: var(--body); font-size: 14px; line-height: 1.5; }

/* No prefers-color-scheme:dark override here, deliberately. The v3
   design doc's whole thesis is a white ground ("white ground, crisp
   sans-serif, ONE vivid accent, Linear/Stripe register") — every
   mockup, token file, and founder-reviewed render is light-only; there
   is no reviewed dark palette to port. The pre-v3 wizard skin did have
   an inverted dark palette, but shipping a *new*, self-invented set of
   dark colors here — unreviewed against any design — would be a bigger
   risk than staying light everywhere and matching 100% of the approved
   source material. See docs/decisions.md. */
:root { color-scheme: light; }
