/* MediGuide AI website — shared by the home page and the legal pages. */

:root {
  --bg: #06101e;
  --surface: #0d1a30;
  --surface-2: #142140;
  --line: #1c3058;
  --fg: #e8eeff;
  --muted: #93a4c6;
  --primary: #4f8ef7;
  --primary-hover: #6a9ff8;
  --green: #00d46a;
  --warning: #f7a94f;
  --radius: 16px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.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;
}
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 16, 30, .82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 17px; }
.brand:hover { color: var(--fg); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  padding: 8px 12px; border-radius: 999px; transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--fg); background: var(--surface); }
.site-nav a.active, .site-nav a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
.menu-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--fg);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; place-items: center;
}
.menu-toggle svg { display: block; }
.menu-toggle .icon-close { display: none; }
.menu-open .menu-toggle .icon-open { display: none; }
.menu-open .menu-toggle .icon-close { display: block; }

/* ── Buttons, chips ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { background: var(--surface); color: var(--fg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); transition: all .15s;
}
.chip:hover { color: var(--fg); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Home: hero ─────────────────────────────────────────────────────────── */
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--green); font-weight: 600; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 12px; }
h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.1; margin: 0 0 18px; letter-spacing: -.02em; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art {
  position: relative; justify-self: center; width: min(320px, 100%); aspect-ratio: 1; border-radius: 32px;
  background: radial-gradient(circle at 50% 40%, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden;
}
.hero-art img { width: 60%; height: auto; border-radius: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); position: relative; }
.pulse {
  position: absolute; inset: 0; margin: auto; width: 60%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(0, 212, 106, .35); animation: pulse 2.8s ease-out infinite;
}
.pulse.delay { animation-delay: 1.4s; }
@keyframes pulse {
  from { transform: scale(.9); opacity: 1; }
  to { transform: scale(1.6); opacity: 0; }
}

/* ── Notice ─────────────────────────────────────────────────────────────── */
.notice {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(247, 169, 79, .08); border: 1px solid rgba(247, 169, 79, .35);
  border-radius: var(--radius); padding: 16px 18px; margin: 0 0 72px; font-size: 15px;
}
.notice svg { flex: none; margin-top: 2px; color: var(--warning); }
.notice strong { color: var(--warning); }

/* ── Sections and cards ─────────────────────────────────────────────────── */
section { padding: 0 0 80px; }
h2 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
.section-lead { color: var(--muted); margin: 0 0 28px; max-width: 40em; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: border-color .2s, transform .2s;
}
.card h3 { font-size: 17px; margin: 14px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.feature:hover { border-color: #2a4677; transform: translateY(-2px); }
.feature[hidden] { display: none; }
.icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(79, 142, 247, .14); color: var(--primary);
}
.icon.green { background: rgba(0, 212, 106, .12); color: var(--green); }
.tag { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
}
.step h3 { margin-top: 14px; }

.privacy { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.privacy .card h3 { margin-top: 0; }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s; }
.faq details[open] { border-color: #2a4677; }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

/* ── Contact ────────────────────────────────────────────────────────────── */
.contact {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px;
}
.contact h2 { margin-bottom: 6px; }
.contact p { margin: 0; color: var(--muted); }

.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.link-card { display: block; text-decoration: none; color: var(--fg); }
.link-card:hover { border-color: var(--primary); color: var(--fg); }
.link-card h3 { margin: 0 0 6px; }
.link-card span { display: inline-block; margin-top: 10px; color: var(--primary); font-size: 14px; font-weight: 600; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--fg); }

/* ── Legal pages ────────────────────────────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--green); z-index: 60; }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 72px; }
.doc-head { grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); }
.doc-head h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 14px; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: 14px; }
.toc-title { font-weight: 600; color: var(--fg); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--muted); text-decoration: none;
}
.toc li a:hover { color: var(--fg); }
.toc li a.active { color: var(--fg); border-left-color: var(--primary); }
.toc ul ul { display: none; }
.prose { max-width: 720px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 22px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 17px; margin-top: 24px; }
.prose p, .prose li { color: #c9d4ee; }
.prose strong { color: var(--fg); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; margin: 16px 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 600; }
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); cursor: pointer;
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Reveal on scroll (only when JS has run and motion is welcome) ─────── */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media print {
  .js .reveal { opacity: 1; transform: none; }
  .site-header, .to-top, .progress, .toast, .toc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { display: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 32px; }
  .hero-art { width: 200px; order: -1; justify-self: start; border-radius: 24px; }
  .grid, .links, .steps { grid-template-columns: 1fr 1fr; }
  .privacy { grid-template-columns: 1fr; }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 28px; }
  .toc { position: static; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
}
@media (max-width: 720px) {
  .menu-toggle { display: grid; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line); display: none;
  }
  .menu-open .site-nav { display: flex; }
  .site-nav a { padding: 12px 14px; border-radius: 10px; }
}
@media (max-width: 560px) {
  .grid, .links, .steps { grid-template-columns: 1fr; }
  .contact { padding: 22px; }
}
