/* ===================== SUPPORT — FAQ =====================
 * Ported from Sigrix_new/Site - FAQ.html. The shared `sx` design system
 * (tokens, buttons, container, eyebrow) lives in sx-home.css; this file adds
 * the FAQ-specific `.faq-*` layer (hero search, category rail, accordion, CTA).
 *
 * Theme convention: the live app is light-by-default (`.sx`) with dark
 * overrides under `[data-theme="dark"]`, the inverse of the standalone
 * prototype. Token-driven rules adapt automatically; the few hard-coded
 * gradient/highlight rules carry the light value as their base and move the
 * dark value into a `[data-theme="dark"]` override.
 *
 * The hero opts into full-bleed via the shared `.sx-bleed` utility class in
 * the template — the viewport breakout is declared only in sx-home.css. */

/* ---------- Hero ---------- */
.faq-hero { position: relative; overflow: hidden; padding: 64px 0 36px; }
.faq-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(820px 360px at 18% -10%, rgba(59,91,255,0.10), transparent 60%),
    radial-gradient(640px 320px at 92% 0%, rgba(20,184,166,0.06), transparent 60%);
  mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
}
[data-theme="dark"] .faq-hero-bg {
  background:
    radial-gradient(820px 360px at 18% -10%, rgba(91,124,255,0.16), transparent 60%),
    radial-gradient(640px 320px at 92% 0%, rgba(124,227,212,0.08), transparent 60%);
}
.faq-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(14,19,32,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14,19,32,0.045) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(640px 300px at 50% -10%, black, transparent 72%);
}
[data-theme="dark"] .faq-hero-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
}
.faq-hero-inner { position: relative; }
.faq-hero h1 {
  font-size: 52px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.04;
  max-width: 17ch; margin-top: 16px;
}
.faq-hero .lede { margin-top: 16px; font-size: 18px; color: var(--sx-text-2); max-width: 56ch; }

/* search */
.faq-search {
  margin-top: 28px; max-width: 560px;
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 8px 0 16px;
  background: var(--sx-surface); border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  transition: box-shadow 140ms ease;
}
.faq-search:focus-within { box-shadow: 0 0 0 1px var(--sx-brand) inset, 0 0 0 4px rgba(91,124,255,0.14); }
.faq-search > svg { color: var(--sx-text-3); flex-shrink: 0; }
.faq-search input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: 0;
  color: var(--sx-text); font: inherit; font-size: 15px;
}
.faq-search input::placeholder { color: var(--sx-text-3); }
.faq-search .clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--sx-r-md);
  color: var(--sx-text-3); background: transparent; border: 0; cursor: pointer;
}
.faq-search .clear:hover { color: var(--sx-text); background: var(--sx-surface-2); }
.faq-search .kbd {
  font-family: var(--sx-font-mono); font-size: 11px; color: var(--sx-text-3);
  padding: 4px 8px; border-radius: 6px; background: var(--sx-bg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.faq-resultcount {
  margin-top: 14px; font-size: 13px; color: var(--sx-text-3);
  font-family: var(--sx-font-mono); letter-spacing: -0.01em;
}

/* ---------- Body / layout ---------- */
.faq-body { padding: 8px 0 64px; }

/* Two-column (rail) layout */
.faq-layout--rail .faq-grid {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 64px; align-items: start;
}
.faq-rail { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
.faq-rail-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sx-text-3); font-weight: 600; padding: 0 12px 10px;
}
.faq-rail-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px; border-radius: var(--sx-r-md);
  font-size: 14px; font-weight: 500; color: var(--sx-text-2);
  cursor: pointer; transition: background 120ms, color 120ms;
  text-align: left; width: 100%; background: transparent; border: 0;
}
.faq-rail-item:hover { background: var(--sx-surface); color: var(--sx-text); }
.faq-rail-item.is-active { background: var(--sx-surface); color: var(--sx-text); box-shadow: 0 0 0 1px var(--sx-line) inset; }
.faq-rail-item .ico { color: var(--sx-text-3); flex-shrink: 0; display: inline-flex; }
.faq-rail-item.is-active .ico { color: var(--sx-brand-3); }
.faq-rail-item .ct {
  margin-left: auto; font-family: var(--sx-font-mono); font-size: 11px;
  color: var(--sx-text-3); font-variant-numeric: tabular-nums;
}
.faq-rail-foot {
  margin-top: 18px; padding: 14px; border-radius: var(--sx-r-lg);
  background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.faq-rail-foot .t { font-size: 13px; font-weight: 600; color: var(--sx-text); }
.faq-rail-foot .d { font-size: 12px; color: var(--sx-text-3); margin-top: 4px; line-height: 1.5; }
.faq-rail-foot a {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--sx-brand-3);
}
.faq-rail-foot a:hover { color: var(--sx-text); }

/* ---------- Category ---------- */
.faq-cat { scroll-margin-top: 88px; }
.faq-layout--rail .faq-cat + .faq-cat { margin-top: 48px; }
.faq-cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.faq-cat-ico {
  width: 34px; height: 34px; border-radius: var(--sx-r-md); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-brand-3);
}
.faq-cat-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.faq-cat-sub { font-size: 14px; color: var(--sx-text-3); margin: 0 0 14px; }
.faq-layout--rail .faq-cat-sub { margin-left: 46px; margin-top: -2px; }

/* ---------- Accordion item ---------- */
.faq-list { border-top: 1px solid var(--sx-line); }
.faq-item { border-bottom: 1px solid var(--sx-line); }
/* sx-home.css drops the last item's border for the home-page accordion; the
 * FAQ list is bordered top + every item bottom, so restore it here. */
.faq-list .faq-item:last-child { border-bottom: 1px solid var(--sx-line); }
.faq-q {
  width: 100%; display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 4px; text-align: left; cursor: pointer;
  background: transparent; border: 0; font-family: inherit;
  color: var(--sx-text); font-size: 16.5px; font-weight: 500;
  letter-spacing: -0.01em; line-height: 1.4;
  transition: color 120ms;
}
.faq-q:hover { color: var(--sx-brand-3); }
.faq-q .qtext { flex: 1; }
.faq-q .qmark {
  flex-shrink: 0; width: 26px; height: 26px; margin-top: -1px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text-2); transition: transform 260ms cubic-bezier(0.16,1,0.3,1), background 160ms, color 160ms;
}
.faq-item.is-open .faq-q { color: var(--sx-text); }
.faq-item.is-open .faq-q .qmark { transform: rotate(45deg); background: var(--sx-brand); color: #fff; box-shadow: 0 0 0 1px rgba(91,124,255,0.6) inset; }
.faq-a-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 280ms cubic-bezier(0.16,1,0.3,1); }
.faq-item.is-open .faq-a-wrap { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a {
  padding: 0 50px 22px 0; font-size: 15px; line-height: 1.65; color: var(--sx-text-2);
  max-width: 68ch;
}
.faq-a a { color: var(--sx-brand-3); font-weight: 500; }
.faq-a a:hover { color: var(--sx-text); text-decoration: underline; }
.faq-a strong { color: var(--sx-text); font-weight: 600; }
.faq-a .meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }

/* empty state */
.faq-empty { text-align: center; padding: 72px 24px; color: var(--sx-text-3); }
.faq-empty .e-ico {
  width: 48px; height: 48px; margin: 0 auto 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text-3);
}
.faq-empty .e-t { font-size: 17px; font-weight: 600; color: var(--sx-text); font-family: var(--sx-font-display); }
.faq-empty .e-d { font-size: 14px; margin-top: 6px; }

mark.faq-hl { background: rgba(59,91,255,0.18); color: inherit; border-radius: 3px; padding: 0 1px; }
[data-theme="dark"] mark.faq-hl { background: rgba(91,124,255,0.22); }

/* ---------- Bottom CTA ---------- */
.faq-cta {
  position: relative; overflow: hidden;
  margin: 8px 0 0; padding: 40px;
  border-radius: var(--sx-r-xl);
  background:
    radial-gradient(560px 220px at 0% 0%, rgba(59,91,255,0.10), transparent 62%),
    radial-gradient(420px 200px at 100% 100%, rgba(20,184,166,0.06), transparent 60%),
    var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: center;
}
[data-theme="dark"] .faq-cta {
  background:
    radial-gradient(560px 220px at 0% 0%, rgba(91,124,255,0.16), transparent 62%),
    radial-gradient(420px 200px at 100% 100%, rgba(124,227,212,0.08), transparent 60%),
    var(--sx-surface);
}
.faq-cta h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; max-width: 18ch; }
.faq-cta p { margin-top: 10px; font-size: 15px; color: var(--sx-text-2); max-width: 46ch; }
.faq-cta-actions { display: flex; flex-direction: column; gap: 10px; }
.faq-cta-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--sx-r-lg);
  background: var(--sx-bg); box-shadow: 0 0 0 1px var(--sx-line) inset;
  transition: box-shadow 140ms, transform 140ms, background 140ms;
}
.faq-cta-card:hover { box-shadow: 0 0 0 1px var(--sx-line-2) inset; transform: translateY(-1px); }
.faq-cta-card .c-ico {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--sx-r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sx-surface); box-shadow: 0 0 0 1px var(--sx-line) inset; color: var(--sx-brand-3);
}
.faq-cta-card .c-t { font-size: 14px; font-weight: 600; color: var(--sx-text); }
.faq-cta-card .c-d { font-size: 12.5px; color: var(--sx-text-3); margin-top: 2px; }
.faq-cta-card .c-arrow { margin-left: auto; color: var(--sx-text-3); flex-shrink: 0; }
.faq-cta-card:hover .c-arrow { color: var(--sx-text); }

@media (max-width: 920px) {
  .faq-layout--rail .faq-grid { grid-template-columns: 1fr; gap: 8px; }
  .faq-rail { position: static; flex-direction: row; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
  .faq-rail-label, .faq-rail-foot { display: none; }
  .faq-rail-item { width: auto; box-shadow: 0 0 0 1px var(--sx-line) inset; }
  .faq-rail-item .ct { display: none; }
  .faq-cta { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .faq-hero h1 { font-size: 38px; }
  .faq-hero { padding: 40px 0 28px; }
  .faq-cta { padding: 28px; }
}
