/* ============================================================
   MyInsightReport — app.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* === TOKENS === */
:root {
  --max: 1000px;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --accent-mid: #c7d2fe;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --border: #e4e7ec;
  --border-hover: #c9cdd6;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #334155;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.05);
  --green: #16a34a;
  --yellow: #ca8a04;
  --orange: #ea580c;
  --red: #dc2626;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* === LAYOUT === */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* === TOPBAR === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  gap: 12px;
}
.brand {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -.2px;
  flex-shrink: 0;
}
.brand a { text-decoration: none; }
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.nav a:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-mid);
}

/* === HERO === */
.hero {
  padding: 48px 0 24px;
}
.hero-tight {
  padding-top: 32px;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--text);
  margin: 12px 0 14px;
  max-width: 22ch;
}
.lead {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 62ch;
  line-height: 1.65;
}

/* Hero badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-mid);
  margin-bottom: 16px;
}

/* Hero actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* Trust bar */
.trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
  max-width: 520px;
}
.trust-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.trust-item strong {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}
.trust-item span {
  display: block;
  color: var(--text-muted);
  font-size: .82rem;
  margin-top: 2px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .975rem;
  cursor: pointer;
  transition: all .18s;
  border: 1.5px solid transparent;
  line-height: 1;
  letter-spacing: -.01em;
}
.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  box-shadow: 0 2px 8px rgba(15,23,42,.18);
}
.btn-primary:hover {
  background: #1e293b;
  box-shadow: 0 4px 16px rgba(15,23,42,.22);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text-soft);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

/* === SECTIONS === */
.section {
  margin-top: 44px;
}
.section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  color: var(--text);
}

/* === REPORT CARDS === */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 860px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative;
  display: block;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
a.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.card p {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.5;
}
.cta {
  display: inline-block;
  margin-top: 12px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--accent);
}
.card-soon {
  opacity: .6;
  cursor: default;
}
.card-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green);
  background: #dcfce7;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* === STEPS === */
.steps {
  padding-left: 22px;
  color: var(--text-soft);
  line-height: 1.8;
}
.steps li { margin-bottom: 4px; }
.steps strong { color: var(--text); }

/* === BULLETS === */
.bullets {
  padding-left: 20px;
  color: var(--text-soft);
  line-height: 1.8;
}
.bullets li { margin-bottom: 2px; }

/* === FAQ === */
.faq { display: grid; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.faq-item h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.faq-item p {
  font-size: .92rem;
  color: var(--text-soft);
  line-height: 1.6;
}

/* === ALERT === */
.alert {
  background: #fff8f0;
  border: 1px solid #f5c6a0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: .92rem;
}

/* === REPORT / RESULTS === */
.report h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

/* Score grid */
.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}
@media (max-width: 860px) { .score-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .score-grid { grid-template-columns: 1fr; } }

.score-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.score-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.score-value {
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 6px;
  color: var(--text);
  letter-spacing: -.02em;
}
.score-box[data-risk="Low"] .score-value       { color: var(--green); }
.score-box[data-risk="Moderate"] .score-value  { color: var(--yellow); }
.score-box[data-risk="High"] .score-value      { color: var(--orange); }
.score-box[data-risk="Very high"] .score-value { color: var(--red); }

/* Card inside report */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Paywall */
.paywall {
  margin-top: 32px;
  padding: 28px 28px;
  border: 1.5px solid var(--accent-mid);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #f5f7ff 0%, #eef2ff 100%);
  box-shadow: 0 2px 16px rgba(79,70,229,.08);
}
.paywall h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -.02em;
}
.price-box { margin: 20px 0 22px; }
.price {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--text);
}

/* === QUESTION FORM === */
.form { margin-top: 8px; }

/* Progress bar */
.q-progress-wrap { margin-bottom: 24px; }
.q-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.q-progress-label {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.q-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.q-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  border-radius: 999px;
  transition: width .3s ease;
  width: 0%;
}

/* Question card */
.q-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.q-card:focus-within {
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99,102,241,.08);
}
.q-num {
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}
.q-label {
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 16px;
  font-size: 1.02rem;
}

/* Pill options */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill-option { position: relative; cursor: pointer; }
.pill-option input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pill-option span {
  display: inline-block;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.pill-option:hover span {
  border-color: #a5b4fc;
  color: var(--text);
  background: var(--accent-light);
}
.pill-option input:checked + span {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15,23,42,.15);
}

/* Extended note */
.extended-note {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: .92rem;
}

/* === UTILITY === */
.muted { color: var(--text-muted); }
.tiny  { font-size: .85rem; }

/* === FOOTER === */
.footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer p { margin-bottom: 4px; }

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .trust { grid-template-columns: 1fr; max-width: 100%; }
  .hero h1 { font-size: 1.85rem; }
  .paywall { padding: 20px 18px; }
  .topbar { flex-wrap: wrap; gap: 8px; overflow: hidden; }
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    min-width: 0;
    gap: 4px;
    justify-content: flex-start;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 4px 10px; font-size: .82rem; flex-shrink: 0; white-space: nowrap; }
}

/* === PRINT === */
@media print {
  .topbar, .nav, .btn, .footer, .paywall, .hero-actions { display: none !important; }
  .container { padding: 0 !important; }
  body { background: #fff; color: #000; }
  .card, .score-box, .q-card { border: 1px solid #ccc !important; box-shadow: none !important; }
}

/* === AI LOADING SPINNER === */
.air-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--accent-mid);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: air-spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes air-spin {
  to { transform: rotate(360deg); }
}

/* Not sure pill — visually distinct, dashed border */
.pill-notsure span {
  border-style: dashed;
  color: var(--text-soft);
  font-style: italic;
}
.pill-notsure:hover span {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-soft);
}
.pill-notsure input:checked + span {
  background: var(--surface);
  color: var(--text-soft);
  border-color: var(--border);
  border-style: dashed;
  font-weight: 600;
  font-style: italic;
  box-shadow: none;
}
