/*
 * NOA contact popup (assets/noa-contact.js) and toasts.
 * Root: .noa-cx. Animations use transform/opacity only.
 */

html.noa-cx-locked {
	overflow: hidden;
}

.noa-cx {
	--noa-cx-ease: var(--noa-ease, cubic-bezier(0.2, 0.8, 0.2, 1));
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	font-family: "Aileron", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ink, #25140f);
}

.noa-cx[hidden] {
	display: none;
}

.noa-cx *,
.noa-cx *::before,
.noa-cx *::after {
	box-sizing: border-box;
}

.noa-cx [hidden] {
	display: none !important;
}

.noa-cx__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(37, 20, 15, 0.5);
	opacity: 0;
	transition: opacity 280ms var(--noa-cx-ease);
}

.noa-cx__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: auto;
	padding: 32px;
	background: var(--card, #fff);
	border-radius: 20px;
	box-shadow: var(--shadow-pop, 0 26px 60px rgba(37, 20, 15, 0.16));
	opacity: 0;
	transform: translateY(16px) scale(0.96);
	transition: transform 320ms var(--noa-cx-ease), opacity 240ms var(--noa-cx-ease);
}

.noa-cx.is-open .noa-cx__backdrop {
	opacity: 1;
}

.noa-cx.is-open .noa-cx__panel {
	opacity: 1;
	transform: none;
}

.noa-cx__panel:focus {
	outline: none;
}

.noa-cx__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bg, #e8e3d7);
	color: var(--ink, #25140f);
	cursor: pointer;
}

.noa-cx__close:hover {
	background: var(--muted, #d8d4c8);
}

.noa-cx__chip {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 3px 12px;
	border-radius: var(--radius-pill, 999px);
	background: var(--selected-fill, #eaf3ec);
	color: var(--success, #16704a);
	font-size: 13px;
	font-weight: 600;
}

.noa-cx .noa-cx__title {
	margin: 14px 48px 0 0;
	font-family: "Early Sans", "Aileron", system-ui, sans-serif;
	font-weight: 300;
	font-size: clamp(28px, 3vw, 34px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--ink, #25140f);
}

.noa-cx .noa-cx__title:focus {
	outline: none;
}

.noa-cx__lead {
	margin: 8px 0 0;
	font-size: 15px;
	color: var(--ink-soft, rgba(37, 20, 15, 0.72));
}

.noa-cx__grid {
	margin-top: 22px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 12px;
}

.noa-cx__field {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.noa-cx__field--wide {
	grid-column: 1 / -1;
}

.noa-cx__field label {
	font-size: 14px;
	font-weight: 600;
}

.noa-cx__opt {
	font-weight: 400;
	color: var(--ink-meta, rgba(37, 20, 15, 0.68));
}

.noa-cx__field input,
.noa-cx__field textarea {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	border: 1px solid var(--line-control-strong, rgba(37, 20, 15, 0.5));
	border-radius: var(--radius-md, 10px);
	background: var(--field, #fff);
	color: var(--ink, #25140f);
	font: inherit;
	font-size: 16px;
}

.noa-cx__field textarea {
	min-height: 120px;
	resize: vertical;
}

.noa-cx__field input:focus-visible,
.noa-cx__field textarea:focus-visible {
	outline: 2px solid var(--ink, #25140f);
	outline-offset: 1px;
}

.noa-cx__field [aria-invalid="true"] {
	border-color: var(--danger, #8a2a12);
	box-shadow: inset 0 0 0 1px var(--danger, #8a2a12);
}

.noa-cx__err {
	font-size: 13px;
	color: var(--danger, #8a2a12);
}

/* Honeypot: off-screen, never focusable. */
.noa-cx__hp {
	position: absolute !important;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.noa-cx__alert {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: var(--radius-sm, 8px);
	border-left: 4px solid var(--danger, #8a2a12);
	background: #f7e6e1;
	color: var(--danger, #8a2a12);
	font-size: 14px;
}

.noa-cx__submit {
	margin-top: 20px;
}

.noa-cx__alt {
	margin: 14px 0 0;
	font-size: 13px;
	text-align: center;
	color: var(--ink-soft, rgba(37, 20, 15, 0.72));
}

.noa-cx__alt a {
	color: var(--ink, #25140f);
}

/* Success state */
.noa-cx__done {
	padding: 12px 0 4px;
	text-align: center;
}

.noa-cx__done .noa-cx__title {
	margin: 18px 0 0;
}

.noa-cx__check {
	display: block;
	margin: 8px auto 0;
	color: var(--success, #16704a);
}

.noa-cx__check-ring {
	stroke-dasharray: 208;
	stroke-dashoffset: 208;
	transform-origin: 36px 36px;
	transform: rotate(-90deg);
}

.noa-cx__check-tick {
	stroke-dasharray: 44;
	stroke-dashoffset: 44;
}

.noa-cx.is-done .noa-cx__check-ring {
	animation: noa-cx-draw 520ms var(--noa-cx-ease) forwards;
}

.noa-cx.is-done .noa-cx__check-tick {
	animation: noa-cx-draw 340ms var(--noa-cx-ease) 380ms forwards;
}

.noa-cx.is-done .noa-cx__check {
	animation: noa-cx-pop 400ms var(--noa-cx-ease) both;
}

.noa-cx.is-done .noa-cx__done > :not(svg) {
	animation: noa-cx-rise 360ms var(--noa-cx-ease) 200ms both;
}

.noa-cx__again {
	margin-top: 22px;
}

@keyframes noa-cx-draw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes noa-cx-pop {
	from {
		opacity: 0;
		transform: scale(0.8);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes noa-cx-rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Mobile: bottom sheet */
@media (max-width: 680px) {
	.noa-cx {
		align-items: flex-end;
		padding: 0;
	}

	.noa-cx__panel {
		max-width: none;
		max-height: 94vh;
		margin: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
		border-radius: 20px 20px 0 0;
		opacity: 1;
		transform: translateY(100%);
	}

	.noa-cx__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Toasts */
.noa-toast-region {
	position: fixed;
	left: 50%;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	z-index: 100001;
	width: min(calc(100vw - 32px), 440px);
	display: flex;
	flex-direction: column;
	gap: 8px;
	transform: translateX(-50%);
	pointer-events: none;
}

.noa-toast {
	padding: 14px 18px;
	border-radius: var(--radius-md, 10px);
	background: var(--ink, #25140f);
	color: var(--paper, #f3efe6);
	box-shadow: var(--shadow-pop, 0 26px 60px rgba(37, 20, 15, 0.16));
	font-family: "Aileron", system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	pointer-events: auto;
	cursor: pointer;
	opacity: 0;
	transform: translateY(12px);
	transition: transform 320ms var(--noa-ease, cubic-bezier(0.2, 0.8, 0.2, 1)), opacity 240ms var(--noa-ease, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.noa-toast.is-in {
	opacity: 1;
	transform: none;
}

.noa-toast--error {
	background: var(--danger, #8a2a12);
	color: #fff;
}

.noa-toast--success {
	background: var(--success, #16704a);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.noa-cx__backdrop,
	.noa-cx__panel,
	.noa-toast {
		transition: none !important;
	}

	.noa-cx__panel,
	.noa-toast {
		transform: none !important;
	}

	.noa-cx.is-done .noa-cx__check,
	.noa-cx.is-done .noa-cx__done > :not(svg) {
		animation: none !important;
	}

	.noa-cx__check-ring,
	.noa-cx__check-tick,
	.noa-cx.is-done .noa-cx__check-ring,
	.noa-cx.is-done .noa-cx__check-tick {
		animation: none !important;
		stroke-dashoffset: 0;
	}
}
