/* Theme tokens */
:root {
  --text-900: #1a202c;
  --text-700: #2d3748;
  --text-600: #4a5568;
  --text-500: #718096;

  --border-200: #e2e8f0;
  --bg-page: #f7fafc;
  --bg-white: #ffffff;

  /* Brand header color (can stay red) */
  --brand-800: #991B1B;
  --brand-700: #B91C1C;
  --brand-600: #DC2626;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-700);
  background-color: var(--bg-page);
}

.container { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }

/* Header (brand red) */
.header { text-align: center; margin-bottom: 50px; }
.header-subtitle {
  font-size: 0.95rem; color: var(--text-500);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; font-weight: 600;
}
.header-title {
  font-size: 2.5rem; color: var(--brand-700); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em;
}
.header::after {
  content: ""; display: block; width: 88px; height: 4px; margin: 16px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-800));
}

/* Category tabs */
.faq-categories {
  display: flex; justify-content: center; gap: 10px; margin-bottom: 50px; flex-wrap: wrap;
}

.category-btn {
  /* Base color var (set per-button via JS) */
  --c: var(--text-700);
  --c-50: color-mix(in srgb, var(--c) 12%, #fff);
  --c-200: color-mix(in srgb, var(--c) 28%, #fff);
  --c-300: color-mix(in srgb, var(--c) 38%, #fff);
  --c-800: color-mix(in srgb, var(--c) 85%, #000 15%);

  padding: 10px 24px;
  border: 2px solid var(--c-200);
  background-color: var(--bg-white);
  color: var(--c);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.06s ease;
  white-space: nowrap;
}
.category-btn:hover {
  background-color: var(--c-50);
  border-color: var(--c-300);
  color: var(--c-800);
  transform: translateY(-1px);
}
.category-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.category-btn.active {
  background-color: var(--c);
  color: #fff;
  border-color: var(--c);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 28%, transparent);
  transform: translateY(-1px);
}

/* Sections */
.faq-content { margin-bottom: 50px; }
.category { margin-bottom: 40px; }
.category.hidden { display: none; }

/* Per-category theme via CSS vars */
.category {
  /* Base color var (set per-category via JS). Defaults to brand red */
  --c: var(--brand-700);
  --c-50:  color-mix(in srgb, var(--c) 10%, #fff);
  --c-100: color-mix(in srgb, var(--c) 18%, #fff);
  --c-200: color-mix(in srgb, var(--c) 28%, #fff);
  --c-300: color-mix(in srgb, var(--c) 38%, #fff);
  --c-600: color-mix(in srgb, var(--c) 92%, #000 8%);
  --c-700: var(--c);
  --c-800: color-mix(in srgb, var(--c) 85%, #000 15%);
}

.category-title {
  font-size: 1.5rem;
  color: var(--c-700);
  font-weight: 800;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--c-200);
}

.faq-item {
  background-color: var(--bg-white);
  border: 1px solid var(--border-200);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.faq-item:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }

.faq-question {
  padding: 20px 24px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-weight: 700; color: var(--text-700); outline: none;
}
.faq-question:hover { background-color: #fafafa; }

.faq-item.active {
  border-color: var(--c-300);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--c) 20%, transparent);
}
.faq-item.active::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 4px;
  background: linear-gradient(180deg, var(--c-600), var(--c-800));
}
.faq-item.active .faq-question { background: var(--c-50); color: var(--c-800); }

.faq-toggle {
  font-size: 1.5rem; color: var(--text-500); font-weight: 400; transition: color 0.2s ease;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; user-select: none;
  flex-shrink: 0; margin-left: 20px;
}
.faq-item.active .faq-toggle { color: var(--c-700); }

/* Answer panel (JS sets max-height) */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
  background: var(--c-50);
  border-top: 1px solid var(--c-100);
}
.faq-answer p { padding: 14px 24px 18px 24px; color: var(--text-600); line-height: 1.8; font-size: 15.5px; }
.faq-answer p + p { margin-top: 8px; }
.faq-answer a { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(0,0,0,0.2); }
.faq-answer a:hover { text-decoration: underline; }

/* Contact */
.faq-contact {
  text-align: center; padding: 48px; background-color: var(--bg-white); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); border: 1px solid var(--border-200);
}
.faq-contact h2 { font-size: 1.75rem; margin-bottom: 12px; color: var(--text-900); font-weight: 800; }
.faq-contact p { color: var(--text-500); margin-bottom: 24px; font-size: 16px; }
.contact-btn {
  display: inline-block; padding: 12px 32px; background-color: var(--brand-700); color: white; text-decoration: none;
  border-radius: 10px; font-weight: 700; font-size: 15px; transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.contact-btn:hover { background-color: var(--brand-800); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(185, 28, 28, 0.22); }
.contact-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.2); }

/* Responsive */
@media (max-width: 768px) {
  .header-title { font-size: 2rem; }
  .faq-question { padding: 18px 20px; }
  .faq-answer p { padding: 12px 20px 16px 20px; }
  .category-title { font-size: 1.25rem; }
  .contact-btn { width: 100%; }
}
@media (max-width: 480px) { .category-btn { width: 100%; } }