/* ============================================================
   guides.css — Shared stylesheet for all /guides/ pages
   White card on blue gradient background, clean typography
   ============================================================ */

/* ── Page layout ── */
/* Override main.css SPA constraints — guide pages are standalone, not SPA */
html, body { overflow-y: auto !important; height: auto !important; }
body { background: #ffffff !important; }

.guide-page {
  min-height: 100vh;
  /* These pages are also injected into the applicant SPA shell, where <html>
     keeps the dark token background (--gray-bg: #0f172a in tokens.css) and the
     body rule above does not cover it. Without an own surface the near-black
     guide typography lands on a near-black backdrop. */
  background: #ffffff;
}

.guide-wrap {
  padding: 1.5rem 1.25rem 4rem;
  max-width: 860px;
  margin: 0 auto;
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: .85rem;
  color: #64748b;
  margin-bottom: 1.25rem;
}
.breadcrumb a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ── Hero block ── */
.guide-hero {
  padding: 1rem 0 1.5rem;
}
.guide-hero-badge {
  display: inline-block;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 999px;
  padding: .28rem .85rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}
.guide-hero h1 {
  margin: 0 0 .75rem;
  font-size: clamp(1.55rem, 3.8vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: #0f172a;
}
.guide-hero p {
  margin: 0 0 1.1rem;
  color: #475569;
  line-height: 1.65;
  font-size: 1.02rem;
  max-width: 70ch;
}
.guide-hero-cta {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}
.guide-hero-note {
  margin: .7rem 0 0;
  color: #64748b;
  font-size: .85rem;
}
.guide-hero-note a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}
.guide-hero-note a:hover {
  text-decoration: underline;
}

/* ── Buttons ── */
.guide-btn {
  border-radius: 999px;
  padding: .7rem 1.3rem;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  font-size: .93rem;
  text-decoration: none;
  display: inline-block;
  transition: opacity .15s;
}
.guide-btn:hover { opacity: .88; }
.guide-btn-primary { background: #1e40af; color: #fff; }
.guide-btn-secondary { background: #fff; color: #1e40af; border: 1px solid #cbd5e1; }
/* When the CTA is an <a> inside the card, `.guide-card a` (0,1,1) outranks the
   button rule (0,1,0) and repainted the label blue on the blue button. */
.guide-card a.guide-btn-primary { color: #fff; }
.guide-card a.guide-btn-secondary { color: #1e40af; }
.guide-card a.guide-btn-white,
.guide-btn-white { background: #1e40af; color: #fff; padding: .82rem 2rem; font-size: .97rem; }

/* ── Main white card ── */
.guide-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2.2rem 2.4rem 2.4rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  color: #1e293b;
}

@media (max-width: 640px) {
  .guide-card { padding: 1.4rem 1.2rem 1.8rem; }
  .guide-hero { padding: 1.6rem 1.2rem 1.4rem; }
}

/* ── Typography inside card ── */
.guide-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 2rem 0 .65rem;
  color: #0f172a;
  line-height: 1.3;
  padding-bottom: .4rem;
  border-bottom: 2px solid #e2e8f0;
}
.guide-card h2:first-child { margin-top: 0; }

.guide-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 1.5rem 0 .45rem;
  color: #1e40af;
}
.guide-card h4 {
  font-size: .97rem;
  font-weight: 700;
  margin: 0 0 .4rem;
  color: #0f172a;
}
.guide-card p {
  margin: 0 0 .95rem;
  line-height: 1.75;
  font-size: 1rem;
  color: #334155;
}
.guide-card a { color: #2563eb; }
.guide-card a:hover { text-decoration: underline; }
.guide-card strong { color: #0f172a; font-weight: 700; }

.guide-card ul, .guide-card ol {
  margin: .4rem 0 1rem 1.3rem;
  padding: 0;
}
.guide-card li {
  margin-bottom: .45rem;
  line-height: 1.68;
  color: #334155;
  font-size: 1rem;
}

/* ── Callouts ── */
.guide-callout {
  border-radius: 0 12px 12px 0;
  padding: .95rem 1.2rem;
  margin: 1.3rem 0;
  border-left-width: 4px;
  border-left-style: solid;
  line-height: 1.65;
  font-size: .97rem;
  color: #1e293b;
}
.guide-callout strong {
  display: block;
  margin-bottom: .3rem;
  font-size: .95rem;
}
.guide-callout-info { background: #eff6ff; border-color: #3b82f6; }
.guide-callout-warning { background: #fff7ed; border-color: #f97316; }
.guide-callout-success { background: #f0fdf4; border-color: #22c55e; }

/* ── Checklist ── */
.guide-checklist {
  list-style: none;
  padding: 0;
  margin: .5rem 0 1rem;
}
.guide-checklist li {
  padding: .32rem 0 .32rem 1.8rem;
  position: relative;
  margin: 0;
}
.guide-checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: .35rem;
  color: #22c55e;
  font-weight: 800;
  font-size: .95rem;
}

/* ── Info card grid ── */
.guide-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .9rem;
  margin: 1rem 0 1.3rem;
}
.guide-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: .9rem;
  margin: 1rem 0 1.3rem;
}
.guide-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.guide-info-card h4 { color: #1e40af; font-size: .92rem; }
.guide-info-card p { font-size: .88rem; color: #475569; line-height: 1.55; margin: 0; }

/* ── Table ── */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: .91rem;
}
.guide-table th {
  background: #1e40af;
  color: #fff;
  padding: .6rem .9rem;
  text-align: left;
  font-weight: 700;
}
.guide-table td {
  padding: .55rem .9rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  color: #334155;
  line-height: 1.55;
}
.guide-table tr:nth-child(even) td { background: #f8fafc; }

/* ── FAQ ── */
.guide-faq { margin-top: 1rem; }
.guide-faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 0;
}
.guide-faq-item:last-child { border-bottom: none; }
.guide-faq-q {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .35rem;
  font-size: 1rem;
  line-height: 1.4;
}
.guide-faq-a {
  color: #475569;
  line-height: 1.68;
  font-size: .96rem;
}

/* ── CTA block inside card ── */
.guide-cta-block {
  padding: 1.8rem 0 0;
  text-align: center;
  margin: 2.5rem 0 1rem;
  border-top: 1px solid #e2e8f0;
}
.guide-cta-block h2 {
  margin: 0 0 .5rem !important;
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  border: none !important;
  padding: 0 !important;
}
.guide-cta-block p {
  margin: 0 0 1.1rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  color: #475569;
}

/* ── Related links ── */
.guide-related { margin-top: 2rem; }
.guide-related h3 {
  font-size: .85rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .75rem;
}
.guide-related a {
  display: block;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  padding: .3rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .97rem;
}
.guide-related a:last-child { border-bottom: none; }
.guide-related a:hover { text-decoration: underline; }

/* ── Document section box ── */
.guide-doc-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  margin: .75rem 0;
}
.guide-doc-section h4 { color: #1e40af; margin: 0 0 .45rem; }
.guide-doc-section ul { margin: .3rem 0 0 1.2rem; }
.guide-doc-section li { font-size: .9rem; color: #475569; margin-bottom: .3rem; }

/* ── Product/class grid (Annex XVI, IVDR) ── */
.guide-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .9rem;
  margin: 1rem 0 1.3rem;
}
.guide-class-card {
  border-radius: 12px;
  padding: 1.1rem;
  color: #fff;
  text-align: center;
}
.guide-class-card h4 { margin: 0 0 .3rem; font-size: 1.2rem; font-weight: 900; color: #fff; }
.guide-class-card p { margin: 0; font-size: .82rem; opacity: .92; line-height: 1.4; color: #fff; }
/* 700-weight tints: the 500s were too light for the white card text (2.3–2.8
   contrast). Same hues, now readable. */
.guide-class-a { background: #15803d; }
.guide-class-b { background: #1d4ed8; }
.guide-class-c { background: #c2410c; }
.guide-class-d { background: #b91c1c; }

/* ── Next-step provider paths (bottom of guide) ── */
.guide-next-paths {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e2e8f0;
}
.guide-next-paths h3 {
  font-size: .85rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .75rem;
}
.guide-next-paths .guide-info-card {
  display: flex;
  flex-direction: column;
}
.guide-next-paths .guide-info-card p { margin-bottom: 0; }
.guide-next-paths .guide-info-card a {
  display: inline-block;
  margin-top: auto;
  padding-top: .6rem;
  font-size: .88rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}
.guide-next-paths .guide-info-card a:hover { text-decoration: underline; }
.guide-next-paths-note {
  font-size: .88rem;
  color: #64748b;
  margin-top: .85rem !important;
}
.guide-next-paths-note a { color: #2563eb; font-weight: 600; }

/* ── Floating back / scroll-to-top / scroll-to-bottom shortcuts ── */
.guide-nav-btns { position: fixed; right: 20px; bottom: 30px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.guide-nav-btn { box-sizing: border-box; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); background: #0d2f6e; color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,0.25); text-decoration: none; opacity: 1; transition: opacity .2s ease, transform .2s ease, background .2s ease; }
.guide-nav-btn.guide-nav-scroll { opacity: 0; pointer-events: none; }
.guide-nav-btn.guide-nav-scroll.visible { opacity: 1; pointer-events: auto; }
.guide-nav-btn:hover { transform: translateY(-2px); background: #133a86; }
@media (max-width: 768px) {
  .guide-nav-btns { right: 10px; bottom: 16px; gap: 8px; }
  .guide-nav-btn { width: 38px; height: 38px; font-size: 1rem; }
}

/* ── Exit-recovery modal (one-shot, before the visitor leaves the article) ── */
.exit-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.exit-modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.exit-modal {
  position: relative;
  background: #fff; border-radius: 20px; max-width: 440px; width: 100%;
  padding: 2rem 1.9rem 1.8rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: translateY(12px);
  transition: transform .2s ease;
}
.exit-modal-overlay.is-open .exit-modal { transform: translateY(0); }
.exit-modal-close {
  position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px;
  border-radius: 50%; border: 0; background: #f1f5f9; color: #64748b;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.exit-modal-close:hover { background: #e2e8f0; }
.exit-modal h3 { margin: 0 .2rem .6rem 0; font-size: 1.28rem; font-weight: 800; color: #0f172a; padding-right: 1.6rem; }
.exit-modal p { margin: 0 0 1.4rem; color: #475569; line-height: 1.55; font-size: .95rem; }
.exit-modal-actions { display: flex; flex-direction: column; gap: .55rem; }
.exit-modal-actions .guide-btn { text-align: center; width: 100%; box-sizing: border-box; }
.exit-modal-dismiss { background: none; border: 0; color: #94a3b8; font-size: .85rem; cursor: pointer; padding: .3rem; }
.exit-modal-dismiss:hover { color: #64748b; text-decoration: underline; }
@media (max-width: 480px) {
  .exit-modal { padding: 1.6rem 1.4rem 1.4rem; }
}
