/* InteractRx — Shared Styles */
/* NHS-inspired palette, Source Sans 3 typography */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --nhs-blue: #005EB8;
  --nhs-dark: #003087;
  --teal: #00A499;
  --red: #D5281B;
  --amber: #B58500;
  --warm-grey: #F9FAFB;
  --border: #E5E7EB;
  --text: #1D2939;
  --text-light: #667085;
  --white: #FFFFFF;
  --blue: #005EB8;
  --surface: #F9FAFB;
  --mono: 'Source Code Pro', monospace;
}

body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1 { font-weight: 700; letter-spacing: -1.5px; line-height: 1.1; }
h2 { font-weight: 700; letter-spacing: -1px; }
h3 { font-weight: 600; }
a { color: var(--nhs-blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--nhs-dark); }

/* ---- Buttons ---- */
.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-block;
  text-align: center;
}
.btn-blue { background: var(--nhs-blue); color: white; }
.btn-blue:visited { color: white; }
.btn-blue:hover { background: var(--nhs-dark); }
.btn-white { background: white; color: var(--nhs-blue); border: 1.5px solid var(--nhs-blue); }
.btn-white:visited { color: var(--nhs-blue); }
.btn-white:hover { background: #F0F5FF; }
.btn-teal { background: var(--teal); color: white; }
.btn-teal:visited { color: white; }
.btn-teal:hover { background: #008F84; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-xl { padding: 16px 36px; font-size: 16px; }
.btn-block { display: block; width: 100%; }

/* ---- Navigation ---- */
nav {
  padding: 18px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 22px; font-weight: 700; color: var(--nhs-blue); text-decoration: none; }
.logo span { color: var(--teal); font-weight: 400; }
.nav-right { display: flex; align-items: center; gap: 32px; }
.nav-right a { text-decoration: none; color: var(--text-light); font-size: 15px; font-weight: 500; }
.nav-right a:hover { color: var(--nhs-blue); }
.nav-right a.active { color: var(--nhs-blue); }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.mobile-menu-btn svg { width: 24px; height: 24px; stroke: var(--text); }

/* ---- Footer ---- */
footer {
  padding: 40px 60px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.footer-main { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 14px; color: var(--text-light); text-decoration: none; }
.footer-links a:hover { color: var(--nhs-blue); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-light); }
.footer-sources { font-size: 13px; color: var(--text-light); }
footer .logo { font-size: 18px; }

/* ---- Section Patterns ---- */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.section-header h2 { font-size: 40px; }
.section-header p { font-size: 17px; color: var(--text-light); margin-top: 8px; }
.section-padded { padding: 100px 60px; }
.section-grey { background: var(--warm-grey); }

/* ---- Trust Strip ---- */
.trust-strip { display: flex; gap: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.trust-strip span { font-size: 13px; color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.trust-check { color: var(--teal); font-weight: 700; }

/* ---- Hero Badge ---- */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #E0F2FE;
  color: var(--nhs-blue);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 28px;
  width: fit-content;
}

/* ---- Drug Checker Styles ---- */
.checker-container { max-width: 800px; margin: 0 auto; }
.checker-search-wrapper { position: relative; margin-bottom: 20px; }
.checker-input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
}
.checker-input:focus { border-color: var(--nhs-blue); outline: none; }
.checker-input::placeholder { color: #94A3B8; }
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94A3B8;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  margin-top: 4px;
}
.autocomplete-dropdown.visible { display: block; }
.autocomplete-item {
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.1s;
}
.autocomplete-item:hover, .autocomplete-item.highlighted { background: var(--warm-grey); }
.autocomplete-item .drug-name { font-weight: 600; font-size: 15px; }
.autocomplete-item .drug-category { font-size: 12px; color: var(--text-light); }

/* Medication Tags */
.med-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; min-height: 40px; }
.med-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--mono);
  font-weight: 500;
  background: var(--warm-grey);
  border: 1px solid var(--border);
  animation: tagIn 0.2s ease;
}
@keyframes tagIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.med-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.med-tag-remove:hover { color: var(--red); }
.med-empty { font-size: 14px; color: #94A3B8; padding: 10px 0; }

/* Interaction Results */
.interaction-results { margin-top: 24px; }
.interaction-counter {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.interaction-counter strong { color: var(--text); }

.flag { padding: 14px 18px; border-radius: 10px; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.flag.red { background: #FEF3F2; border: 1px solid #FECACA; }
.flag-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.flag-text { font-size: 14px; font-weight: 600; color: #991B1B; }

.result {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 12px;
  animation: resultIn 0.3s ease;
}
@keyframes resultIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.result.high { border-left: 4px solid var(--red); }
.result.medium { border-left: 4px solid var(--amber); }
.result.low { border-left: 4px solid var(--teal); }
.result-sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.result-sev.high { color: var(--red); }
.result-sev.medium { color: var(--amber); }
.result-sev.low { color: var(--teal); }
.result-pair { font-size: 16px; font-weight: 700; font-family: var(--mono); margin-bottom: 6px; }
.result-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.result-note { font-size: 14px; color: var(--text-light); line-height: 1.6; }
.result-recommendation { font-size: 14px; color: var(--text); line-height: 1.6; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.result-recommendation strong { color: var(--nhs-blue); }
.result-ref { font-size: 12px; color: #94A3B8; margin-top: 10px; }
.result-meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.result-evidence, .result-additive { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.result-evidence { background: #EFF6FF; color: var(--nhs-blue); }
.result-additive { background: #FFF7ED; color: #C05621; }

/* Demo overlay */
.demo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 16px;
  z-index: 10;
  padding: 40px;
}
.demo-overlay h3 { font-size: 24px; margin-bottom: 8px; }
.demo-overlay p { font-size: 16px; color: var(--text-light); margin-bottom: 24px; max-width: 360px; }

/* ---- Feature Cards ---- */
.feat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 800px; margin: 0 auto; }
.feat-card { padding: 32px; border: 1px solid var(--border); border-radius: 14px; transition: border-color 0.2s; }
.feat-card:hover { border-color: var(--nhs-blue); }
.feat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #E0F2FE;
  color: var(--nhs-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 16px; font-weight: 700;
}
.feat-card h3 { font-size: 16px; margin-bottom: 6px; }
.feat-card p { font-size: 14px; color: var(--text-light); }

/* ---- Pricing ---- */
.price-box {
  max-width: 440px;
  margin: 0 auto;
  background: white;
  border: 2px solid var(--nhs-blue);
  border-radius: 16px;
  padding: 44px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
.price-num { font-size: 56px; font-weight: 700; color: var(--nhs-blue); letter-spacing: -2px; }
.price-per { font-size: 16px; color: var(--text-light); }
.price-save { font-size: 14px; color: var(--teal); font-weight: 600; margin-top: 4px; margin-bottom: 28px; }
.price-features { list-style: none; text-align: left; margin-bottom: 32px; }
.price-features li { padding: 9px 0; font-size: 15px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #F3F4F6; }
.price-features li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }
.price-note { font-size: 13px; color: var(--text-light); margin-top: 12px; }

/* ---- CTA Section ---- */
.cta { padding: 80px 60px; text-align: center; border-top: 1px solid var(--border); }
.cta h2 { font-size: 36px; font-weight: 700; letter-spacing: -1px; margin-bottom: 12px; }
.cta p { font-size: 16px; color: var(--text-light); margin-bottom: 28px; }
.cta-row { display: flex; gap: 8px; max-width: 400px; margin: 0 auto; }
.cta-row input { flex: 1; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; }
.cta-row input:focus { border-color: var(--nhs-blue); outline: none; }
.cta-error { color: var(--red); font-size: 14px; margin-top: 8px; }
.cta-success { color: var(--teal); font-size: 16px; font-weight: 600; margin-top: 12px; }

/* ---- FAQ Accordion ---- */
.faq-list { max-width: 700px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%;
  padding: 20px 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  text-align: left;
}
.faq-question:hover { color: var(--nhs-blue); }
.faq-chevron { transition: transform 0.2s; font-size: 20px; color: var(--text-light); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer-inner { padding-bottom: 20px; font-size: 15px; color: var(--text-light); line-height: 1.6; }

/* ---- Page-specific: Home ---- */
.page-home .hero { display: grid; grid-template-columns: 1fr 1fr; min-height: 85vh; }
.page-home .hero-text { padding: 100px 60px; display: flex; flex-direction: column; justify-content: center; }
.page-home .hero h1 { font-size: 52px; }
.page-home .hero p { font-size: 19px; color: var(--text-light); max-width: 480px; margin-bottom: 36px; }
.page-home .hero-ctas { display: flex; gap: 12px; margin-bottom: 40px; }
.page-home .hero-visual { background: var(--warm-grey); display: flex; align-items: center; justify-content: center; padding: 60px; }

/* Hero card (static preview on home) */
.hero-card { background: white; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.06); border: 1px solid var(--border); width: 100%; max-width: 440px; overflow: hidden; }
.hero-card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.hero-card-header h3 { font-size: 15px; }
.hero-card-header .tag { font-size: 11px; background: #E0F2FE; color: var(--nhs-blue); padding: 3px 10px; border-radius: 100px; font-weight: 600; }
.hero-card-body { padding: 24px; }
.mini-meds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.mini-med { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-family: var(--mono); font-weight: 500; background: var(--warm-grey); border: 1px solid var(--border); }
.mini-interaction { padding: 14px; border-radius: 10px; margin-bottom: 10px; border-left: 3px solid; }
.mini-interaction.high { border-color: var(--red); background: #FEF3F2; }
.mini-interaction.medium { border-color: var(--amber); background: #FFFCF0; }
.mini-sev { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.mini-sev.high { color: var(--red); }
.mini-sev.medium { color: var(--amber); }
.mini-pair { font-size: 13px; font-weight: 600; font-family: var(--mono); margin-bottom: 3px; }
.mini-note { font-size: 12px; color: var(--text-light); }

/* Demo section (home) */
.demo-app {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  position: relative;
}
.demo-bar { padding: 12px 20px; background: var(--warm-grey); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.r { background: #FECACA; } .dot.y { background: #FDE68A; } .dot.g { background: #A7F3D0; }
.demo-url { margin-left: 12px; font-size: 12px; color: var(--text-light); font-family: var(--mono); }
.demo-content { padding: 32px; }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mb-4 { margin-top: 16px; }
.max-w-800 { max-width: 800px; margin-left: auto; margin-right: auto; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .page-home .hero { grid-template-columns: 1fr; }
  .page-home .hero-visual { display: none; }
  .page-home .hero h1 { font-size: 36px; }
  .page-home .hero-text { padding: 60px 24px; }
  .feat-grid { grid-template-columns: 1fr; }
  .section-padded { padding: 60px 24px; }
  nav { padding: 14px 24px; }
  .nav-right a:not(.btn) { display: none; }
  .mobile-menu-btn { display: block; }
  footer { padding: 28px 24px; }
  .footer-main { flex-direction: column; gap: 16px; }
  .cta { padding: 60px 24px; }
  .cta-row { flex-direction: column; }
  .trust-strip { flex-direction: column; gap: 8px; }
  .section-header h2 { font-size: 32px; }
}

/* ---- PSEO Pages ---- */
.pseo-page { padding: 40px 0 80px; }
.pseo-container { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.breadcrumb { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.interaction-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.interaction-header h1 { font-size: 28px; margin: 0; }
.severity-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 4px; text-transform: uppercase; }
.severity-badge.sev-high { background: #FEE2E2; color: #991B1B; }
.severity-badge.sev-medium { background: #FEF3C7; color: #92400E; }
.severity-badge.sev-low { background: #D1FAE5; color: #065F46; }
.severity-badge.sev-normal { background: #E0E7FF; color: #3730A3; }
.severity-badge.sev-unknown { background: #F3F4F6; color: #374151; }

.interaction-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin-bottom: 24px; }
.interaction-message p { font-size: 16px; line-height: 1.6; margin: 0 0 12px; }
.evidence-tag, .additive-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; margin-top: 4px; margin-right: 8px; background: #F3F4F6; color: #374151; }

.drug-links { display: flex; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; }
.drug-link-btn { display: inline-block; padding: 10px 18px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; background: var(--surface); }
.drug-link-btn:hover { border-color: var(--blue); color: var(--blue); }

.related-section { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 48px; }
.related-col h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.related-list { list-style: none; padding: 0; margin: 0; }
.related-item { margin-bottom: 8px; }
.related-item a { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); text-decoration: none; }
.related-item a:hover { color: var(--blue); }

.tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; white-space: nowrap; }
.tag.sev-high { background: #FEE2E2; color: #991B1B; }
.tag.sev-medium { background: #FEF3C7; color: #92400E; }
.tag.sev-low { background: #D1FAE5; color: #065F46; }
.tag.sev-normal { background: #E0E7FF; color: #3730A3; }
.tag.sev-unknown { background: #F3F4F6; color: #374151; }

.pseo-cta { background: var(--blue); color: #fff; border-radius: 12px; padding: 40px; text-align: center; }
.pseo-cta h2 { font-size: 22px; margin-bottom: 8px; color: #fff; }
.pseo-cta p { margin-bottom: 20px; opacity: 0.9; }
.pseo-cta .btn-blue { background: #fff; color: var(--blue); }
.pseo-cta .btn-blue:hover { background: #EFF6FF; }

/* Drug profile */
.drug-summary { display: flex; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.summary-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 24px; text-align: center; min-width: 100px; }
.summary-stat .stat-num { display: block; font-size: 28px; font-weight: 700; }
.summary-stat .stat-label { font-size: 12px; color: var(--text-light); }
.summary-stat.sev-high { border-color: #FECACA; }
.summary-stat.sev-medium { border-color: #FDE68A; }
.summary-stat.sev-low { border-color: #A7F3D0; }

.interaction-table-wrap { overflow-x: auto; margin-bottom: 48px; }
.interaction-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.interaction-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); font-weight: 600; }
.interaction-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.interaction-table tr:hover td { background: var(--surface); }
.interaction-table a { color: var(--text); text-decoration: none; }
.interaction-table a:hover { color: var(--blue); }

/* Severity index */
.severity-intro { font-size: 16px; color: var(--text-light); margin-bottom: 32px; }
.severity-grid { columns: 3; column-gap: 24px; margin-bottom: 48px; }
.severity-group { break-inside: avoid; margin-bottom: 24px; }
.severity-group h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.severity-group h3 a { color: var(--text); text-decoration: none; }
.severity-group h3 a:hover { color: var(--blue); }
.severity-group ul { list-style: none; padding: 0; margin: 0; }
.severity-group li { font-size: 13px; padding: 2px 0; }
.severity-group li a { color: var(--text-light); text-decoration: none; }
.severity-group li a:hover { color: var(--blue); }

@media (max-width: 768px) {
  .related-section { grid-template-columns: 1fr; }
  .severity-grid { columns: 1; }
  .interaction-header h1 { font-size: 22px; }
  .pseo-cta { padding: 24px; }
}
