/* FAQ — fixed split layout; only the question list scrolls inside the right panel */

html:has(body.faq-page),
body.faq-page {
	height: 100%;
	overflow: hidden;
}

.faq-page {
	scrollbar-gutter: stable;
}

.faq-page .signup-page {
	height: 100vh;
	max-height: 100vh;
	min-height: 0;
	overflow: hidden;
	align-items: stretch;
}

.faq-page .branding-panel {
	position: relative;
	top: auto;
	height: 100%;
	max-height: 100vh;
	min-height: 0;
	align-self: stretch;
	animation: faqPanelIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.faq-page .branding-content {
	min-height: 100%;
	height: 100%;
}

.faq-page .form-panel.faq-panel {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	height: 100%;
	max-height: 100vh;
	min-height: 0;
	padding: 0;
	background: #ffffff;
	overflow: hidden;
	animation: faqPanelIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.faq-card {
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: clamp(32px, 4vw, 48px) clamp(28px, 4vw, 56px) clamp(24px, 3vw, 32px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.faq-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: clamp(20px, 2.5vw, 28px);
	flex-shrink: 0;
	animation: faqFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.faq-card__header h2 {
	margin: 0;
	flex: 1;
	font-size: clamp(1.85rem, 2.8vw, 2.35rem);
	font-weight: 800;
	color: #33489f;
	line-height: 1.12;
	letter-spacing: -0.02em;
}

.faq-back-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 6px;
	background: #1e2a78;
	color: #ffffff;
	text-decoration: none;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.faq-back-btn:hover {
	background: #27348f;
	transform: translateX(-2px);
}

.faq-back-btn:active {
	transform: translateX(0);
}

.faq-back-btn svg {
	width: 18px;
	height: 18px;
}

/* Scroll lives here only — header stays fixed above */
.faq-accordion {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: rgba(51, 72, 159, 0.32) transparent;
	padding-right: 4px;
}

.faq-accordion::-webkit-scrollbar {
	width: 8px;
}

.faq-accordion::-webkit-scrollbar-track {
	background: transparent;
}

.faq-accordion::-webkit-scrollbar-thumb {
	background: rgba(51, 72, 159, 0.24);
	border-radius: 999px;
}

.faq-accordion::-webkit-scrollbar-thumb:hover {
	background: rgba(51, 72, 159, 0.38);
}

.faq-item {
	border-bottom: 1px solid #d8deec;
	opacity: 0;
	transform: translateY(12px);
	animation: faqFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.faq-item:nth-child(1) { animation-delay: 0.22s; }
.faq-item:nth-child(2) { animation-delay: 0.28s; }
.faq-item:nth-child(3) { animation-delay: 0.34s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.46s; }
.faq-item:nth-child(6) { animation-delay: 0.52s; }
.faq-item:nth-child(7) { animation-delay: 0.58s; }
.faq-item:nth-child(8) { animation-delay: 0.64s; }

.faq-item:first-child {
	border-top: 1px solid #d8deec;
}

.faq-item__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	width: 100%;
	padding: clamp(18px, 2vw, 22px) 4px;
	border: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	font-size: clamp(0.98rem, 1.35vw, 1.08rem);
	font-weight: 600;
	color: #33489f;
	line-height: 1.45;
	text-align: left;
	user-select: none;
	transition: color 0.18s ease;
}

.faq-item__question:hover {
	color: #1e2a78;
}

.faq-item__question:focus-visible {
	outline: 2px solid #5a73d8;
	outline-offset: 3px;
	border-radius: 6px;
}

.faq-item__question span {
	flex: 1;
	padding-right: 8px;
}

.faq-item__chevron {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	color: #33489f;
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item.is-open .faq-item__chevron {
	transform: rotate(180deg);
}

/* grid 0fr→1fr animates height reliably (unlike height:auto) */
.faq-item__answer {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition:
		grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.24s ease;
}

.faq-item.is-open .faq-item__answer {
	grid-template-rows: 1fr;
	opacity: 1;
}

.faq-item__answer-inner {
	min-height: 0;
	overflow: hidden;
}

.faq-item__answer-inner p {
	margin: 0;
	padding: 0 0 clamp(18px, 2.2vw, 22px);
	color: #5c6480;
	font-size: clamp(0.92rem, 1.2vw, 1rem);
	line-height: 1.75;
	max-width: 720px;
}

@keyframes faqPanelIn {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes faqFadeUp {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 980px) {
	html:has(body.faq-page),
	body.faq-page {
		height: auto;
		overflow: auto;
	}

	.faq-page .signup-page {
		height: auto;
		max-height: none;
		overflow: visible;
		grid-template-columns: 1fr;
	}

	.faq-page .branding-panel {
		height: auto;
		max-height: none;
		min-height: 420px;
	}

	.faq-page .branding-content {
		min-height: 420px;
		height: auto;
	}

	.faq-page .form-panel.faq-panel {
		height: auto;
		max-height: none;
		overflow: visible;
	}

	.faq-card {
		height: auto;
		overflow: visible;
		padding: 28px 22px 36px;
	}

	.faq-accordion {
		overflow: visible;
		padding-right: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.faq-page .branding-panel,
	.faq-page .form-panel.faq-panel,
	.faq-card__header,
	.faq-item {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.faq-item__chevron,
	.faq-item__answer,
	.faq-back-btn {
		transition: none;
	}

	.faq-item.is-open .faq-item__answer {
		grid-template-rows: 1fr;
	}
}
