/*
 * Confirmation dialog shown after a successful form submission.
 *
 * Owned by the plugin, because the forms are: the theme supplies no markup
 * for this and must not have to. The brand tokens are read from the theme
 * when it is active and fall back to the same literal values otherwise, so
 * the dialog looks right either way and never renders unstyled.
 *
 * Highest z-index in the theme is 1000 (the skip link), so 2000 puts the
 * dialog above everything, including the fixed header.
 */

.aoh-smodal[hidden] { display: none; }

.aoh-smodal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	/* Safe areas on a notched phone, so the panel is never under the chrome. */
	padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.aoh-smodal__veil {
	position: fixed;
	inset: 0;
	background: rgba(11, 11, 11, 0.72);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.aoh-smodal__panel {
	position: relative;
	width: 100%;
	max-width: 27rem;
	margin: auto;
	padding: 2.25rem 1.75rem 1.875rem;
	background: var(--aoh-white, #fff);
	color: var(--aoh-near-black, #141414);
	border-radius: var(--aoh-radius-lg, 18px);
	box-shadow: 0 24px 60px rgba(11, 11, 11, 0.45);
	text-align: center;
	/* The top edge carries the brand, without an image to load. */
	border-top: 4px solid var(--aoh-orange, #ff7a00);
}

/* Close control: a real button, big enough to hit on a phone. */
.aoh-smodal__x {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--aoh-mid-grey, #6f6a63);
	cursor: pointer;
	transition: color 160ms ease, background-color 160ms ease;
}

.aoh-smodal__x:hover,
.aoh-smodal__x:focus-visible {
	color: var(--aoh-black, #0b0b0b);
	background: var(--aoh-off-white, #f7f2ea);
}

.aoh-smodal__x svg { width: 1.125rem; height: 1.125rem; display: block; }

.aoh-smodal__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	margin: 0 auto 1.125rem;
	border-radius: 50%;
	background: var(--aoh-orange, #ff7a00);
	color: var(--aoh-black, #0b0b0b);
}

.aoh-smodal__mark svg { width: 1.5rem; height: 1.5rem; display: block; }

.aoh-smodal__title {
	margin: 0 0 0.625rem;
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
	line-height: 1.15;
	font-weight: 700;
	color: var(--aoh-black, #0b0b0b);
}

.aoh-smodal__text {
	margin: 0 0 1.625rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--aoh-mid-grey, #6f6a63);
	overflow-wrap: break-word;
}

.aoh-smodal__ok {
	display: inline-block;
	min-width: 9rem;
	padding: 0.8rem 1.75rem;
	border: 2px solid var(--aoh-orange, #ff7a00);
	border-radius: var(--aoh-pill, 999px);
	background: var(--aoh-orange, #ff7a00);
	color: var(--aoh-black, #0b0b0b);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.aoh-smodal__ok:hover {
	background: var(--aoh-orange-dark, #d95d00);
	border-color: var(--aoh-orange-dark, #d95d00);
	color: var(--aoh-white, #fff);
}

/* Focus has to be visible: this dialog is reached by keyboard by design. */
.aoh-smodal__ok:focus-visible,
.aoh-smodal__x:focus-visible,
.aoh-smodal__panel:focus-visible {
	outline: 3px solid var(--aoh-orange, #ff7a00);
	outline-offset: 3px;
}

.aoh-smodal__panel:focus { outline: none; }
.aoh-smodal__panel:focus-visible { outline-offset: 6px; }

/* Background scrolling is locked while the dialog is open. */
.aoh-smodal-locked,
.aoh-smodal-locked body { overflow: hidden; }

.aoh-smodal__panel {
	animation: aoh-smodal-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes aoh-smodal-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.aoh-smodal__panel { animation: none; }
	.aoh-smodal__x, .aoh-smodal__ok { transition: none; }
}

@media (max-width: 30rem) {
	.aoh-smodal__panel { padding: 2rem 1.25rem 1.5rem; }
	.aoh-smodal__ok { width: 100%; }
}
