/* ---------- FAQ page (layout primitives live in support.css) ---------- */

/* ---------- Search ---------- */

.faq-search {
  position: relative;
  max-width: 520px;
  margin-top: 34px;
}

.faq-search::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(255, 138, 76, 0.7), rgba(255, 183, 102, 0.15) 40%, rgba(84, 112, 255, 0.4));
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.4s ease;
}

.faq-search:focus-within::before {
  opacity: 0.55;
}

.faq-search-icon {
  position: absolute;
  z-index: 1;
  left: 20px;
  top: 50%;
  width: 19px;
  height: 19px;
  color: var(--s-faint);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 0.2s ease;
}

.faq-search input {
  width: 100%;
  height: 60px;
  padding: 0 64px 0 54px;
  border: 1px solid var(--s-hair-2);
  border-radius: 18px;
  background: rgba(12, 14, 21, 0.82);
  backdrop-filter: blur(14px);
  color: var(--s-ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.25s ease, background-color 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.faq-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.faq-search input::placeholder {
  color: rgba(141, 148, 167, 0.75);
}

.faq-search input:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.faq-search input:focus {
  outline: none;
  border-color: rgba(255, 138, 76, 0.65);
  background: rgba(12, 14, 21, 0.95);
}

.faq-search:focus-within .faq-search-icon {
  color: var(--orange);
}

.faq-search-kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--s-hair-2);
  border-bottom-width: 2px;
  border-radius: 7px;
  color: var(--s-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.faq-search:focus-within .faq-search-kbd,
.faq-search-clear:not([hidden]) ~ .faq-search-kbd {
  opacity: 0;
}

.faq-search-clear {
  position: absolute;
  z-index: 1;
  right: 14px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.faq-search-clear:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.faq-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.faq-suggest .s-mono {
  margin-right: 6px;
}

.faq-suggest button {
  padding: 6px 13px;
  border: 1px solid var(--s-hair);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--s-dim);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.3s var(--ease-out);
}

.faq-suggest button:hover {
  color: #fff;
  border-color: rgba(255, 138, 76, 0.45);
  background: rgba(255, 122, 69, 0.08);
  transform: translateY(-1px);
}

.faq-suggest button.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--accent-gradient);
}

.faq-suggest button:focus-visible,
.faq-expand:focus-visible {
  outline: 2px solid #ffb48a;
  outline-offset: 2px;
}

/* ---------- Hero stage chips ---------- */

.faq-chip-1 { top: 14%; left: 0; }
.faq-chip-2 { top: 34%; right: 0; }
.faq-chip-3 { bottom: 24%; left: 4%; }
.faq-chip-4 { bottom: 10%; right: 6%; }

/* ---------- Topic overview ---------- */

.faq-topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--s-hair-2);
  border-bottom: 1px solid var(--s-hair);
}

.faq-topic {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 30px 30px 26px;
  overflow: hidden;
  isolation: isolate;
  transition: background-color 0.4s ease;
}

.faq-topic + .faq-topic {
  border-left: 1px solid var(--s-hair);
}

.faq-topic::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 138, 76, 0.11), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.faq-topic::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}

.faq-topic:hover::before {
  opacity: 1;
}

.faq-topic:hover::after {
  transform: scaleX(1);
}

.faq-topic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.faq-topic:hover .s-icon {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 12px 26px -12px rgba(255, 86, 56, 0.9);
  transform: rotate(-6deg) scale(1.05);
}

.faq-topic strong {
  font-size: 1.14rem;
  letter-spacing: -0.01em;
}

.faq-topic-desc {
  color: var(--s-dim);
  font-size: 0.88rem;
  line-height: 1.7;
}

.faq-topic-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  color: var(--s-faint);
  font-size: 0.8rem;
}

.faq-topic-foot svg {
  width: 16px;
  height: 16px;
  transition: transform 0.4s var(--ease-out), color 0.3s ease;
}

.faq-topic:hover .faq-topic-foot svg {
  color: var(--orange);
  transform: translateY(3px);
}

.faq-topic:focus-visible {
  outline: 2px solid #ffb48a;
  outline-offset: -2px;
}

/* ---------- Question groups ---------- */

.faq-body {
  padding-top: 40px;
}

.faq-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-height: 40px;
  margin-bottom: 8px;
}

.faq-toolbar-label {
  margin-right: auto;
}

.faq-result {
  margin: 0 auto 0 0;
  color: var(--s-dim);
  font-size: 0.9rem;
  animation: faq-fade-in 0.35s var(--ease-out);
}

.faq-result:not([hidden]) + .faq-toolbar-label {
  display: none;
}

.faq-result strong {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.faq-expand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--s-hair);
  border-radius: 999px;
  background: transparent;
  color: var(--s-dim);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.faq-expand:hover {
  color: #fff;
  border-color: var(--s-hair-2);
}

.faq-expand svg {
  width: 14px;
  height: 14px;
  transition: transform 0.4s var(--ease-out);
}

.faq-expand[aria-pressed="true"] svg {
  transform: rotate(180deg);
}

.faq-group {
  display: grid;
  grid-template-columns: minmax(0, 0.36fr) minmax(0, 1fr);
  gap: 48px;
  padding: 56px 0;
  border-top: 1px solid var(--s-hair);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.faq-toolbar + .faq-group {
  border-top: 0;
  padding-top: 24px;
}

.faq-group-head {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  align-self: start;
}

.faq-group-head h2 {
  margin: 14px 0 12px;
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
  scroll-margin-top: calc(var(--header-height) + 40px);
}

.faq-group-head p {
  max-width: 300px;
  margin: 0;
  color: var(--s-dim);
  font-size: 0.92rem;
  line-height: 1.8;
}

/* ---------- Empty search state ---------- */

.faq-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 72px 24px;
  border-top: 1px solid var(--s-hair);
  text-align: center;
  animation: faq-fade-in 0.4s var(--ease-out);
}

.faq-empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border-radius: 50%;
  color: var(--s-dim);
  box-shadow: inset 0 0 0 1px var(--s-hair-2);
}

.faq-empty-icon svg {
  width: 24px;
  height: 24px;
}

.faq-empty strong {
  font-size: 1.1rem;
}

.faq-empty p {
  margin: 0 0 6px;
  color: var(--s-dim);
  font-size: 0.92rem;
}

@keyframes faq-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .faq-stage {
    max-width: 560px;
    width: 100%;
    margin-inline: auto;
  }

  .faq-group {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 44px 0;
  }

  .faq-group-head {
    position: static;
  }

  .faq-group-head p {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .faq-topics {
    grid-template-columns: 1fr;
  }

  .faq-topic {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 16px;
    padding: 20px 4px;
  }

  .faq-topic + .faq-topic {
    border-left: 0;
    border-top: 1px solid var(--s-hair);
  }

  .faq-topic-top {
    grid-row: span 2;
    margin: 0;
  }

  .faq-topic-top .s-mono {
    display: none;
  }

  .faq-topic-desc {
    grid-column: 2;
    font-size: 0.82rem;
  }

  .faq-topic-foot {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .faq-topic-foot > span {
    display: none;
  }
}

@media (max-width: 600px) {
  .faq-search input {
    height: 54px;
    font-size: 0.94rem;
  }

  .faq-search-kbd {
    display: none;
  }

  .faq-chip-1 { top: 6%; }
  .faq-chip-3 { bottom: 20%; left: 0; }
  .faq-chip-4 { bottom: 4%; right: 0; }
}
