/* ============================================================
   FAQ / Guide interactif — Permatheque
   ============================================================ */

/* ------------------------------------------------------------
   Root wrapper
   ------------------------------------------------------------ */
.page-faq-guide {
  font-family: inherit;
  color: #333;
}

.faq-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.faq-hero {
  background: linear-gradient(135deg, #A8BBA3 0%, #8fa889 60%, #7a9874 100%);
  padding: 3rem 0;
  margin-bottom: 0;
  text-align: center;
  color: #fff;
}

.faq-hero .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.faq-hero__title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.faq-hero__subtitle {
  font-size: 1.05rem;
  margin: 0;
  opacity: 0.9;
}

/* ------------------------------------------------------------
   Tab navigation
   ------------------------------------------------------------ */
.faq-tabs-wrapper {
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 2rem;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.faq-tabs-wrapper .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.faq-tabs {
  display: flex;
  gap: 0;
}

.faq-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.faq-tab:hover {
  color: #8fa889;
}

.faq-tab--active {
  color: #5a7a55;
  border-bottom-color: #8fa889;
  font-weight: 600;
}

/* ------------------------------------------------------------
   Tab panels
   ------------------------------------------------------------ */
.faq-panel {
  display: block;
}

.faq-panel[hidden] {
  display: none;
}

/* Legacy active class (kept for JS compatibility) */
.faq-panel--active {
  display: block;
}

.faq-panel__header {
  margin-bottom: 1.5rem;
}

.faq-panel__header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem;
}

.faq-panel__header p {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

/* ------------------------------------------------------------
   FAQ Accordion list wrapper
   ------------------------------------------------------------ */
.faq-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ------------------------------------------------------------
   FAQ Accordion item  (article.faq-accordion)
   ------------------------------------------------------------ */
.faq-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}

.faq-accordion:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.faq-accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.faq-accordion__trigger:hover {
  background: #f9fafb;
  color: #5a7a55;
}

.faq-accordion__trigger[aria-expanded="true"] {
  background: #f0f5ef;
  color: #5a7a55;
}

.faq-accordion__question {
  flex: 1;
}

/* Arrow icon */
.faq-accordion__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
  color: #6b7280;
}

.faq-accordion__trigger[aria-expanded="true"] .faq-accordion__icon {
  transform: rotate(180deg);
  color: #5a7a55;
}

.faq-accordion__body {
  overflow: hidden;
  padding: 0 1.25rem;
}

.faq-accordion__body[hidden] {
  display: none;
}

.faq-accordion__body:not([hidden]) {
  padding: 0 1.25rem 1.25rem;
}

.faq-accordion__content p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #4b5563;
}

.faq-accordion__content p:first-child {
  margin-top: 0;
}

.faq-accordion__content ul,
.faq-accordion__content ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #4b5563;
}

.faq-accordion__content a {
  color: #5a7a55;
  text-decoration: underline;
}

.faq-accordion__content a:hover {
  color: #3d5c39;
}

/* ------------------------------------------------------------
   Guide — Step structure
   ------------------------------------------------------------ */
.guide-step {
  margin-bottom: 2.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.guide-step__badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #A8BBA3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.guide-step__number {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.guide-step__body {
  flex: 1;
  min-width: 0;
}

.guide-step__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.35rem;
}

.guide-step__text {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.65;
  margin: 0 0 1.25rem;
}

/* Step-specific layout variants (profiles and sections steps use default layout) */
.guide-step--profiles,
.guide-step--sections {
  /* inherits default .guide-step layout */
}

/* Intro step callout box */
.guide-step--intro .guide-step__body {
  background: #f0f5ef;
  border-left: 4px solid #A8BBA3;
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
}

.guide-step--intro .guide-step__title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.guide-step--intro .guide-step__text {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.7;
}

/* ------------------------------------------------------------
   Guide — Profile cards
   ------------------------------------------------------------ */
.guide-profiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.guide-profile-card {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  user-select: none;
  display: block;
}

.guide-profile-card:hover {
  border-color: #A8BBA3;
  box-shadow: 0 4px 12px rgba(168, 187, 163, 0.2);
  transform: translateY(-2px);
}

.guide-profile-card--active {
  border-color: #5a7a55;
  background: #f0f5ef;
  box-shadow: 0 4px 16px rgba(90, 122, 85, 0.15);
}

.guide-profile-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.guide-profile-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.guide-profile-card__icon {
  font-size: 2rem;
  display: block;
  color: #5a7a55;
}

.guide-profile-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.3rem;
  display: block;
}

.guide-profile-card__desc {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
  display: block;
}

.guide-profile-card--active .guide-profile-card__name {
  color: #3d5c39;
}

/* ------------------------------------------------------------
   Guide — Progress bar
   ------------------------------------------------------------ */
.guide-progress {
  margin-bottom: 1.5rem;
}

.guide-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.guide-progress__label {
  font-size: 0.82rem;
  color: #6b7280;
}

.guide-progress__count {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.guide-progress__bar-track {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.guide-progress__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #A8BBA3, #5a7a55);
  border-radius: 999px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ------------------------------------------------------------
   Guide — No sections placeholder
   ------------------------------------------------------------ */
.guide-no-sections {
  text-align: center;
  padding: 3rem 2rem;
  color: #9ca3af;
  font-size: 0.95rem;
}

.guide-no-sections[hidden] {
  display: none;
}

/* ------------------------------------------------------------
   Guide — Sections list
   ------------------------------------------------------------ */
.guide-sections-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guide-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.guide-section[hidden] {
  display: none;
}

.guide-section:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.guide-section--read {
  border-color: #d1fae5;
  background: #f9fefb;
}

.guide-section--read .guide-section__trigger {
  opacity: 0.85;
}

/* Section header row: wraps trigger button + read label */
.guide-section__header {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
}

/* The clickable button that expands/collapses */
.guide-section__trigger {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
  min-width: 0;
}

.guide-section__trigger:hover {
  background: #f9fafb;
}

.guide-section__trigger[aria-expanded="true"] {
  background: #f0f5ef;
}

/* Icon wrap (replaces __number in old CSS) */
.guide-section__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  font-size: 0.85rem;
  color: #6b7280;
}

.guide-section--read .guide-section__icon-wrap {
  background: #d1fae5;
  color: #059669;
}

.guide-section__title {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  min-width: 0;
}

.guide-section__chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: transform 0.25s ease;
}

.guide-section__trigger[aria-expanded="true"] .guide-section__chevron {
  transform: rotate(180deg);
  color: #5a7a55;
}

/* Read indicator (checkbox + icon, inline in header) */
.guide-section__read-label {
  display: flex;
  align-items: center;
  padding: 0.9rem 1rem 0.9rem 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
}

.guide-section__read-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.guide-section__read-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  color: transparent;
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.guide-section__read-label:hover .guide-section__read-indicator {
  border-color: #A8BBA3;
  color: #A8BBA3;
}

.guide-section__read-checkbox:checked ~ .guide-section__read-indicator,
.guide-section--read .guide-section__read-indicator {
  border-color: #059669;
  background: #d1fae5;
  color: #059669;
}

.guide-section--read .guide-section__read-label {
  /* keep visible but styled for read state */
}

/* Section body */
.guide-section__body {
  overflow: hidden;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.guide-section__body[hidden] {
  display: none;
}

.guide-section__desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #4b5563;
  margin: 0 0 0.75rem;
}

/* ------------------------------------------------------------
   Guide — Feature list  (.guide-section__features)
   ------------------------------------------------------------ */
.guide-section__features {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.guide-section__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.87rem;
  line-height: 1.5;
  color: #4b5563;
  margin: 0;
}

.guide-section__features li::before {
  content: '✓';
  flex-shrink: 0;
  color: #5a7a55;
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 0.15em;
}

/* ------------------------------------------------------------
   Guide — Role tags  (.guide-section__roles)
   ------------------------------------------------------------ */
.guide-section__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

/* ------------------------------------------------------------
   Role tag pills
   ------------------------------------------------------------ */
.guide-role-tag {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-transform: lowercase;
}

.guide-role-tag--public {
  background: #dcfce7;
  color: #16a34a;
}

.guide-role-tag--membre {
  background: #dbeafe;
  color: #2563eb;
}

.guide-role-tag--vendeur {
  background: #ede9fe;
  color: #7c3aed;
}

.guide-role-tag--moderateur {
  background: #fef3c7;
  color: #d97706;
}

.guide-role-tag--admin {
  background: #fee2e2;
  color: #dc2626;
}

.guide-role-tag--superadmin {
  background: #e0e7ff;
  color: #1e1b4b;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 700px) {
  .faq-hero {
    padding: 2rem 0;
  }

  .faq-hero__title {
    font-size: 1.5rem;
  }

  .guide-profiles {
    grid-template-columns: 1fr;
  }

  .guide-profile-card {
    padding: 0.9rem 1rem;
  }

  .guide-profile-card__inner {
    flex-direction: row;
    text-align: left;
    gap: 1rem;
  }

  .guide-profile-card__icon {
    font-size: 1.6rem;
    flex-shrink: 0;
  }

  .faq-tab {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }

  .guide-section__trigger {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .guide-section__roles {
    order: 3;
    flex-basis: 100%;
    padding-left: 36px;
  }
}

@media (max-width: 480px) {
  .faq-content {
    padding: 0 0.75rem 3rem;
  }

  .guide-section__body {
    padding: 0 0.9rem 1rem;
  }

  .guide-section__trigger {
    padding: 0.85rem 0.9rem;
  }

  .faq-accordion__trigger {
    padding: 0.9rem 1rem;
    font-size: 0.88rem;
  }
}
