/* ==========================================================================
   TextCRM FAQ Widget
   "Frequently Asked Questions" accordion section from demo-html/pricing.html.
   Card surface, accent palette and type scale are aligned with the Pricing /
   Compare-Features / Roles widgets so the FAQ reads as the same design
   system.

   Smooth expand/collapse uses grid-template-rows 0fr ↔ 1fr so the panel
   animates to its natural height without measuring.
   ========================================================================== */

.textcrm-faq {
	position: relative;
	width: 100%;
	padding-top: 96px;
	padding-bottom: 96px;
	background-color: #0b1326;
	font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: #f3f4f6;
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;

	/* Tunables driven by the Style tab. */
	--tf-accent: #00f5a0;
	--tf-card-padding: 24px;
	--tf-card-blur: 10px;
	--tf-icon-size: 20px;
	--tf-transition: 250ms;
}

.textcrm-faq *,
.textcrm-faq *::before,
.textcrm-faq *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.textcrm-faq__container {
	position: relative;
	width: 100%;
	max-width: 768px;                 /* max-w-3xl from the reference */
	margin: 0 auto;
	padding-left: 24px;
	padding-right: 24px;
}

/* --------------------------------------------------------------------------
   Heading
   -------------------------------------------------------------------------- */
.textcrm-faq__header {
	text-align: center;
	margin-bottom: 64px;
}

.textcrm-faq__title {
	margin: 0 0 16px;
	font-size: 30px;
	line-height: 1.3;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: -0.02em;
}

.textcrm-faq__subtitle {
	margin: 0 auto;
	max-width: 32rem;
	font-size: 16px;
	line-height: 1.6;
	letter-spacing: 0.01em;
	font-weight: 400;
	color: #9ca3af;
}

/* --------------------------------------------------------------------------
   Items stack
   -------------------------------------------------------------------------- */
.textcrm-faq__items {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* --------------------------------------------------------------------------
   Item card — glass surface, transitions to accent border on hover/open
   -------------------------------------------------------------------------- */
.textcrm-faq__item {
	background-color: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 16px;
	-webkit-backdrop-filter: blur(var(--tf-card-blur, 10px));
	backdrop-filter: blur(var(--tf-card-blur, 10px));
	overflow: hidden;
	transition: border-color var(--tf-transition, 250ms) ease;
}

.textcrm-faq__item:hover,
.textcrm-faq__item:focus-within,
.textcrm-faq__item[data-expanded="true"] {
	border-color: rgba(0, 245, 160, 0.3);
}

/* --------------------------------------------------------------------------
   Question — full-width accessible button
   -------------------------------------------------------------------------- */
.textcrm-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: var(--tf-card-padding, 24px);
	background: none;
	border: 0;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	color: inherit;
	appearance: none;
}

.textcrm-faq__question:focus {
	outline: none;
}

.textcrm-faq__question:focus-visible {
	outline: 2px solid var(--tf-accent, #00f5a0);
	outline-offset: -2px;
	border-radius: 16px;
}

.textcrm-faq__question-text {
	flex: 1 1 auto;
	font-size: 18px;
	line-height: 1.5;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: #ffffff;
}

/* --------------------------------------------------------------------------
   Chevron icon — rotates 180° on open
   -------------------------------------------------------------------------- */
.textcrm-faq__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: var(--tf-icon-size, 20px);
	height: var(--tf-icon-size, 20px);
	color: #9ca3af;
	transition:
		color var(--tf-transition, 250ms) ease,
		transform var(--tf-transition, 250ms) cubic-bezier(0.4, 0, 0.2, 1);
}

.textcrm-faq__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.textcrm-faq__item:hover .textcrm-faq__icon,
.textcrm-faq__item:focus-within .textcrm-faq__icon,
.textcrm-faq__item[data-expanded="true"] .textcrm-faq__icon {
	color: var(--tf-accent, #00f5a0);
}

.textcrm-faq__item[data-expanded="true"] .textcrm-faq__icon {
	transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Panel — smooth max-height collapse. Works in all browsers (the
   grid-template-rows 0fr→1fr trick needs very recent Chrome / Safari /
   Firefox versions and silently falls back to "auto" elsewhere, which
   was leaking the answer text below collapsed questions).
   -------------------------------------------------------------------------- */
.textcrm-faq__panel {
	max-height: 0;
	overflow: hidden;
	visibility: hidden;
	transition:
		max-height 350ms cubic-bezier(0.4, 0, 0.2, 1),
		visibility 0s linear 350ms;
}

.textcrm-faq__item[data-expanded="true"] .textcrm-faq__panel {
	max-height: 1500px;               /* generous cap — covers very long FAQ answers */
	visibility: visible;
	transition:
		max-height 450ms cubic-bezier(0.4, 0, 0.2, 1),
		visibility 0s linear 0s;
}

.textcrm-faq__answer {
	padding: 16px var(--tf-card-padding, 24px) var(--tf-card-padding, 24px);
	font-size: 16px;
	line-height: 1.6;
	letter-spacing: 0.01em;
	font-weight: 400;
	color: #9ca3af;
}

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

.textcrm-faq__answer p:last-child {
	margin-bottom: 0;
}

.textcrm-faq__answer a {
	color: var(--tf-accent, #00f5a0);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.textcrm-faq__answer a:hover,
.textcrm-faq__answer a:focus-visible {
	text-decoration: none;
}

.textcrm-faq__answer strong {
	color: #ffffff;
	font-weight: 600;
}

.textcrm-faq__answer ul,
.textcrm-faq__answer ol {
	margin: 0 0 12px;
	padding-left: 20px;
}

.textcrm-faq__answer li {
	margin: 0 0 6px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
	.textcrm-faq {
		padding-top: 64px;
		padding-bottom: 64px;
	}

	.textcrm-faq__container {
		padding-left: 16px;
		padding-right: 16px;
	}

	.textcrm-faq__header {
		margin-bottom: 40px;
	}

	.textcrm-faq__title {
		font-size: 24px;
	}

	.textcrm-faq {
		--tf-card-padding: 20px;
	}

	.textcrm-faq__question-text {
		font-size: 16px;
	}

	.textcrm-faq__answer {
		font-size: 15px;
	}
}

/* --------------------------------------------------------------------------
   Reduced motion — instant transitions, no chevron rotation animation
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.textcrm-faq__item,
	.textcrm-faq__icon {
		transition: none;
	}

	.textcrm-faq__panel {
		transition:
			max-height 0s,
			visibility 0s linear 0s;
	}
}
