/* Section 5: FAQs — Figma desktop 4506:5005 · laptop 4507:11414 · mobile 4507:11561
   Cùng component Figma với Round16 anti-leak (section-faq) — CSS port sang prefix fd-.

   section   1920 × 708 = 140 + list 428 (1 câu mở 203 + 3 × (24 + 51)) + 140
             mobile 390 × 936 = 140 + 40 + list 584 … — padding GIỮ 140 như hero
   faq       HORIZONTAL gap 40: title grow (680 / laptop 552) | list 680  · ≤1024 VERTICAL gap 40
   title     h2 48 (mobile 28), lh 55 / 32
   item      indicator 2 + 20 + câu hỏi h5 29 (mobile 2 dòng 46) = 51 / 68 · mở: + 20 + trả lời
   answer    description 16, dòng 22 (6 dòng = 132 ✓ Figma 4506:5005)
*/

.fd-section--faq {
	padding-block: var(--space-section-lg);
}

.fd-faq {
	display: flex;
	align-items: flex-start;
	gap: var(--var-40);
}

.fd-faq__title {
	flex: 1 1 0;
	min-width: 0;
}

.fd-faq__list {
	flex: 0 0 680px;
	max-width: 680px;
	display: flex;
	flex-direction: column;
	gap: var(--var-24);
}

.fd-faq__item {
	display: flex;
	flex-direction: column;
	gap: var(--var-20);
}

.fd-faq__indicator {
	display: block;
	height: 2px;
	background: var(--color-reverse-stroke);
	transition: background .3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Câu đang mở: vạch đổi thành dải gradient brand (#ff4e41 → #cc6af9) */
.fd-faq__item.is-open .fd-faq__indicator {
	background: var(--color-gradient-brand);
}

.fd-faq__question {
	margin: 0;
}

/* Figma div 4680:56349: HORIZONTAL gap 0, items-center — chữ grow + chevron 16 căn giữa dọc
   (câu 2 dòng ở mobile: chevron nằm giữa 2 dòng). */
.fd-faq__toggle {
	display: flex;
	align-items: center;
	gap: 0;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	line-height: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

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

.fd-faq__icon {
	flex: none;
	width: 16px;
	height: 16px;
	color: rgba(255, 255, 255, .8);
	transition: transform .3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.fd-faq__item.is-open .fd-faq__icon {
	transform: rotate(180deg);
}

.fd-faq__toggle:focus-visible {
	outline: 2px solid var(--color-2nd-brd);
	outline-offset: 4px;
	border-radius: 2px;
}

/* Đóng/mở bằng grid-template-rows → animation chiều cao không cần đo JS */
.fd-faq__answer {
	display: grid;
	grid-template-rows: 1fr;
	margin-top: 0;
	transition:
		grid-template-rows .38s cubic-bezier(0.22, 0.61, 0.36, 1),
		margin-top .38s cubic-bezier(0.22, 0.61, 0.36, 1),
		opacity .3s ease;
}

.fd-faq__answer[hidden] {
	display: grid;
	grid-template-rows: 0fr;
	/* Panel đóng cao 0 nhưng vẫn là flex item → gap 20 của item vẫn cộng vào câu đóng
	   (71 thay vì 51 Figma). Margin âm bằng đúng gap để huỷ. */
	margin-top: calc(var(--var-20) * -1);
	opacity: 0;
}

.fd-faq__answer-inner {
	min-height: 0;
	overflow: hidden;
}

.fd-faq__answer-inner > * {
	margin: 0;
}

/* Figma cách các khối bằng 1 dòng trống (= 1 dòng 22px) */
.fd-faq__answer-inner > * + * {
	margin-top: 22px;
}

/* Figma: list-decimal, mỗi mục lùi 24 (ms-[24px]) */
.fd-faq__steps {
	padding-left: 24px;
	list-style: decimal;
}

@media (max-width: 1024px) {
	.fd-faq {
		flex-direction: column;
		gap: var(--var-40);
	}

	.fd-faq__title {
		flex: none;
		width: 100%;
	}

	.fd-faq__list {
		flex: none;
		width: 100%;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fd-faq__answer,
	.fd-faq__indicator,
	.fd-faq__icon {
		transition: none;
	}
}
