/* ============================================================
   TALVEX SYSTEMS — faq.css
   Page-specific styles for the FAQ + assistant page.
   Layers on top of styles.css and reuses its design tokens —
   no new colors or fonts introduced here.
   ============================================================ */

.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;
}

/* ---------- Page header (no video hero on this page) ---------- */
.faq-hero {
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 5vw, 4rem));
  padding-bottom: 0;
  background: var(--bg);
}
/* Pull the assistant up close to the page header (removes the large gap) */
.faq-hero .section__head { margin-bottom: 0; }
.faq-chat { padding-top: clamp(1.75rem, 4vw, 2.75rem); }
.faq-hero .section__title { margin-top: 0.6rem; }
.faq-hero__sub {
  margin-top: 1.1rem;
  max-width: 56ch;
  font-size: 1.05rem;
  color: var(--body);
}
.text-link-inline {
  color: var(--blue);
  border-bottom: 1px solid rgba(30, 80, 200, 0.35);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.text-link-inline:hover { color: var(--blue-bright); border-color: var(--blue-bright); }

/* ---------- Accordion ---------- */
.faq-list__inner { max-width: 760px; }

.accordion { display: flex; flex-direction: column; gap: 0.7rem; }

.accordion__item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.2rem clamp(1.1rem, 3vw, 1.5rem);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.accordion__item[open] {
  border-color: rgba(30, 80, 200, 0.35);
  box-shadow: var(--shadow-card);
}

.accordion__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.05rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.accordion__q::-webkit-details-marker { display: none; }

.accordion__icon {
  position: relative;
  flex: none;
  width: 18px; height: 18px;
}
.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  background: var(--blue);
  border-radius: 2px;
  transition: transform 0.25s var(--ease);
}
.accordion__icon::before { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
.accordion__icon::after  { top: 0; left: 50%; width: 2px; height: 100%; transform: translateX(-50%); }
.accordion__item[open] .accordion__icon::after { transform: translateX(-50%) scaleY(0); }

.accordion__a {
  padding-bottom: 1.2rem;
  padding-right: 1.6rem;
  color: var(--body);
  font-size: 0.98rem;
  line-height: 1.65;
}
.accordion__a p { margin: 0; }

/* ---------- Chat assistant ---------- */
.faq-chat .section__head--center { margin-bottom: 2.2rem; }

.chat-card {
  max-width: 640px;
  margin-inline: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.chat-card__log {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 320px;
  overflow-y: auto;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 84%;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.55;
}
.chat-msg p { margin: 0; }
.chat-msg p + p { margin-top: 0.5rem; }

.chat-msg--bot {
  align-self: flex-start;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.chat-msg--user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-card__form {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem clamp(1.1rem, 3vw, 1.6rem);
  border-top: 1px solid var(--line);
}
.chat-card__form input {
  flex: 1;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.2s var(--ease);
}
.chat-card__form input:focus-visible {
  outline: none;
  border-color: var(--blue);
}
.chat-card__form .btn { flex: none; }

.chat-card__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 clamp(1.1rem, 3vw, 1.6rem) 1.1rem;
}
.chip {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-light, #E9F0FC);
  border: 1px solid rgba(30, 80, 200, 0.18);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.chip:hover { background: #DCE7FB; transform: translateY(-1px); }

.faq-chat__fineprint {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}
.faq-chat__fineprint a { color: var(--blue); border-bottom: 1px solid rgba(30, 80, 200, 0.3); }
.faq-chat__fineprint a:hover { color: var(--blue-bright); }

/* Keyboard focus visibility on the accordion summary (native <details>) */
.accordion__q:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .chat-card__log { height: 280px; }
  .chat-msg { max-width: 90%; }
}
