:root {
    --primary: #212529;
    --primary-hover: #000000;
    --primary-light: #f1f3f5;
    --dark: #111827;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --border-color: #e2e8f0;
  }

  body {
    background-color: #f8fafc !important;
    color: #334155;
  }

  /* Guest Navbar Customization */
  .guest-navbar {
    background-color: #212529;
  }

  .btn-primary-clip {
    background-color: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .btn-primary-clip:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 37, 41, 0.2);
  }

  .btn-outline-clip {
    border: 1px solid var(--border-color);
    color: #475569;
    font-weight: 600;
    transition: all 0.2s ease;
  }

  .btn-outline-clip:hover {
    background-color: #f1f5f9;
    color: var(--dark);
  }

  /* Search & Hero Header */
  .faq-header {
    background: radial-gradient(circle at 10% 20%, rgb(248, 249, 250) 0%, rgb(255, 255, 255) 90%);
    border-bottom: 1px solid var(--border-color);
    padding: 60px 0;
    position: relative;
    /* overflow must stay visible so the search dropdown can extend past the header */
    z-index: 10;
  }

  /* Decorative circle lives in its own clipped layer so it can never widen
     the page; the header itself must stay overflow-visible for the search dropdown. */
  .faq-header-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .faq-header-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(33, 37, 41, 0.04) 0%, transparent 70%);
    border-radius: 50%;
  }

  .faq-header .container {
    position: relative;
  }

  .search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
  }

  .search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  }

  .search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(33, 37, 41, 0.1), 0 4px 6px -4px rgba(33, 37, 41, 0.1);
  }

  .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.25rem;
  }

  .faq-title {
    font-size: 2.75rem;
    letter-spacing: -0.5px;
  }

  /* Search results dropdown */
  .search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    text-align: left;
  }

  .search-result-item {
    display: block;
    width: 100%;
    padding: 12px 18px;
    cursor: pointer;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    text-align: left;
  }

  .search-result-item:last-child {
    border-bottom: none;
  }

  .search-result-item:hover,
  .search-result-item.focused {
    background-color: #f1f5f9;
  }

  .search-result-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
  }

  .search-result-q {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
    margin-bottom: 2px;
  }

  .search-result-blurb {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 0;
  }

  .search-result-blurb mark,
  .search-result-q mark {
    background-color: rgba(253, 224, 71, 0.55);
    padding: 0 1px;
    border-radius: 2px;
  }

  .search-no-results {
    padding: 16px 18px;
    color: #64748b;
    font-size: 0.85rem;
  }

  /* Scroll target + landing highlight for items opened from search */
  .faq-item {
    scroll-margin-top: 90px;
  }

  .faq-item.flash-highlight {
    animation: flash-border 1.6s ease-out;
  }

  @keyframes flash-border {
    0%, 40% { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.12); }
    100% { border-color: var(--border-color); box-shadow: none; }
  }

  @media (max-width: 768px) {
    .faq-header {
      padding: 28px 0;
    }
    .faq-title {
      font-size: 1.9rem;
    }
    .faq-header .fs-5 {
      font-size: 1rem !important;
    }
  }

  /* Keeps scrolled-to results clear of the sticky navbar */
  #faqAccordionContainer {
    scroll-margin-top: 84px;
  }

  /* Navigation Pills for Categories */
  .category-pill {
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: #475569;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .category-pill:hover, .category-pill.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(33, 37, 41, 0.15);
  }

  /* FAQ Accordion Styling */
  .faq-accordion .accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 12px !important;
    margin-bottom: 16px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
  }

  .faq-accordion .accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
  }

  .faq-accordion .accordion-button {
    font-weight: 600;
    color: var(--dark);
    font-size: 1.05rem;
    padding: 20px;
    background-color: #ffffff;
    border: none;
    box-shadow: none !important;
    transition: all 0.2s ease;
  }

  .faq-accordion .accordion-button:not(.collapsed) {
    color: var(--primary);
    background-color: rgba(33, 37, 41, 0.02);
    border-bottom: 1px solid var(--border-color);
  }

  .faq-accordion .accordion-button::after {
    background-size: 1rem;
    transition: transform 0.2s ease;
  }

  .faq-accordion .accordion-body {
    padding: 20px;
    line-height: 1.6;
    color: #475569;
    background-color: #fafbfd;
  }

  .category-title {
    font-weight: 700;
    color: var(--dark);
    margin-top: 30px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
  }

  .empty-state {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
  }

  /* Micro-animations */
  .pulse-icon {
    animation: slow-pulse 2s infinite ease-in-out;
  }

  @keyframes slow-pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
  }
