/* =========================================================
   FAQ ACCORDION MODULE — stile moderno
   ========================================================= */

.faq-module {
  background: var(--faq-bg, #ffffff);
  color: var(--faq-text, #1f2937);
  padding: 40px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.faq-module__inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/* ---- Titolo sezione ---- */
.faq-module__title {
  margin: 0 0 36px;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  line-height: 1.15;
  font-weight: 700;
  color: var(--faq-text, #1f2937);
}

/* ---- Lista FAQ ---- */
.faq-list {
  display: flex;
  flex-direction: column;
  /* Reset lista HubSpot */
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---- Singolo item ---- */
.faq-item {
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
}

.faq-item:first-child {
  border-top: 1.5px solid rgba(0, 0, 0, 0.08);
}

/* ---- Pulsante trigger ---- */
.faq__trigger {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  cursor: pointer;
  color: var(--faq-text, #1f2937);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  font-family: inherit;
  transition: color 0.2s ease;
}

/* Domanda aperta: colore accento */
.faq-item.is-open .faq__trigger {
  color: var(--faq-accent, #2563eb);
}

.faq__trigger:focus-visible {
  outline: 2px solid var(--faq-accent, #2563eb);
  outline-offset: 4px;
  border-radius: 4px;
}

.faq__question-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---- Icona chevron ---- */
.faq__icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faq-text, #1f2937);
  opacity: 0.4;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.faq-item.is-open .faq__icon {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--faq-accent, #2563eb);
}

/* ---- Pannello risposta ---- */
.faq__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item:not(.is-open) .faq__panel {
  max-height: 0 !important;
}

.faq__answer-inner {
  /* Indent leggero per distinguere visivamente domanda e risposta */
  padding: 0 48px 24px 0;
  font-size: 0.9875rem;
  line-height: 1.75;
  color: color-mix(in srgb, var(--faq-text, #1f2937) 75%, transparent);
  background: var(--faq-answer-bg, transparent);
}

/* Fallback per browser che non supportano color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
  .faq__answer-inner {
    color: #4b5563;
  }
}

/* Reset tipografici HubSpot */
.faq__answer-inner > *:first-child { margin-top: 0; }
.faq__answer-inner > *:last-child  { margin-bottom: 0; }

.faq__answer-inner p {
  margin: 0 0 12px;
}

.faq__answer-inner a {
  color: var(--faq-accent, #2563eb);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.faq__answer-inner a:hover {
  text-decoration: none;
}

.faq__answer-inner ul,
.faq__answer-inner ol {
  padding-left: 1.25em;
  margin: 8px 0 12px;
}

.faq__answer-inner li + li {
  margin-top: 6px;
}

.faq__answer-inner strong {
  font-weight: 600;
  color: var(--faq-text, #1f2937);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .faq__panel,
  .faq__icon,
  .faq__trigger {
    transition: none;
  }
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
  .faq-module {
    padding: 28px 20px;
    border-radius: 12px;
  }

  .faq-module__inner {
    padding: 0;
  }

  .faq__trigger {
    padding: 18px 0;
    font-size: 1rem;
  }

  .faq__answer-inner,
  .faq__answer-inner p,
  .faq__answer-inner span,
  .faq__answer-inner li {
    font-size: 0.7rem !important;
  }
}