/*
 * FAQ остаётся нативным <details>, а высота анимируется через Web Animations API.
 * Это сохраняет доступность и даёт одинаково плавное поведение в Safari/iOS,
 * Chrome и Firefox без зависимости от interpolate-size.
 */

.faq-list {
  display: grid;
  gap: 12px;
  overflow-anchor: none;
}

.faq-item {
  overflow: clip;
  transition:
    border-color 260ms ease,
    background 260ms ease,
    box-shadow 260ms ease;
}

.faq-item.is-animating {
  will-change: height;
}

.faq-item[open] {
  border-color: rgba(54, 255, 147, .3);
  background: linear-gradient(180deg, rgba(54, 255, 147, .065), rgba(255, 255, 255, .02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 16px 48px rgba(0, 0, 0, .16);
}

.faq-item summary {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
  line-height: 1.35;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 220ms ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  color: #dcffeb;
}

.faq-item summary::after {
  content: "+";
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  background: transparent;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1;
  transform: rotate(0deg);
  transition:
    transform 340ms cubic-bezier(.22, 1, .36, 1),
    color 240ms ease,
    border-color 240ms ease,
    background-color 240ms ease;
}

.faq-item[open]:not(.is-closing) summary::after,
.faq-item.is-opening summary::after {
  transform: rotate(135deg);
  color: #06120b;
  border-color: var(--green);
  background-color: var(--green);
}

.faq-item.is-closing summary::after {
  transform: rotate(0deg);
  color: var(--green);
  border-color: var(--line);
  background-color: transparent;
}

.faq-answer {
  padding: 0 22px 22px;
  color: var(--soft);
  transform-origin: top;
}

.faq-answer p {
  margin: 0;
}

@media (max-width: 640px) {
  .faq-item {
    border-radius: 22px;
  }

  .faq-item summary {
    min-height: 62px;
    gap: 12px;
    padding: 16px 18px;
    font-size: .94rem;
  }

  .faq-item summary::after {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .faq-answer {
    padding: 0 18px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-item summary,
  .faq-item summary::after {
    transition: none !important;
  }
}
