/* ═══════════════════════════════════════════════════════════════
   RIVEL FAQ — Premium accordion with category filtering
   ═══════════════════════════════════════════════════════════════ */

:root {
  --rvq-bg: #000;
  --rvq-surface-1: rgba(255, 255, 255, 0.04);
  --rvq-surface-2: rgba(255, 255, 255, 0.06);
  --rvq-border: rgba(255, 255, 255, 0.08);
  --rvq-border-hover: rgba(255, 255, 255, 0.16);
  --rvq-border-active: rgba(131, 154, 255, 0.35);
  --rvq-text: #fff;
  --rvq-text-2: rgba(255, 255, 255, 0.8);
  --rvq-text-3: rgba(255, 255, 255, 0.55);
  --rvq-text-4: rgba(255, 255, 255, 0.35);
  --rvq-accent: #1c52ff;
}

/* ─── SECTION WRAPPER ─── */
.rv-faq-section {
  position: relative;
  background: var(--rvq-bg);
  color: var(--rvq-text);
  font-family: Geist, 'Space Grotesk', 'Manrope', sans-serif;
  padding: 6rem 1.5rem 5rem;
  overflow: hidden;
  isolation: isolate;
}
.rv-faq-section::before {
  content: '';
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: min(800px, 95vw);
  height: 800px;
  background: radial-gradient(circle at 50% 45%, rgba(28, 82, 255, 0.28) 0%, rgba(28, 82, 255, 0.06) 35%, transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.rv-faq-container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

/* ─── HEADER ─── */
.rv-faq-header {
  text-align: center;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.rv-faq-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--rvq-text);
  margin: 0.5rem 0 0;
  max-width: 20ch;
}
.rv-faq-subtitle {
  font-size: 1.0625rem;
  color: var(--rvq-text-3);
  font-weight: 400;
  line-height: 1.55;
  max-width: 34rem;
  margin: 0;
}

/* ─── CATEGORY TABS ─── */
.rv-faq-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  padding: 0.375rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100vw;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.rv-faq-tab {
  padding: 0.5rem 1.125rem;
  border-radius: 100vw;
  border: none;
  background: transparent;
  color: var(--rvq-text-3);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, background 0.25s ease;
  white-space: nowrap;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.rv-faq-tab:hover {
  color: var(--rvq-text);
}
.rv-faq-tab.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: #0a0a0a;
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.15);
}
.rv-faq-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.125rem;
  padding: 0 0.3125rem;
  margin-left: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--rvq-text-3);
  border-radius: 100vw;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.rv-faq-tab.is-active .rv-faq-tab-count {
  background: rgba(10, 10, 10, 0.1);
  color: rgba(10, 10, 10, 0.55);
}

/* ─── FAQ LIST ─── */
.rv-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 4.5rem;
}

/* ─── FAQ ITEM (accordion) ─── */
.rv-faq-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid var(--rvq-border);
  border-radius: 1.25rem;
  overflow: hidden;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.rv-faq-item:hover {
  border-color: var(--rvq-border-hover);
}
.rv-faq-item.is-open {
  border-color: var(--rvq-border-active);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(28, 82, 255, 0.025) 100%);
}
/* Hidden by category filter */
.rv-faq-item.is-hidden {
  display: none;
}

/* Trigger button */
.rv-faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.375rem 1.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--rvq-text);
  transition: color 0.2s ease;
}
.rv-faq-trigger:focus-visible {
  outline: 2px solid rgba(131, 154, 255, 0.6);
  outline-offset: -2px;
  border-radius: 1.25rem;
}

.rv-faq-question {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.4;
  margin: 0;
  color: var(--rvq-text);
  flex: 1;
}

/* +/- icon (plus sign that rotates to × on open) */
.rv-faq-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.rv-faq-icon::before,
.rv-faq-icon::after {
  content: '';
  position: absolute;
  background: var(--rvq-text-2);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}
.rv-faq-icon::before {
  width: 12px;
  height: 1.5px;
}
.rv-faq-icon::after {
  width: 1.5px;
  height: 12px;
}
.rv-faq-item.is-open .rv-faq-icon {
  background: linear-gradient(135deg, #c9aaff, #b3e2ff);
  border-color: transparent;
  transform: rotate(45deg);
}
.rv-faq-item.is-open .rv-faq-icon::before,
.rv-faq-item.is-open .rv-faq-icon::after {
  background: #0a0a0a;
}

/* Answer panel — uses grid-template-rows 0fr → 1fr for smooth height animation */
.rv-faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.rv-faq-item.is-open .rv-faq-panel {
  grid-template-rows: 1fr;
}
.rv-faq-panel-inner {
  overflow: hidden;
  min-height: 0;
}
.rv-faq-answer {
  padding: 0 1.75rem 1.625rem;
  font-size: 0.95rem;
  color: var(--rvq-text-3);
  line-height: 1.65;
  margin: 0;
  max-width: 68ch;
}
.rv-faq-answer a {
  color: var(--rvq-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.rv-faq-answer a:hover {
  border-color: var(--rvq-text);
}

/* ─── EMPTY STATE ─── */
.rv-faq-empty {
  padding: 4rem 2rem;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}
.rv-faq-empty-icon {
  font-size: 2rem;
  opacity: 0.3;
  margin-bottom: 0.75rem;
}
.rv-faq-empty-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--rvq-text-2);
  margin: 0 0 0.375rem;
}
.rv-faq-empty-desc {
  font-size: 0.925rem;
  color: var(--rvq-text-3);
  margin: 0;
}

/* ─── FINAL CTA (Didn't find your answer?) ─── */
.rv-faq-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.75rem 3rem;
  border-radius: 2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(28, 82, 255, 0.04) 50%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 20px 60px -20px rgba(28, 82, 255, 0.22);
}
.rv-faq-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(28, 82, 255, 0.12), transparent 60%);
  pointer-events: none;
}
.rv-faq-cta::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -15%;
  width: 50%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(201, 170, 255, 0.07), transparent 60%);
  pointer-events: none;
}
.rv-faq-cta-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.rv-faq-cta-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100vw;
  background: rgba(255, 255, 255, 0.08);
  color: var(--rvq-text-2);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.rv-faq-cta-title {
  font-size: clamp(1.375rem, 2.5vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--rvq-text);
  margin: 0;
  line-height: 1.2;
}
.rv-faq-cta-desc {
  font-size: 0.925rem;
  color: var(--rvq-text-3);
  line-height: 1.5;
  margin: 0;
  max-width: 30rem;
}
.rv-faq-cta-btn {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media screen and (max-width: 767px) {
  .rv-faq-section {
    padding: 4.5rem 1rem 4rem;
  }
  .rv-faq-header {
    margin-bottom: 2.5rem;
  }
  .rv-faq-section::before {
    top: -150px;
    width: 600px;
    height: 600px;
  }
  .rv-faq-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0.375rem 1rem;
    border-radius: 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
    width: auto;
  }
  .rv-faq-tabs::-webkit-scrollbar { display: none; }
  .rv-faq-tab {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .rv-faq-trigger {
    padding: 1.125rem 1.25rem;
    gap: 1rem;
  }
  .rv-faq-question {
    font-size: 0.975rem;
  }
  .rv-faq-answer {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.9rem;
  }
  .rv-faq-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.875rem;
    border-radius: 1.5rem;
  }
  .rv-faq-cta-btn {
    width: 100%;
  }
  .rv-faq-cta-btn .rv-cta {
    width: 100%;
    justify-content: center;
  }
}

/* Respect user's motion preference */
@media (prefers-reduced-motion: reduce) {
  .rv-faq-panel,
  .rv-faq-icon,
  .rv-faq-icon::before,
  .rv-faq-icon::after,
  .rv-faq-item {
    transition: none !important;
  }
}
