/**
 * NexAir Core — front-end styles for the components the plugin renders itself.
 *
 * These give the lead form, text widget, sticky bar, review block, rating badge,
 * trust bar, FAQ accordion and CTA band a complete, on-brand look even without the
 * theme's main stylesheet, so the plugin stays portable between themes.
 *
 * Palette (mirrors theme.json):
 *   navy #0B1F33 · navy-700 #123A57 · ice #5EEAD4 · ember #FF7A1A
 *   cream #F7F5F0 · slate #3F4A56 · line #E3E0D9
 *
 * @package NexAir\Core
 */

:root {
	--nx-navy: #0b1f33;
	--nx-navy-700: #123a57;
	--nx-ice: #5eead4;
	--nx-ember: #ff7a1a;
	--nx-ember-dark: #c25400;
	--nx-cream: #f7f5f0;
	--nx-slate: #3f4a56;
	--nx-slate-soft: #5b6773;
	--nx-line: #e3e0d9;
	--nx-white: #ffffff;
	--nx-radius: 20px;
	--nx-radius-sm: 12px;
	--nx-shadow: 0 1px 2px rgba( 11, 31, 51, .06 ), 0 12px 32px -12px rgba( 11, 31, 51, .18 );
	--nx-font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--nx-font-display: Fraunces, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

/* Buttons --------------------------------------------------- */

.nx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 22px;
	border: 2px solid transparent;
	border-radius: var(--nx-radius-sm);
	font-family: var(--nx-font-body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform .16s ease-out, background-color .16s ease-out, color .16s ease-out, box-shadow .16s ease-out;
}

.nx-btn:hover {
	transform: translateY( -1px );
}

.nx-btn--primary {
	background: var(--nx-ember);
	color: var(--nx-navy);
}

.nx-btn--primary:hover,
.nx-btn--primary:focus-visible {
	background: var(--nx-ember-dark);
	color: var(--nx-white );
}

.nx-btn--outline {
	background: transparent;
	border-color: currentColor;
	color: var(--nx-white);
}

.nx-btn--ghost {
	background: transparent;
	border-color: var( --nx-line );
	color: inherit;
}

.nx-btn--block {
	display: flex;
	width: 100%;
}

.nx-btn--sm {
	min-height: 38px;
	padding: 8px 14px;
	font-size: .875rem;
}

.nx-btn[disabled] {
	opacity: .6;
	cursor: progress;
}

.nx-btn__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: nx-spin .7s linear infinite;
}

.nx-btn[disabled] .nx-btn__spinner {
	display: inline-block;
}

@keyframes nx-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* Stars / rating badge -------------------------------------- */

.nx-stars {
	display: inline-flex;
	gap: 2px;
	color: var( --nx-ember );
	vertical-align: middle;
}

.nx-star--empty {
	opacity: .32;
}

.nx-rating-badge {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border: 1px solid rgba( 255, 255, 255, .22 );
	border-radius: 999px;
	color: inherit;
	text-decoration: none;
	font-size: .9rem;
}

a.nx-rating-badge:hover {
	border-color: var( --nx-ice );
}

.nx-rating-badge__score {
	font-weight: 700;
}

.nx-rating-badge__count,
.nx-rating-badge__updated {
	opacity: .82;
}

.nx-rating-badge--stacked {
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	border-radius: var( --nx-radius-sm );
}

/* Trust bar ------------------------------------------------- */

.nx-trust-bar__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nx-trust-bar__item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: .9rem;
	font-weight: 500;
}

.nx-trust-bar__icon {
	display: inline-flex;
	color: var( --nx-ice );
}

.nx-icon {
	fill: none;
	stroke: currentColor;
}

/* Quote form ------------------------------------------------ */

.nx-quote-form {
	padding: 26px;
	background: var( --nx-white );
	border: 1px solid var( --nx-line );
	border-radius: var( --nx-radius );
	box-shadow: var( --nx-shadow );
	color: var( --nx-slate );
	font-family: var( --nx-font-body );
}

.nx-quote-form__title {
	margin: 0 0 4px;
	color: var( --nx-navy );
	font-family: var( --nx-font-display );
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
}

.nx-quote-form__subtitle {
	margin: 0 0 18px;
	color: var( --nx-slate-soft );
	font-size: .95rem;
}

.nx-form {
	display: grid;
	gap: 16px;
}

.nx-form__row {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

@media ( min-width: 620px ) {
	.nx-form__row {
		grid-template-columns: 1fr 1fr;
	}
}

.nx-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.nx-field__label {
	font-size: .875rem;
	font-weight: 600;
	color: var( --nx-navy );
}

.nx-required {
	color: var( --nx-ember-dark );
}

.nx-field input[type="text"],
.nx-field input[type="tel"],
.nx-field input[type="email"],
.nx-field select,
.nx-field textarea {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	border: 1px solid var( --nx-line );
	border-radius: var( --nx-radius-sm );
	background: var( --nx-white );
	color: var( --nx-navy );
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
}

.nx-field textarea {
	min-height: 96px;
	resize: vertical;
}

.nx-field input:focus,
.nx-field select:focus,
.nx-field textarea:focus {
	outline: none;
	border-color: var( --nx-navy-700 );
	box-shadow: 0 0 0 3px rgba( 28, 94, 116, .18 );
}

.nx-field input[aria-invalid="true"],
.nx-field select[aria-invalid="true"] {
	border-color: #b3261e;
}

.nx-field__error {
	min-height: 0;
	color: #b3261e;
	font-size: .8125rem;
}

.nx-field--error .nx-field__error {
	min-height: 1em;
}

.nx-field--honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.nx-checkbox {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: .875rem;
	line-height: 1.55;
	color: var( --nx-slate );
}

.nx-checkbox input {
	flex: 0 0 auto;
	margin-top: 3px;
	width: 18px;
	height: 18px;
	accent-color: var( --nx-navy-700 );
}

.nx-checkbox--emergency {
	padding: 10px 12px;
	border: 1px dashed rgba( 255, 122, 26, .5 );
	border-radius: var( --nx-radius-sm );
	background: rgba( 255, 122, 26, .06 );
	font-weight: 600;
}

.nx-checkbox__links a {
	color: var( --nx-navy-700 );
	text-decoration: underline;
}

.nx-form__footnote {
	margin: 0;
	color: var( --nx-slate-soft );
	font-size: .8125rem;
}

.nx-form__status {
	display: none;
	padding: 12px 14px;
	border-radius: var( --nx-radius-sm );
	font-size: .9rem;
	font-weight: 500;
}

.nx-form__status--success {
	display: block;
	background: rgba( 94, 234, 212, .18 );
	border: 1px solid var( --nx-ice );
	color: #0a5d50;
}

.nx-form__status--error {
	display: block;
	background: rgba( 179, 38, 30, .08 );
	border: 1px solid rgba( 179, 38, 30, .4 );
	color: #8a2424;
}

/* Floating text widget -------------------------------------- */

.nx-text-widget {
	position: fixed;
	right: 18px;
	bottom: 84px;
	z-index: 60;
	font-family: var( --nx-font-body );
}

@media ( min-width: 900px ) {
	.nx-text-widget {
		bottom: 24px;
	}
}

.nx-text-widget__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var( --nx-navy );
	color: var( --nx-white );
	font-family: inherit;
	font-size: .95rem;
	font-weight: 600;
	box-shadow: var( --nx-shadow );
	cursor: pointer;
}

.nx-text-widget__panel {
	position: absolute;
	right: 0;
	bottom: calc( 100% + 10px );
	width: min( 320px, calc( 100vw - 36px ) );
	padding: 18px;
	background: var( --nx-white );
	border: 1px solid var( --nx-line );
	border-radius: var( --nx-radius );
	box-shadow: var( --nx-shadow );
	color: var( --nx-slate );
}

.nx-text-widget__heading {
	margin: 0 0 6px;
	color: var( --nx-navy );
	font-family: var( --nx-font-display );
	font-weight: 700;
}

.nx-text-widget__copy {
	margin: 0 0 14px;
	font-size: .875rem;
}

.nx-text-widget__call {
	display: block;
	margin-top: 10px;
	color: var( --nx-navy-700 );
	font-size: .875rem;
	text-align: center;
}

/* Mobile sticky bar ----------------------------------------- */

.nx-sticky-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 55;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 1px;
	background: var( --nx-navy );
	padding: 6px;
	padding-bottom: max( 6px, env( safe-area-inset-bottom ) );
	font-family: var( --nx-font-body );
}

@media ( min-width: 900px ) {
	.nx-sticky-bar {
		display: none;
	}
}

.nx-sticky-bar a {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 46px;
	border-radius: var( --nx-radius-sm );
	color: var( --nx-white );
	font-size: .875rem;
	font-weight: 600;
	text-decoration: none;
}

.nx-sticky-bar__quote {
	background: var( --nx-ember );
	color: var( --nx-navy ) !important;
}

body.nx-has-sticky {
	padding-bottom: 72px;
}

@media ( min-width: 900px ) {
	body.nx-has-sticky {
		padding-bottom: 0;
	}
}

/* Review block ---------------------------------------------- */

.nx-reviews__head {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}

.nx-reviews__title {
	margin: 0 0 6px;
}

.nx-reviews__summary {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
}

.nx-reviews__source {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .9rem;
}

.nx-reviews__list {
	display: grid;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
	grid-template-columns: 1fr;
}

@media ( min-width: 700px ) {
	.nx-reviews__list {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( min-width: 1040px ) {
	.nx-reviews__list {
		grid-template-columns: repeat( 3, 1fr );
	}
}

.nx-reviews--carousel .nx-reviews__list {
	grid-auto-flow: column;
	grid-auto-columns: minmax( 280px, 86% );
	grid-template-columns: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 8px;
}

.nx-reviews--carousel .nx-review {
	scroll-snap-align: start;
}

.nx-review {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 22px;
	margin: 0;
	background: var( --nx-white );
	border: 1px solid var( --nx-line );
	border-radius: var( --nx-radius );
	box-shadow: var( --nx-shadow );
}

.nx-review__text {
	margin: 0;
	color: var( --nx-slate );
	font-size: .95rem;
	line-height: 1.6;
}

.nx-review__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: auto;
	color: var( --nx-slate-soft );
	font-size: .8125rem;
}

.nx-review__author {
	font-weight: 600;
	color: var( --nx-navy );
}

.nx-review__source-label a {
	color: inherit;
}

.nx-tag--sample {
	padding: 2px 8px;
	border-radius: 999px;
	background: #fde68a;
	color: #7c2d12;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .04em;
}

.nx-reviews__disclosure,
.nx-reviews__empty {
	margin: 20px 0 0;
	color: var( --nx-slate-soft );
	font-size: .8125rem;
}

/* Review strip ---------------------------------------------- */

.nx-review-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 24px;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border: 1px solid var( --nx-line );
	border-left: 4px solid var( --nx-ice );
	border-radius: var( --nx-radius-sm );
	background: var( --nx-cream );
	font-family: var( --nx-font-body );
}

.nx-review-strip__score {
	font-weight: 600;
}

.nx-review-strip__quote {
	margin: 0;
	max-width: 52ch;
	font-size: .9375rem;
	line-height: 1.55;
	color: var( --nx-slate );
}

.nx-review-strip__quote cite {
	display: block;
	margin-top: 4px;
	color: var( --nx-slate-soft );
	font-size: .8125rem;
	font-style: normal;
}

.nx-review-strip__link {
	color: var( --nx-navy-700 );
	font-size: .875rem;
	font-weight: 600;
}

/* FAQ accordion --------------------------------------------- */

.nx-accordion {
	display: grid;
	gap: 12px;
}

.nx-accordion__item {
	border: 1px solid var( --nx-line );
	border-radius: var( --nx-radius-sm );
	background: var( --nx-white );
	overflow: hidden;
}

.nx-accordion__heading {
	margin: 0;
	font-size: 1rem;
}

.nx-accordion__trigger {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px;
	border: 0;
	background: transparent;
	color: var( --nx-navy );
	font-family: var( --nx-font-display );
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
}

.nx-accordion__icon {
	position: relative;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
}

.nx-accordion__icon::before,
.nx-accordion__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 16px;
	height: 2px;
	background: var( --nx-navy-700 );
	transition: transform .18s ease-out;
}

.nx-accordion__icon::after {
	transform: rotate( 90deg );
}

.nx-accordion__trigger[aria-expanded="true"] .nx-accordion__icon::after {
	transform: rotate( 0deg );
}

.nx-accordion__content {
	padding: 0 20px 20px;
	color: var( --nx-slate );
	line-height: 1.65;
}

.nx-accordion__content > *:first-child {
	margin-top: 0;
}

.nx-accordion__content > *:last-child {
	margin-bottom: 0;
}

/* Without JS the panels stay open — answers are always readable. */
.no-js .nx-accordion__panel {
	display: block !important;
}

/* CTA band -------------------------------------------------- */

.nx-cta-band {
	padding: 56px 0;
	background: var( --nx-navy );
	color: var( --nx-white );
	font-family: var( --nx-font-body );
}

.nx-cta-band--cream {
	background: var( --nx-cream );
	color: var( --nx-slate );
}

.nx-cta-band__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: center;
	justify-content: space-between;
}

.nx-cta-band__title {
	margin: 0 0 6px;
	color: inherit;
	font-family: var( --nx-font-display );
	font-size: clamp( 1.5rem, 1.1rem + 1.6vw, 2.25rem );
	line-height: 1.15;
}

.nx-cta-band__text {
	margin: 0 0 12px;
	max-width: 52ch;
}

.nx-cta-band--navy .nx-rating-badge {
	border-color: rgba( 255, 255, 255, .24 );
}

.nx-cta-band__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.nx-cta-band--cream .nx-btn--ghost,
.nx-cta-band--cream .nx-btn--outline {
	border-color: var( --nx-line );
	color: var( --nx-navy );
}

/* Consent banner -------------------------------------------- */

.nx-consent {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 70;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	max-width: 720px;
	margin: 0 auto;
	padding: 16px 20px;
	background: var( --nx-navy );
	color: var( --nx-white );
	border-radius: var( --nx-radius );
	box-shadow: var( --nx-shadow );
	font-family: var( --nx-font-body );
}

.nx-consent__text {
	margin: 0;
	max-width: 48ch;
	font-size: .875rem;
}

.nx-consent__actions {
	display: flex;
	gap: 8px;
}

.nx-consent .nx-btn--ghost {
	color: var( --nx-white );
	border-color: rgba( 255, 255, 255, .4 );
}

/* Placeholder note (editors only) --------------------------- */

.nx-placeholder-note {
	padding: 8px 12px;
	border-left: 3px solid var( --nx-ember );
	background: rgba( 255, 122, 26, .08 );
	color: var( --nx-slate );
	font-size: .8125rem;
}

/* Reduced motion -------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {
	.nx-btn,
	.nx-accordion__icon::before,
	.nx-accordion__icon::after {
		transition: none;
	}

	.nx-btn:hover {
		transform: none;
	}
}
