/* ==========================================================================
   MediCompare — style.css
   A small layer on top of Bootstrap 5. Colours, type and a few components.
   ========================================================================== */

:root {
  --ink:        #10232E;   /* headings and body text */
  --ink-soft:   #52676F;   /* secondary text */
  --page:       #F1F6F4;   /* page background */
  --surface:    #FFFFFF;   /* cards */
  --line:       #D8E4E1;   /* borders */
  --teal:       #0E7C6B;   /* primary action */
  --teal-dark:  #0A5E51;
  --teal-wash:  #E4F1ED;
  --amber:      #A96A05;   /* demo-data / caution */
  --amber-wash: #FDF3E0;
}

/* ----------------------------- Base ------------------------------------ */

body {
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }

a { color: var(--teal-dark); }

/* Visible focus for keyboard users, everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.chip:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1100;
  background: var(--ink); color: #fff; padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------- Header ----------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.navbar { padding-top: .6rem; padding-bottom: .6rem; }

.navbar-brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.15rem; color: var(--ink);
}

.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--teal); color: #fff;
  font-size: .8rem; font-weight: 700;
}

.nav-link { color: var(--ink-soft); font-weight: 500; }
.nav-link:hover, .nav-link:focus { color: var(--teal-dark); }

.status-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .2rem .7rem; white-space: nowrap;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #B9C6C3;
}
.status-chip.is-online .status-dot { background: var(--teal); }
.status-chip.is-offline .status-dot { background: #C0392B; }

/* The disclaimer strip rides along with the sticky header. */
.header-disclaimer {
  margin: 0; padding: .45rem 1rem;
  background: var(--amber-wash);
  border-top: 1px solid #F0DDB6;
  color: var(--amber);
  font-size: .8rem; text-align: center;
}

/* ----------------------------- Hero ------------------------------------ */

.hero { padding: 4.5rem 0 3.5rem; }

.hero-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 5.5vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 1.1rem;
}

.hero-subtitle {
  font-size: 1.12rem; color: var(--ink-soft);
  max-width: 34rem; margin-bottom: 1.8rem;
}

.hero-note {
  margin-top: 1.1rem; margin-bottom: 0;
  font-size: .84rem; color: var(--ink-soft);
}

/* Illustrative price panel in the hero. Static, sample values. */
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem;
  margin: 0;
}

.hero-panel-head {
  display: flex; align-items: center; gap: .7rem;
  font-weight: 600; font-size: .95rem;
  margin-bottom: 1.2rem;
}

.hero-bars { list-style: none; margin: 0; padding: 0; }

.hero-bars li {
  display: grid;
  grid-template-columns: 1fr;
  gap: .25rem;
  margin-bottom: 1rem;
}

.bar-label { font-size: .8rem; color: var(--ink-soft); }

.bar {
  display: block; height: 10px; border-radius: 5px;
  background: #BFD9D2;
}
.bar-low { background: var(--teal); }

.bar-price { font-size: .85rem; font-weight: 600; }

.hero-panel-foot {
  margin: .2rem 0 0; font-size: .75rem; color: var(--ink-soft);
}

/* --------------------------- Sections ---------------------------------- */

.section { padding: 3.5rem 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

.section-title { font-size: 1.7rem; margin-bottom: .5rem; }

.section-lead {
  color: var(--ink-soft); max-width: 46rem; margin-bottom: 1.8rem;
}

/* ----------------------------- Cards ----------------------------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.panel-muted { background: var(--teal-wash); border-color: #CCE3DC; }

.form-label { font-weight: 600; font-size: .92rem; }

.form-control {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: .65rem .85rem;
}
.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 107, .15);
}

.btn-primary {
  --bs-btn-bg: var(--teal);
  --bs-btn-border-color: var(--teal);
  --bs-btn-hover-bg: var(--teal-dark);
  --bs-btn-hover-border-color: var(--teal-dark);
  --bs-btn-active-bg: var(--teal-dark);
  --bs-btn-active-border-color: var(--teal-dark);
  --bs-btn-disabled-bg: #8FB5AD;
  --bs-btn-disabled-border-color: #8FB5AD;
  font-weight: 600;
  border-radius: 9px;
  padding-inline: 1.4rem;
}

/* Example medicines in the demo dataset */
.example-list { display: flex; flex-wrap: wrap; gap: .5rem; }

.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .84rem;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.chip:hover { border-color: var(--teal); color: var(--teal-dark); }

/* --------------------------- Results ----------------------------------- */

.results-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.2rem;
}

.badge-demo {
  display: inline-block;
  background: var(--amber-wash);
  border: 1px solid #F0DDB6;
  color: var(--amber);
  border-radius: 6px;
  padding: .15rem .5rem;
  font-size: .72rem; font-weight: 700;
}
.badge-demo-lg { font-size: .8rem; padding: .3rem .75rem; }

.notice-demo {
  background: var(--amber-wash);
  border: 1px solid #F0DDB6;
  color: var(--amber);
  border-radius: 10px;
  padding: .7rem 1rem;
  font-size: .88rem;
}

.stat-card {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.stat-card-accent { background: var(--teal-wash); border-color: #CCE3DC; }

.stat-label { font-size: .82rem; color: var(--ink-soft); }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-meta  { font-size: .76rem; color: var(--ink-soft); }

.table > :not(caption) > * > * { padding: .85rem 1rem; }
.table thead th {
  font-size: .78rem; color: var(--ink-soft); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.table tbody tr.is-lowest { background: var(--teal-wash); }
.option-name { font-weight: 600; }
.option-tag {
  display: inline-block; margin-left: .4rem;
  font-size: .68rem; font-weight: 700;
  color: var(--teal-dark); background: var(--teal-wash);
  border-radius: 5px; padding: .1rem .4rem;
}

.info-card {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.info-card h4 { font-size: .92rem; margin-bottom: .4rem; }
.info-card p { font-size: .87rem; color: var(--ink-soft); margin: 0; }

.disclaimer-block {
  border-left: 4px solid var(--teal);
  background: var(--teal-wash);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.2rem;
  font-size: .9rem;
}

/* ----------------------------- Chat ------------------------------------ */

.chat-panel { overflow: hidden; }

.chat-log {
  padding: 1.3rem;
  max-height: 27rem;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 1rem;
}

.chat-msg { max-width: 82%; }
.chat-msg p { margin: 0; font-size: .92rem; }

.chat-role {
  display: block; font-size: .72rem; font-weight: 700;
  color: var(--ink-soft); margin-bottom: .25rem;
}

.chat-msg-user {
  align-self: flex-end; text-align: right;
}
.chat-msg-user p {
  background: var(--teal); color: #fff;
  border-radius: 12px 12px 3px 12px;
  padding: .7rem .95rem; display: inline-block; text-align: left;
}

.chat-msg-ai p {
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 3px;
  padding: .7rem .95rem;
}

.chat-source {
  display: block; margin-top: .35rem;
  font-size: .72rem; color: var(--ink-soft);
}

.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: 0 1.3rem 1rem;
}

.chat-form {
  display: flex; gap: .6rem;
  padding: 1rem 1.3rem;
  border-top: 1px solid var(--line);
  background: var(--page);
}

.chat-foot {
  margin-top: .9rem; font-size: .82rem; color: var(--ink-soft);
}

/* Typing indicator */
.chat-typing p::after {
  content: "…";
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots { 0% { opacity: .3 } 50% { opacity: 1 } 100% { opacity: .3 } }

/* ------------------------ About / steps -------------------------------- */

.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li {
  padding: .55rem 0 .55rem 1.5rem;
  border-bottom: 1px solid var(--line);
  position: relative; font-size: .94rem;
}
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 1.05rem;
  width: 8px; height: 8px; border-radius: 2px; background: var(--teal);
}
.feature-list li:last-child { border-bottom: 0; }

/* Numbered because these really are sequential steps. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.4rem 3rem;
  border-left: 2px solid var(--line);
  margin-left: .9rem;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: -1rem; top: -.15rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 700;
}
.steps p { color: var(--ink-soft); font-size: .9rem; margin: .2rem 0 0; }

/* ---------------------------- Footer ----------------------------------- */

.site-footer {
  background: var(--ink); color: #C7D6D3;
  padding: 2.75rem 0 2rem;
}
.footer-brand { font-weight: 700; color: #fff; font-size: 1.1rem; margin-bottom: .4rem; }
.footer-text { font-size: .87rem; margin-bottom: .8rem; }
.footer-text strong { color: #fff; }
.footer-meta { font-size: .8rem; color: #8FA5A1; margin: 0; }

/* --------------------------- Responsive -------------------------------- */

@media (max-width: 575.98px) {
  .hero { padding: 2.5rem 0; }
  .section { padding: 2.5rem 0; }
  .chat-msg { max-width: 95%; }
  .chat-form { flex-direction: column; }
  .stat-value { font-size: 1.5rem; }
}