/* NCHI Home Evaluation — styles. Tokens, header, fields, option cards, buttons, footer
   and spinner are copied from The Booking Funnel (public/css/styles.css, 2026-09-26)
   so both NCHI tools look the same. Report and print styles at the end are new. */

:root {
  --bg: #000000;
  --panel: #0c0c0c;
  --panel-border: rgba(255, 255, 255, 0.10);
  --radius-lg: 18px;
  --radius-btn: 10px;
  --accent: #8CE000;
  --accent-text: #0a0a0a;
  --pac: #FF7A00;
  --text: #f5f5f5;
  --text-dim: #a8a8a8;
  --text-dimmer: #808080; /* 4.9:1 on --panel; #757575 was 4.2:1 */
  --danger: #ff6b6b;
  --font-head: "Baloo 2", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --max-width: 640px;
  --tap-min: 44px;
}

* { box-sizing: border-box; }

/* `hidden` always wins, even on elements styled display:flex/grid. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 8px;
}

p { margin: 0 0 12px; line-height: 1.5; }

a { color: var(--accent); }

button { font-family: inherit; }

/* Visible focus everywhere, no exceptions. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
}

/* On narrow phones the logo scales down (keeping its shape) so the phone
   number never wraps. The link stays a 44px tap target either way. */
.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: var(--tap-min);
  flex: 0 1 auto;
}
.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 40px;
}
.site-header .call-link {
  flex: none;
  white-space: nowrap;
}

.call-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap-min);
  padding: 0 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-btn);
  background: var(--panel);
}
.call-link:hover { border-color: var(--accent); }
.call-icon { color: var(--accent); flex: none; }

.call-link--inline {
  display: inline-flex;
  margin-top: 8px;
}
.call-link--big {
  font-size: 18px;
  padding: 0 20px;
  min-height: 52px;
}


/* -------------------------------------------------------------- main */

#app {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.step-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-title { font-size: 26px; }
/* Focused by script on each step change (for keyboard and screen-reader
   users); it isn't a control, so no focus ring. */
.step-title:focus { outline: none; }
.step-sub { color: var(--text-dim); font-size: 15px; }

.back-link {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
  min-height: var(--tap-min);
  cursor: pointer;
}
.back-link:hover { color: var(--accent); }

.total-recap {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-size: 15px;
}

/* --------------------------------------------------------------- form */

.field-row { margin-bottom: 14px; }
.field-row--narrow { flex: 1; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.field-optional { font-weight: 400; color: var(--text-dimmer); }

.field-input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font-body);
}
.field-input:focus { border-color: var(--accent); }
textarea.field-input { min-height: 80px; resize: vertical; }

.field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
}

.form-banner {
  background: #2a0f0f;
  border: 1px solid var(--danger);
  color: #ffd0d0;
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  font-size: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: var(--accent);
  flex: none;
}

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
  min-height: var(--tap-min);
  padding: 8px 0;
  text-align: left;
}

.address-autocomplete-wrap { display: flex; flex-direction: column; gap: 8px; }
gmp-place-autocomplete {
  width: 100%;
  --gmpx-color-surface: var(--panel);
  --gmpx-color-on-surface: var(--text);
}
.google-attribution {
  font-size: 11px;
  color: var(--text-dimmer);
}
.address-fallback-fields { margin-top: 8px; }

/* -------------------------------------------------------- option cards */

.option-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-group--stacked { margin-bottom: 4px; }

.option-subgroup { margin: 10px 0 14px; }

.option-card {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.option-card:hover { border-color: rgba(140, 224, 0, 0.5); }
.option-card.is-selected {
  border-color: var(--accent);
  background: rgba(140, 224, 0, 0.08);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.option-card[aria-busy="true"] { gap: 10px; cursor: progress; }

/* Step 0 answers move on when picked; the chevron says so. */
.option-card--go::after {
  content: "›";
  margin-left: auto;
  padding-left: 12px;
  font-size: 24px;
  line-height: 1;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}
.option-card--go:hover::after,
.option-card--go.is-selected::after { color: var(--accent); }
.option-card--go[aria-expanded="true"]::after { transform: rotate(90deg); }

@media (min-width: 480px) {
  .option-group:not(.option-group--stacked) { flex-direction: row; flex-wrap: wrap; }
  .option-group:not(.option-group--stacked) .option-card { width: auto; flex: 1 1 45%; }
}

/* --------------------------------------------------------- fact confirm */

.fact-confirm-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 8px;
}
.fact-confirm-text { font-size: 17px; font-weight: 600; }
.fact-confirm-source { color: var(--text-dimmer); font-size: 12px; }

.step-actions { margin-top: 18px; }
.step-actions--split {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.step-actions--split > * { flex: 1; }

.btn-primary, .btn-secondary {
  min-height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
}
.btn-secondary:hover { border-color: var(--accent); }

/* -------------------------------------------------------------- footer */

.site-footer {
  margin-top: auto;
  padding: 20px 16px 28px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--panel-border);
}
.site-footer .call-link { font-weight: 600; }
.site-footer .call-number { font-weight: 800; color: var(--accent); }

/* -------------------------------------------------------------- loading */

/* The pressed button carries the busy state (spinner + what's happening);
   the rest of the step just stops taking clicks. */
body.is-loading #app { pointer-events: none; }

.btn-primary[aria-busy="true"],
.btn-secondary[aria-busy="true"] {
  gap: 10px;
  cursor: progress;
}
.btn-primary:disabled { filter: none; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex: none;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}

/* ----------------------------------------------------------- research (new) */

.candidate-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.candidate-list .option-card { cursor: pointer; gap: 12px; }
.candidate-list input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.candidate-meta { display: block; color: var(--text-dim); font-size: 13px; }

.note {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-dim);
  margin: 8px 0 14px;
}

.report { margin-top: 8px; }
.report h1 { font-size: 26px; overflow-wrap: anywhere; }
.report h2 { font-size: 20px; margin-top: 26px; color: var(--accent); }
.report ul { padding-left: 20px; margin: 0 0 12px; }
.report li { margin-bottom: 6px; line-height: 1.5; }
.table-wrap { overflow-x: auto; margin-bottom: 12px; border: 1px solid var(--panel-border); border-radius: var(--radius-btn); }
.report table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report th, .report td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--panel-border); vertical-align: top; }
.report th { color: var(--text-dim); font-weight: 700; background: var(--panel); }
.report tr:last-child td { border-bottom: none; }

.listing-box { margin-top: 26px; }
.listing-box summary { cursor: pointer; font-weight: 800; min-height: var(--tap-min); display: flex; align-items: center; }
.field-textarea { min-height: 140px; resize: vertical; font-size: 14px; }
.paste-state { font-size: 14px; margin: 6px 0 10px; }
.paste-state.ok { color: var(--accent); }
.paste-state.err { color: var(--danger); }

.report-actions { display: grid; gap: 10px; margin-top: 22px; }
@media (min-width: 560px) { .report-actions { grid-template-columns: 1fr 1fr; } .report-actions .btn-primary { grid-column: 1 / -1; } }

@media print {
  :root { --bg: #fff; --panel: #fff; --panel-border: #bbb; --text: #000; --text-dim: #333; --accent: #000; }
  .site-header .call-link, .site-footer, .no-print, .listing-box { display: none !important; }
  .site-header { position: static; }
  .brand-logo { filter: invert(1); }
  .report h2 { break-after: avoid; }
  .table-wrap { overflow: visible; border: none; }
  tr { break-inside: avoid; }
}
