/* My Health Snapshot — v1
   Mobile-first wellness funnel. Orange CTA, cream bg, dark slate text.
*/
:root {
  --bg:           #FFF7EE;            /* warm cream */
  --bg-alt:       #FEF1E0;
  --surface:      #FFFFFF;
  --ink:          #1F2A37;            /* dark slate */
  --ink-soft:     #475569;
  --ink-muted:    #6B7280;
  --accent:       #F97316;            /* warm orange */
  --accent-700:   #EA580C;
  --accent-200:   #FED7AA;
  --accent-50:    #FFF7ED;
  --line:         #E7DFD3;
  --good:         #16A34A;
  --error:        #DC2626;
  --shadow-sm:    0 1px 2px rgba(20,30,45,.06);
  --shadow-md:    0 4px 14px rgba(20,30,45,.08);
  --shadow-lg:    0 16px 40px rgba(249,115,22,.18);
  --radius:       14px;
  --radius-lg:    20px;
  --max-content:  560px;
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
  --safe-top:     env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-700); text-decoration: none; }
a:hover { text-decoration: underline; }
.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; }

/* ============== BUTTONS ============== */
.btn {
  -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 1rem; padding: 14px 22px;
  border-radius: var(--radius); border: 0; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
  user-select: none; line-height: 1.2;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--accent-700); }
.btn-primary:active { transform: translateY(1px) scale(.99); background: var(--accent-700); box-shadow: var(--shadow-sm); }
.btn-lg { padding: 18px 24px; font-size: 1.05rem; width: 100%; min-height: 56px; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: #fff; }

/* ============== QUIZ SHELL ============== */
.quiz-shell, .result-shell, .checkout-shell, .thanks-shell, .report-shell, .blog-shell, .post-shell, .legal-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(var(--safe-top), 16px) 0 calc(var(--safe-bottom) + 16px);
}
.quiz-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 18px 14px; gap: 14px;
  max-width: var(--max-content); width: 100%; margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #FBBF24); box-shadow: 0 0 0 4px var(--accent-50); }
.brand-name { font-size: .9rem; letter-spacing: -0.01em; color: var(--ink); }

.progress-wrap { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 60%; }
.progress-bar { flex: 1; height: 6px; background: #F2E5D2; border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #FBBF24); border-radius: 999px; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.progress-label { font-size: .75rem; color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.quiz-stage { flex: 1; display: flex; flex-direction: column; padding: 18px 18px 0; max-width: var(--max-content); width: 100%; margin: 0 auto; }
.q-screen {
  flex: 1; display: flex; flex-direction: column;
  animation: fadeUp .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q-screen.leaving { animation: fadeOut .18s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-6px); } }

.q-headline { font-size: 1.65rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; margin: 12px 0 8px; }
.q-helper   { font-size: .98rem; color: var(--ink-muted); margin: 0 0 18px; }

.answers { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.answer-btn {
  -webkit-tap-highlight-color: transparent;
  appearance: none; cursor: pointer; user-select: none;
  width: 100%; min-height: 60px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 1.02rem; line-height: 1.25;
  padding: 16px 20px; border: 0; border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 6px 16px rgba(249,115,22,.28);
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
  display: flex; align-items: center; justify-content: center;
}
.answer-btn:hover { background: var(--accent-700); }
.answer-btn:active, .answer-btn.is-pressed { transform: translateY(1px) scale(.985); background: var(--accent-700); box-shadow: 0 3px 8px rgba(249,115,22,.35); }
.answer-btn:disabled { opacity: .8; cursor: not-allowed; }

.quiz-foot { padding: 16px 20px; text-align: center; max-width: var(--max-content); width: 100%; margin: 12px auto 0; }
.micro-legal { font-size: .72rem; color: var(--ink-muted); margin: 0; line-height: 1.5; }
.micro-trust { font-size: .72rem; color: var(--ink-soft); margin: 0 0 4px; line-height: 1.4; }
.micro-disclaimer { font-size: .68rem; color: var(--ink-muted); margin: 4px 0 0; line-height: 1.4; }

/* ============== INTERSTITIAL ============== */
.interstitial { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 24px; animation: fadeIn .25s ease; }
.interstitial-inner { text-align: center; max-width: 380px; }
.interstitial-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 14px 0 6px; }
.interstitial-sub { color: var(--ink-muted); margin: 0; }
.interstitial-continue {
  margin-top: 16px;
  min-width: 180px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}
.interstitial-continue.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.pulse-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); margin: 0 auto; box-shadow: 0 0 0 0 rgba(249,115,22,.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(249,115,22,.5); } 70% { box-shadow: 0 0 0 16px rgba(249,115,22,0); } 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============== ANALYZING ============== */
.analyzing { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 24px; animation: fadeIn .25s ease; }
.analyzing-inner { text-align: center; max-width: 380px; }
.analyzing-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin: 18px 0 6px; }
.analyzing-sub { color: var(--ink-muted); margin: 0; min-height: 1.5em; transition: opacity .2s; }
.loader-ring { width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--accent-200); border-top-color: var(--accent); margin: 0 auto; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== RESULT ============== */
.result-card, .checkout-card, .thanks-card, .report-card, .legal-card, .post-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 28px 22px;
  margin: 0 16px; max-width: var(--max-content);
  box-shadow: var(--shadow-md);
}
.result-shell, .checkout-shell, .thanks-shell { align-items: center; }
.result-card, .checkout-card, .thanks-card { width: 100%; }
.eyebrow { color: var(--accent-700); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px; }
.result-title { font-size: 1.45rem; line-height: 1.25; font-weight: 700; margin: 6px 0 16px; letter-spacing: -0.02em; }
.result-title em { font-style: normal; color: var(--accent-700); }
.pattern-list { list-style: none; padding: 0; margin: 0 0 18px; }
.pattern-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.pattern-list li:last-child { border-bottom: 0; }
.pattern-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.result-soft-blur { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 14px; filter: blur(4px); opacity: .6; pointer-events: none; }
.result-soft-blur .blur-line { background: linear-gradient(90deg, var(--line), #fff, var(--line)); height: 12px; border-radius: 6px; }
.result-soft-blur .blur-line.short { width: 60%; }
.result-sub { color: var(--ink-soft); margin: 6px 0 16px; font-size: .95rem; }
.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-input {
  width: 100%; min-height: 56px; padding: 16px 18px; border-radius: var(--radius);
  border: 1.5px solid var(--line); font-size: 1.02rem; background: #fff; color: var(--ink);
}
.email-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(249,115,22,.15); }
.email-helper { font-size: .8rem; color: var(--ink-muted); margin: 4px 0 0; text-align: center; }
.result-disclaimer { max-width: var(--max-content); margin: 16px auto; padding: 0 24px; font-size: .78rem; color: var(--ink-muted); text-align: center; line-height: 1.55; }

/* ============== CHECKOUT ============== */
.checkout-title { font-size: 1.45rem; line-height: 1.25; font-weight: 700; margin: 6px 0 6px; }
.checkout-sub { color: var(--ink-muted); margin: 0 0 16px; }
.checkout-bullets { list-style: none; padding: 0; margin: 12px 0; }
.checkout-bullets li { padding: 10px 0 10px 28px; position: relative; border-bottom: 1px solid var(--line); }
.checkout-bullets li::before { content: "✓"; position: absolute; left: 0; top: 10px; width: 22px; height: 22px; background: var(--accent-50); color: var(--accent-700); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 800; }
.price-row { display: flex; align-items: baseline; gap: 8px; padding: 14px 0; }
.price-amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; }
.price-suffix { color: var(--ink-muted); font-size: .9rem; }
.sim-banner { background: #FFF1E0; border: 1px solid var(--accent-200); color: #7A3D0A; padding: 10px 12px; border-radius: 12px; font-size: .85rem; margin: 12px 0; }
.pay-trust { font-size: .8rem; color: var(--ink-muted); text-align: center; margin: 10px 0 0; }
.pay-micro-trust { font-size: .78rem; color: var(--ink-soft); text-align: center; margin: 6px 0 0; }
.checkout-urgency { font-size: .82rem; color: var(--ink-soft); margin: 0 0 12px; }
.checkout-disclaimer { font-size: .78rem; color: var(--ink-muted); text-align: center; margin: 14px 0 0; }

/* ============== THANK YOU ============== */
.thanks-card { text-align: center; padding-top: 36px; padding-bottom: 36px; }
.check-badge { width: 64px; height: 64px; border-radius: 50%; background: #DCFCE7; color: var(--good); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; margin: 0 auto 14px; }
.thanks-card h1 { font-size: 1.5rem; margin: 6px 0 6px; }
.thanks-card p { color: var(--ink-muted); margin: 4px 0 18px; }
.thanks-sub { font-size: .9rem; margin-top: 10px !important; }

/* ============== REPORT ============== */
.report-shell { padding: 16px 0; }
.report-card { padding: 28px 22px; line-height: 1.6; margin: 0 16px; }
.report-title { font-size: 1.7rem; line-height: 1.2; font-weight: 700; margin: 6px 0 18px; letter-spacing: -0.02em; }
.report-html h2, .report-card h2 { font-size: 1.2rem; margin-top: 22px; }
.report-html h3 { font-size: 1.05rem; }
.recs-list { padding-left: 18px; margin: 14px 0; }
.recs-list li { margin-bottom: 14px; }
.recs-list h3 { margin: 0 0 4px; font-size: 1.02rem; color: var(--ink); }
.recs-list p { margin: 0; color: var(--ink-soft); }
.score-list { list-style: none; padding: 0; margin: 12px 0; }
.score-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.score-name { width: 110px; color: var(--ink-soft); font-size: .85rem; text-transform: capitalize; }
.score-bar { flex: 1; background: var(--bg-alt); border-radius: 999px; height: 10px; overflow: hidden; }
.score-bar > span { display: block; background: var(--accent); height: 100%; }
.report-disclaimer { background: var(--bg-alt); padding: 12px; border-radius: 12px; font-size: .82rem; color: var(--ink-soft); margin: 18px 0 0; }

/* ============== BLOG ============== */
.blog-hero { text-align: center; padding: 24px 18px 8px; max-width: var(--max-content); margin: 0 auto; }
.blog-hero h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.blog-hero p { color: var(--ink-muted); margin: 0 0 14px; }
.blog-grid { list-style: none; padding: 0 14px; margin: 18px auto; max-width: 1080px; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .blog-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px){ .blog-grid { grid-template-columns: 1fr 1fr 1fr; } }
.blog-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.blog-card-link { display: block; padding: 16px; color: inherit; text-decoration: none; }
.blog-card img, .blog-card-thumb { width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--accent-200), #FBBF24); border-radius: 10px; margin-bottom: 12px; object-fit: cover; }
.blog-card h3 { margin: 4px 0; font-size: 1.05rem; }
.blog-card p { color: var(--ink-muted); font-size: .9rem; margin: 4px 0 8px; }
.blog-cat { background: var(--accent-50); color: var(--accent-700); font-size: .7rem; padding: 4px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.blog-empty { text-align: center; padding: 40px; color: var(--ink-muted); }
.post-shell { padding: 16px 0; }
.post-card { line-height: 1.7; }
.post-card .post-hero { width: 100%; border-radius: 12px; margin: 14px 0; }
.post-cta { background: var(--bg-alt); padding: 22px; border-radius: 16px; margin-top: 30px; text-align: center; }

/* ============== LEGAL ============== */
.legal-card { line-height: 1.7; padding: 30px 24px; max-width: 720px; margin: 14px auto; }
.legal-card h1 { margin-top: 0; }

/* ============== FOOTER ============== */
.site-footer { padding: 30px 18px; text-align: center; max-width: var(--max-content); margin: 18px auto 0; color: var(--ink-muted); font-size: .8rem; }
.footer-disclaimer { font-size: .78rem; line-height: 1.6; margin-bottom: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.footer-links a { color: var(--ink-soft); }
.footer-copy { font-size: .75rem; }

/* ============== COOKIE BANNER ============== */
.cookie-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); background: #1F2A37; color: #fff; padding: 14px 16px; border-radius: 16px; box-shadow: 0 16px 40px rgba(20,30,45,.25); z-index: 60; max-width: 540px; margin: 0 auto; }
.cookie-text { margin: 0 0 10px; font-size: .85rem; line-height: 1.5; }
.cookie-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cookie-banner .btn { font-size: .85rem; padding: 10px 14px; min-height: auto; }
.cookie-banner .btn-ghost { color: #E5E7EB; border-color: #475569; }
.cookie-banner .btn-ghost:hover { background: #334155; }

/* ============== FORM STATES ============== */
.is-loading { opacity: .7; pointer-events: none; }
.error-text { color: var(--error); font-size: .85rem; margin: 6px 0 0; }

/* ============== RESPONSIVE TUNING ============== */
@media (max-height: 700px) {
  .q-headline { font-size: 1.4rem; }
  .answer-btn { min-height: 54px; padding: 14px 18px; }
}
@media (min-width: 480px) {
  .quiz-stage, .quiz-header, .quiz-foot { padding-left: 24px; padding-right: 24px; }
  .q-headline { font-size: 1.85rem; }
}

/* ============== ADMIN ============== */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: #F7F8FA; color: var(--ink); }
.admin-sidebar { background: #1F2A37; color: #E5E7EB; padding: 20px 16px; }
.admin-sidebar .brand { color: #fff; margin-bottom: 18px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar nav a { color: #CBD5E1; padding: 10px 12px; border-radius: 8px; font-weight: 500; font-size: .9rem; }
.admin-sidebar nav a:hover { background: #334155; color: #fff; text-decoration: none; }
.admin-sidebar nav a.is-active { background: var(--accent); color: #fff; }
.admin-content { padding: 24px 28px; max-width: 1180px; }
.admin-content h1 { margin: 0 0 18px; font-size: 1.5rem; }
.admin-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.admin-card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 14px; }
.kpi-card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }
.kpi-label { color: var(--ink-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; }
.kpi-sub { color: var(--ink-muted); font-size: .8rem; margin-top: 2px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.admin-table th, table.admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.admin-table th { color: var(--ink-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.admin-form .field { margin-bottom: 14px; }
.admin-form label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--ink-soft); }
.admin-form input[type=text],
.admin-form input[type=email],
.admin-form input[type=password],
.admin-form input[type=number],
.admin-form input[type=url],
.admin-form select,
.admin-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
.admin-form textarea { min-height: 110px; }
.admin-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: .9rem; }
.admin-flash.success { background: #DCFCE7; color: #166534; }
.admin-flash.error   { background: #FEE2E2; color: #991B1B; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-live { background: #DCFCE7; color: #166534; }
.badge-sim  { background: #FEF3C7; color: #92400E; }
.admin-login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #F7F8FA; }
.admin-login-card { background: #fff; padding: 30px 26px; border-radius: 16px; box-shadow: var(--shadow-md); width: 100%; max-width: 380px; }
.admin-login-card h1 { margin-top: 0; }
@media (max-width: 720px) { .admin-shell { grid-template-columns: 1fr; } .admin-sidebar { position: sticky; top: 0; z-index: 10; padding: 12px; } .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; } .admin-sidebar nav a { font-size: .8rem; padding: 6px 10px; } .admin-content { padding: 16px; } }
