/* FAQ page — extends styles.css design system.
   Brand tokens: teal #0D9488, navy #0F172A, amber #F59E0B, ink #1E293B.
   Font: Plus Jakarta Sans. Wrap max-width: 1180px. */

/* FAQ Hero */
.faq-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #042F2E 0%, #0F766E 45%, var(--teal) 100%);
  color: #fff;
  padding: 56px 0 40px;
  text-align: center;
}
.faq-hero::before {
  content: "";
  position: absolute;
  right: -120px;
  top: -80px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  pointer-events: none;
}
.faq-hero .wrap { position: relative; }
.faq-hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 .5rem;
}
.faq-hero .sub {
  font-size: 1.05rem;
  opacity: .9;
  max-width: 600px;
  margin: 0 auto 1.6rem;
}

/* Search bar */
.faq-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.faq-search input {
  width: 100%;
  padding: .9rem 1rem .9rem 2.8rem;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  backdrop-filter: blur(8px);
}
.faq-search input::placeholder { color: rgba(255,255,255,.6); }
.faq-search input:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255,255,255,.2);
}
.faq-search .search-icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,.7);
  pointer-events: none;
}
.faq-search .clear-btn {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: 0;
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: .9rem;
  display: none;
  align-items: center;
  justify-content: center;
}
.faq-search .clear-btn.visible { display: inline-flex; }
.faq-search .clear-btn:hover { background: rgba(255,255,255,.3); }

/* Sticky role tabs */
.faq-tabs-wrap {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
}
.faq-tabs {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding: .8rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.faq-tabs::-webkit-scrollbar { display: none; }
.faq-tab {
  flex-shrink: 0;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: .88rem;
  color: var(--ink);
  white-space: nowrap;
  transition: .15s;
}
.faq-tab:hover { border-color: var(--teal); color: var(--teal); }
.faq-tab.active { background: var(--teal); color: #fff; border-color: var(--teal); }

/* Content area */
.faq-content { padding: 2rem 0 4rem; }
.faq-count {
  font-size: .85rem;
  color: var(--ink-500);
  margin-bottom: 1rem;
}

/* Accordion */
.faq-list { display: flex; flex-direction: column; gap: .8rem; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow .2s;
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-item[open] { box-shadow: 0 2px 12px rgba(15,23,42,.08); }
.faq-summary {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1.1rem 1.3rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  list-style: none;
  user-select: none;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::marker { display: none; }
.faq-summary .faq-chevron {
  margin-left: auto;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--ink-500);
  transition: transform .25s ease;
}
.faq-item[open] .faq-summary .faq-chevron { transform: rotate(180deg); color: var(--teal); }
.faq-summary .role-badge {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.role-badge.universal { background: #EEF2FF; color: #4338CA; }
.role-badge.patient { background: #F0FDFA; color: #0F766E; }
.role-badge.doctor { background: #FEF3C7; color: #92400E; }
.role-badge.pharmacy_staff { background: #EDE9FE; color: #6D28D9; }
.role-badge.diagnostic { background: #FFE4E6; color: #BE123C; }

/* Answer body */
.faq-answer {
  padding: 0 1.3rem 1.3rem;
  border-top: 1px solid #f1f5f9;
}
.faq-answer-text {
  color: var(--ink);
  line-height: 1.65;
  margin: .8rem 0 1rem;
}
.faq-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  counter-reset: step;
}
.faq-steps li {
  position: relative;
  padding: .5rem 0 .5rem 2rem;
  border-bottom: 1px solid #f8fafc;
  font-size: .93rem;
  color: var(--ink);
}
.faq-steps li:last-child { border-bottom: 0; }
.faq-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: .45rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-50);
  color: var(--teal);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Screenshots */
.faq-screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .8rem;
  margin: 1rem 0;
}
.faq-screenshot {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--slate);
}
.faq-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform .2s;
}
.faq-screenshot img:hover { transform: scale(1.01); }
.faq-screenshot-label {
  font-size: .75rem;
  color: var(--ink-500);
  padding: .4rem .8rem;
  text-align: center;
}

/* Action link */
.faq-action {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .5rem;
  padding: .55rem 1rem;
  border-radius: 8px;
  background: var(--teal-50);
  color: var(--teal-dark);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: .15s;
}
.faq-action:hover { background: #ccfbf1; }

/* No matches */
.faq-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-500);
}
.faq-empty svg { width: 48px; height: 48px; color: var(--line); margin-bottom: .8rem; }

/* Back to top */
.faq-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(13,148,136,.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 60;
}
.faq-top-btn.visible { opacity: 1; pointer-events: auto; }
.faq-top-btn:hover { background: var(--teal-dark); }

/* Lightbox */
.faq-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.faq-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* Responsive */
@media (max-width: 860px) {
  .faq-hero { padding: 40px 0 30px; }
  .faq-tabs-wrap { top: 56px; }
  .faq-summary { padding: .9rem 1rem; font-size: .93rem; }
  .faq-answer { padding: 0 1rem 1rem; }
}
@media (max-width: 480px) {
  .faq-tab { padding: .45rem .9rem; font-size: .82rem; }
  .faq-summary { gap: .5rem; }
  .faq-summary .role-badge { font-size: .65rem; padding: .15rem .45rem; }
}
