/*
 * Public maintenance document.
 *
 * Scope: .mm-suc-p-page. This file is enqueued on the admin editor screen too,
 * because the live preview renders the real public document inside the
 * workspace - so every rule starts at .mm-suc-p-page or deeper, and nothing
 * here declares or reads a bare --mm-suc-p- property.
 *
 * See design-system/foundations/preview-isolation.md.
 */

/* -------------------------------------------------------------------------
 * Root: the style contract, and the inherited properties the page states
 * rather than assumes.
 * ---------------------------------------------------------------------- */

.mm-suc-p-page {
	--mm-suc-p-page-accent: #4f46e5;
	--mm-suc-p-page-ink: #ffffff;
	--mm-suc-p-page-overlay: 0.55;
	--mm-suc-p-page-blur: 14px;
	--mm-suc-p-page-bg-image: none;
	--mm-suc-p-page-veil: #0f172a;
	--mm-suc-p-page-card: rgba(15, 23, 42, 0.55);
	--mm-suc-p-page-line: rgba(255, 255, 255, 0.22);
	--mm-suc-p-page-on-accent: #ffffff;

	position: relative;
	display: flex;
	overflow: hidden;
	min-height: 480px;
	margin: 0;
	padding: 0;
	color: var(--mm-suc-p-page-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	text-align: start;
}

.mm-suc-p-page *,
.mm-suc-p-page *::before,
.mm-suc-p-page *::after {
	box-sizing: border-box;
}

.mm-suc-p-page [hidden] {
	display: none;
}

.mm-suc-p-page-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* One focus treatment, with an outer shadow so it survives any accent. */
.mm-suc-p-page a:focus-visible,
.mm-suc-p-page button:focus-visible,
.mm-suc-p-page input:focus-visible,
.mm-suc-p-page textarea:focus-visible,
.mm-suc-p-page [tabindex]:focus-visible,
.mm-suc-p-page [contenteditable]:focus-visible {
	outline: 2px solid var(--mm-suc-p-page-accent);
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.45);
}

/* -------------------------------------------------------------------------
 * Background layer
 * ---------------------------------------------------------------------- */

.mm-suc-p-page-bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.mm-suc-p-page-bg-image,
.mm-suc-p-page-bg-veil {
	position: absolute;
	inset: 0;
	display: block;
}

.mm-suc-p-page-bg-image {
	background-image: var(--mm-suc-p-page-bg-image);
	background-repeat: no-repeat;
	background-position: 50% 50%;
	background-size: cover;
	transition: opacity 260ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-suc-p-page-bg-veil {
	background-color: var(--mm-suc-p-page-veil);
	opacity: var(--mm-suc-p-page-overlay);
}

/*
 * Every text element below states its own colour and font rather than
 * inheriting them.
 *
 * That looks redundant and is not: this stylesheet is loaded inside wp-admin so
 * the preview can render the real document, and wp-admin styles bare element
 * selectors - `h1, h2, h3 { color: #1d2327 }` among them. Inheritance only
 * applies where no rule matches the element itself, so a bare `h1` rule beats
 * the ink inherited from .mm-suc-p-page and the headline turns dark on every
 * dark template. A class selector outranks it.
 *
 * Fixed 2026-08-22; reproduced first, in design-system/AUDIT.md.
 */

/* -------------------------------------------------------------------------
 * Shell and card
 * ---------------------------------------------------------------------- */

.mm-suc-p-page-shell {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 48px 24px;
}

.mm-suc-p-page-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	max-width: 720px;
	padding: 48px;
	border: 1px solid var(--mm-suc-p-page-line);
	border-radius: 24px;
	background-color: var(--mm-suc-p-page-card);
	-webkit-backdrop-filter: blur(var(--mm-suc-p-page-blur));
	backdrop-filter: blur(var(--mm-suc-p-page-blur));
}

.mm-suc-p-page-logo {
	display: flex;
	color: var(--mm-suc-p-page-ink);
	font-family: inherit;
	align-items: center;
	gap: 12px;
	margin-block-end: 8px;
	font-size: clamp(15px, 1.4vw, 19px);
	font-weight: 600;
	letter-spacing: -0.01em;
}

.mm-suc-p-page-logo img {
	display: block;
	width: auto;
	max-width: 200px;
	max-height: 64px;
	height: auto;
}

.mm-suc-p-page-eyebrow {
	margin: 0;
	color: var(--mm-suc-p-page-accent);
	font-size: clamp(11px, 0.9vw, 13px);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mm-suc-p-page-headline {
	margin: 0;
	color: var(--mm-suc-p-page-ink);
	font-family: inherit;
	font-size: clamp(28px, 5vw, 60px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.mm-suc-p-page-rule {
	width: 64px;
	height: 3px;
	border-radius: 999px;
	background-color: var(--mm-suc-p-page-accent);
}

.mm-suc-p-page-message {
	margin: 0;
	color: var(--mm-suc-p-page-ink);
	font-family: inherit;
	max-width: 56ch;
	font-size: clamp(15px, 1.4vw, 19px);
	line-height: 1.6;
	opacity: 0.92;
	white-space: pre-wrap;
}

.mm-suc-p-page-host {
	margin: 8px 0 0;
	color: var(--mm-suc-p-page-ink);
	font-family: inherit;
	font-size: clamp(12px, 1vw, 14px);
	letter-spacing: 0.04em;
	opacity: 0.7;
}

/* -------------------------------------------------------------------------
 * Countdown
 * ---------------------------------------------------------------------- */

.mm-suc-p-page-countdown {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-block: 8px;
}

.mm-suc-p-page-unit {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	padding: 16px 8px;
	border: 1px solid var(--mm-suc-p-page-line);
	border-radius: 14px;
	text-align: center;
}

.mm-suc-p-page-unit-value {
	color: var(--mm-suc-p-page-accent);
	font-size: clamp(28px, 4.5vw, 56px);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.mm-suc-p-page-unit-label {
	color: var(--mm-suc-p-page-ink);
	font-size: clamp(10px, 0.9vw, 12px);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.75;
}

/* -------------------------------------------------------------------------
 * Contact trigger
 * ---------------------------------------------------------------------- */

.mm-suc-p-page-contact {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: start;
	min-height: 48px;
	margin-block-start: 8px;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	background-color: var(--mm-suc-p-page-accent);
	color: var(--mm-suc-p-page-on-accent);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: filter 150ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-suc-p-page-contact:hover {
	filter: brightness(1.08);
}

/* -------------------------------------------------------------------------
 * Contact sheet
 * ---------------------------------------------------------------------- */

.mm-suc-p-page-sheet {
	position: fixed;
	inset: 0;
	z-index: 20;
	display: flex;
	justify-content: flex-end;
}

.mm-suc-p-page-scrim {
	position: absolute;
	inset: 0;
	order: -1;
	width: 100%;
	padding: 0;
	border: 0;
	background-color: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.mm-suc-p-page-sheet-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: min(420px, 100%);
	max-height: 100%;
	padding: 32px;
	overflow-y: auto;
	border-start-start-radius: 24px;
	border-end-start-radius: 24px;
	background-color: var(--mm-suc-p-page-veil);
	color: var(--mm-suc-p-page-ink);
	transform: translateX(0);
	transition: transform 400ms cubic-bezier(0.2, 0, 0, 1);
}

.mm-suc-p-page-sheet[data-state="closing"] .mm-suc-p-page-sheet-inner {
	transform: translateX(100%);
}

.mm-suc-p-page-sheet-title {
	margin: 0;
	color: var(--mm-suc-p-page-ink);
	font-family: inherit;
	padding-inline-end: 32px;
	font-size: clamp(18px, 2vw, 24px);
	font-weight: 700;
}

.mm-suc-p-page-sheet-close {
	position: absolute;
	font-family: inherit;
	inset-block-start: 16px;
	inset-inline-end: 16px;
	width: 44px;
	height: 44px;
	border: 1px solid var(--mm-suc-p-page-line);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.mm-suc-p-page-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
}

.mm-suc-p-page-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
}

.mm-suc-p-page-row label {
	color: var(--mm-suc-p-page-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
}

.mm-suc-p-page-row input,
.mm-suc-p-page-row textarea {
	width: 100%;
	min-height: 44px;
	padding: 12px;
	border: 1px solid var(--mm-suc-p-page-line);
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.08);
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
}

.mm-suc-p-page-row textarea {
	min-height: 120px;
	resize: vertical;
}

.mm-suc-p-page-row input[aria-invalid="true"],
.mm-suc-p-page-row textarea[aria-invalid="true"] {
	border-color: #ff8f8f;
}

.mm-suc-p-page-error {
	display: none;
	font-size: 13px;
	color: #ffc9c9;
}

.mm-suc-p-page-error[data-shown] {
	display: block;
}

.mm-suc-p-page-trap {
	position: absolute;
	inset-inline-start: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mm-suc-p-page-actions {
	margin: 0;
}

.mm-suc-p-page-send {
	width: 100%;
	min-height: 48px;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	background-color: var(--mm-suc-p-page-accent);
	color: var(--mm-suc-p-page-on-accent);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.mm-suc-p-page-send[disabled] {
	cursor: not-allowed;
	opacity: 0.6;
}

.mm-suc-p-page-status {
	margin: 0;
	color: var(--mm-suc-p-page-ink);
	font-size: 14px;
	min-height: 20px;
}

/* -------------------------------------------------------------------------
 * Layout presets. Modifier classes over identical markup.
 * ---------------------------------------------------------------------- */

.mm-suc-p-page--left .mm-suc-p-page-shell {
	justify-content: flex-start;
}

.mm-suc-p-page--left .mm-suc-p-page-card {
	max-width: 620px;
}

.mm-suc-p-page--minimal .mm-suc-p-page-card {
	max-width: 760px;
	padding: 32px 0;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

.mm-suc-p-page--minimal .mm-suc-p-page-bg-image {
	opacity: 0.35;
}

.mm-suc-p-page--split .mm-suc-p-page-shell {
	align-items: stretch;
	justify-content: flex-start;
	padding: 0;
}

.mm-suc-p-page--split .mm-suc-p-page-card {
	justify-content: center;
	max-width: 50%;
	min-height: 100%;
	border: 0;
	border-radius: 0;
	padding: 48px;
}

.mm-suc-p-page--split .mm-suc-p-page-bg-veil {
	inset-inline-end: 50%;
}

/* -------------------------------------------------------------------------
 * The editor preview only: inline editing affordances.
 * ---------------------------------------------------------------------- */

.mm-suc-p-page--editing [data-mm-suc-p-part] {
	border-radius: 8px;
	outline-offset: 4px;
	cursor: text;
}

.mm-suc-p-page--editing [data-mm-suc-p-part]:hover {
	outline: 1px solid var(--mm-suc-p-page-line);
}

/*
 * The colour map's ring. Dashed, and the only dashed outline in the product, so
 * "this colour reaches here" never has to be told apart from "you are editing
 * this" or "this has focus" by hue alone. Ink is used because the page's own
 * contract already guarantees it reads against the shaded background.
 */
.mm-suc-p-page [data-mm-suc-p-paint-lit] {
	outline: 2px dashed var(--mm-suc-p-page-ink);
	outline-offset: 3px;
}

.mm-suc-p-page--editing [data-mm-suc-p-part="logo"],
.mm-suc-p-page--editing [data-mm-suc-p-part="countdown"],
.mm-suc-p-page--editing [data-mm-suc-p-part="background"] {
	cursor: pointer;
}

.mm-suc-p-page--editing .mm-suc-p-page-sheet {
	position: absolute;
}

/* -------------------------------------------------------------------------
 * Breakpoints: 1024, 768, 560, 400.
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.mm-suc-p-page--split .mm-suc-p-page-card {
		max-width: 60%;
	}
}

@media (max-width: 768px) {
	.mm-suc-p-page-shell {
		padding: 32px 16px;
	}

	.mm-suc-p-page-card {
		padding: 32px 24px;
	}

	.mm-suc-p-page--split .mm-suc-p-page-shell {
		align-items: center;
		padding: 32px 16px;
	}

	.mm-suc-p-page--split .mm-suc-p-page-card {
		max-width: 100%;
		min-height: 0;
		padding: 32px 24px;
	}

	.mm-suc-p-page--split .mm-suc-p-page-bg-veil {
		inset-inline-end: 0;
	}

	.mm-suc-p-page-sheet-inner {
		width: 100%;
		border-radius: 0;
		padding: 24px 16px;
	}
}

@media (max-width: 560px) {
	.mm-suc-p-page-countdown {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 400px) {
	.mm-suc-p-page-card {
		padding: 24px 16px;
	}

	.mm-suc-p-page-unit {
		padding: 12px 8px;
	}

	.mm-suc-p-page-contact {
		width: 100%;
	}
}

/* -------------------------------------------------------------------------
 * Reduced motion: the resting state of everything that moves.
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.mm-suc-p-page-bg-image,
	.mm-suc-p-page-contact,
	.mm-suc-p-page-sheet-inner {
		transition: none;
	}

	.mm-suc-p-page-sheet[data-state="closing"] .mm-suc-p-page-sheet-inner {
		transform: none;
	}
}
