/* Audience Finder — backstage dark theme with amber accent */

:root {
  --bg: #100f14;
  --panel: #1a1820;
  --panel-2: #221f2a;
  --line: #322e3d;
  --text: #ece9e2;
  --muted: #a49eb0;
  --accent: #f5a524;
  --accent-soft: rgba(245, 165, 36, 0.14);
  --good: #7dc98f;
  --warn: #e2795c;
  --radius: 12px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 26px 0 22px;
  background:
    radial-gradient(1200px 300px at 50% -150px, rgba(245,165,36,0.10), transparent);
}
.brand {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 0.5px;
}
.tagline { color: var(--muted); margin-top: 4px; font-size: 15px; }

/* Step nav */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  padding-bottom: 6px;
}
.step-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  background: transparent;
  cursor: default;
  font-family: var(--font-body);
}
.step-pill .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 11.5px;
}
.step-pill.done { color: var(--text); border-color: var(--line); cursor: pointer; }
.step-pill.done .n { background: var(--good); border-color: var(--good); color: #10251a; }
.step-pill.active { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.step-pill.active .n { border-color: rgba(0,0,0,0.35); color: var(--bg); }

/* Cards / layout */
main { padding: 20px 20px 60px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-top: 18px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; }
h1 { font-size: 27px; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 0 22px; max-width: 62ch; }

label.field-label { display: block; font-weight: 600; margin: 20px 0 6px; }
label.field-label:first-of-type { margin-top: 0; }
.hint { color: var(--muted); font-size: 13.5px; margin: 2px 0 8px; }

input[type="text"], textarea, select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 15.5px;
  font-family: var(--font-body);
}
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Tag input */
.tagbox {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  cursor: text;
}
.tagbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tagbox input {
  flex: 1;
  min-width: 160px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-soft);
  border: 1px solid rgba(245,165,36,0.35);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 14px;
}
.chip button {
  border: none;
  background: rgba(255,255,255,0.10);
  color: var(--text);
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.chip button:hover { background: var(--warn); color: #fff; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 9px;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #221a05; }
.btn.primary:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn.small { padding: 7px 13px; font-size: 13.5px; font-weight: 500; }
.btn-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn-row .spacer { flex: 1; }

/* Opinion entries */
.opinion {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
}
.opinion .opinion-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.opinion select { width: auto; }
.opinion .tagbox { background: var(--panel); }
.opinion textarea { background: var(--panel); margin-top: 10px; min-height: 56px; }

/* Tally list */
.tally-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
}
.tally-row:last-child { border-bottom: none; }
.tally-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.tally-name { font-weight: 600; flex: 1; }
.tally-score {
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  border: 1px solid rgba(245,165,36,0.3);
  border-radius: 6px;
  padding: 2px 9px;
  font-size: 13.5px;
  flex: none;
}
.tally-sources { color: var(--muted); font-size: 13px; }

/* Profile cards */
.profile-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 18px;
  margin-top: 14px;
}
.profile-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-head h3 { margin: 0; font-size: 19px; flex: 1; }
.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge.mega, .badge.major { border-color: var(--warn); color: var(--warn); }
.badge.conf-low { border-color: var(--warn); color: var(--warn); }
.badge.conf-high { border-color: var(--good); color: var(--good); }
.profile-summary { color: var(--text); margin: 10px 0 4px; font-size: 14.5px; }
.mini-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin: 12px 0 5px; }
.mini-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-chips span {
  font-size: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.profile-error { color: var(--warn); margin: 8px 0; }

.spin {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14.5px;
  margin: 16px 0;
}
.notice.warn { border-left-color: var(--warn); }

/* Report */
.report {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 34px;
  margin-top: 16px;
}
.report h1 { font-size: 26px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.report h2 { font-size: 21px; margin-top: 30px; color: var(--accent); }
.report h3 { font-size: 17px; margin-top: 20px; }
.report ul, .report ol { padding-left: 24px; }
.report li { margin: 5px 0; }
.report blockquote {
  border-left: 3px solid var(--warn);
  margin: 14px 0;
  padding: 8px 16px;
  background: rgba(226,121,92,0.08);
  border-radius: 0 8px 8px 0;
}
.report hr { border: none; border-top: 1px solid var(--line); margin: 26px 0; }
.cursor-blink { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.site-footer { color: var(--muted); font-size: 13px; padding-bottom: 46px; }

/* Print: just the report */
@media print {
  body { background: #fff; color: #111; }
  .site-header, .steps, .site-footer, .btn, .btn-row, .lede, h1.screen-only, .notice { display: none !important; }
  .card { border: none; padding: 0; background: #fff; }
  .report { border: none; background: #fff; color: #111; padding: 0; }
  .report h2 { color: #111; }
}

@media (max-width: 640px) {
  .card { padding: 20px 16px; }
  .report { padding: 20px 16px; }
  .brand { font-size: 25px; }
}
