/*
 * Waiting page. Three designs share one markup: the body class picks the design.
 * Logical properties only, so RTL works without overrides.
 * The four colour variables are overridden inline from the plugin settings.
 */

/* ---------------------------------------------------------------------------
 * Base (shared by every design)
 * ------------------------------------------------------------------------ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

:root {
	--ecs-bg: #0b0d12;
	--ecs-text: #f2f4f8;
	--ecs-button: #25d366;
	--ecs-button-text: #0b0d12;
	--ecs-surface: var(--ecs-bg);
	--ecs-overlay: #0b0d12;
	--ecs-overlay-opacity: 0.6;
	--ecs-image-position: center center;
	--ecs-logo-size: 180px;
	--ecs-line: color-mix(in srgb, var(--ecs-text) 14%, transparent);
	--ecs-soft: color-mix(in srgb, var(--ecs-text) 72%, transparent);
	--ecs-gutter: clamp(1.25rem, 5vw, 4rem);
}

html,
body {
	margin: 0;
}

body {
	background: var(--ecs-bg);
	color: var(--ecs-text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
}

.ecs-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}

/* Background layers, back to front: image, overlay, glows. */
.ecs-bg__image,
.ecs-bg__overlay,
.ecs-bg__glow {
	position: absolute;
	inset: 0;
}

.ecs-bg__image {
	background-position: var(--ecs-image-position);
	background-repeat: no-repeat;
	background-size: cover;
}

.ecs-bg__overlay {
	background: var(--ecs-overlay);
	opacity: var(--ecs-overlay-opacity);
}

/* Particles: above the overlay, behind the content, never catching clicks. */
.ecs-particles {
	position: fixed;
	inset: 0;
	z-index: 0;
	inline-size: 100%;
	block-size: 100%;
	pointer-events: none;
}

.ecs-shell {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-rows: auto 1fr auto;
	min-block-size: 100vh;
	min-block-size: 100dvh;
}

.ecs-header {
	display: flex;
	padding-block: 2rem 0;
	padding-inline: var(--ecs-gutter);
}

/*
 * Logo: the width comes from the settings, but never more than 70 % of the
 * screen width or 30 % of its height. object-fit keeps the proportions.
 */
.ecs-logo {
	display: block;
	inline-size: min(var(--ecs-logo-size), 70vw);
	block-size: auto;
	max-block-size: 30vh;
	object-fit: contain;
}

.ecs-t-split .ecs-logo {
	object-position: left center;
}

[dir="rtl"] .ecs-t-split .ecs-logo {
	object-position: right center;
}

.ecs-wordmark {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}

.ecs-main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1.5rem;
	padding-block: 3rem;
	padding-inline: var(--ecs-gutter);
}

.ecs-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding-block: 0.375rem;
	padding-inline: 0.875rem;
	border: 1px solid var(--ecs-line);
	border-radius: 999px;
	color: var(--ecs-soft);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ecs-badge__dot {
	inline-size: 0.5rem;
	block-size: 0.5rem;
	border-radius: 50%;
	background: var(--ecs-button);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ecs-button) 22%, transparent);
}

/*
 * Title. Size, line width and alignment can be changed in the settings:
 * --ecs-title-scale (1 = normal), --ecs-title-width (only set when it is not
 * the default) and the body classes ecs-title-left / -center / -right.
 */
.ecs-title {
	margin: 0;
	max-inline-size: min(var(--ecs-title-width, 18ch), 100%);
	font-size: calc(clamp(2.125rem, 6vw, 3.75rem) * var(--ecs-title-scale, 1));
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-wrap: balance;
	overflow-wrap: break-word;
}

/* Alignment chosen in the settings. Auto margins place the block inside the column. */
.ecs-title-left .ecs-title {
	margin-left: 0;
	margin-right: auto;
	text-align: left;
}

.ecs-title-center .ecs-title {
	margin-inline: auto;
	text-align: center;
}

.ecs-title-right .ecs-title {
	margin-left: auto;
	margin-right: 0;
	text-align: right;
}

.ecs-text {
	max-inline-size: 44ch;
	color: var(--ecs-soft);
	font-size: 1.125rem;
}

.ecs-text p {
	margin-block: 0 0.75em;
}

.ecs-text p:last-child {
	margin-block-end: 0;
}

.ecs-text a {
	color: var(--ecs-text);
}

.ecs-button {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	padding-block: 0.875rem;
	padding-inline: 1.5rem;
	border-radius: 999px;
	background: var(--ecs-button);
	color: var(--ecs-button-text);
	font-weight: 600;
	text-decoration: none;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.ecs-button__icon {
	flex: none;
}

.ecs-button:hover,
.ecs-button:focus-visible {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.ecs-button:focus-visible,
.ecs-text a:focus-visible {
	outline: 2px solid var(--ecs-text);
	outline-offset: 3px;
}

/* Countdown: four equal boxes that shrink with the screen. */
.ecs-countdown {
	inline-size: min(100%, 26rem);
}

.ecs-countdown__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(0.375rem, 2vw, 0.875rem);
}

.ecs-countdown__unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.375rem;
	min-inline-size: 0;
	padding-block: 0.875rem;
	padding-inline: 0.25rem;
	border: 1px solid var(--ecs-line);
	border-radius: 16px;
	background: color-mix(in srgb, var(--ecs-text) 6%, transparent);
	text-align: center;
}

.ecs-countdown__value {
	font-size: clamp(1.375rem, 6.5vw, 2.25rem);
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.ecs-countdown__label {
	max-inline-size: 100%;
	overflow: hidden;
	color: var(--ecs-soft);
	font-size: clamp(0.5625rem, 2.4vw, 0.6875rem);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-overflow: ellipsis;
	text-transform: uppercase;
}

.ecs-countdown__done {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
}

/* Phone and e-mail */
.ecs-contacts,
.ecs-social {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ecs-contacts {
	gap: 0.25rem 1.5rem;
	font-size: 1rem;
}

.ecs-contacts a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-block-size: 44px;
	color: var(--ecs-text);
	text-decoration: none;
}

/* Only the text is underlined, not the icon. */
.ecs-contacts a > bdi,
.ecs-contacts a > span {
	text-decoration: underline;
	text-decoration-color: var(--ecs-line);
	text-underline-offset: 0.25em;
	overflow-wrap: anywhere;
}

.ecs-contacts a:hover > bdi,
.ecs-contacts a:hover > span,
.ecs-contacts a:focus-visible > bdi,
.ecs-contacts a:focus-visible > span {
	text-decoration-color: currentColor;
}

.ecs-contacts__icon {
	flex: none;
	inline-size: 1em;
	block-size: 1em;
	/* Same colour as the text, so the icon is readable on any background. */
	opacity: 0.85;
}

/* Social icons: 44px touch targets */
.ecs-social {
	gap: 0.5rem;
}

.ecs-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 44px;
	block-size: 44px;
	border: 1px solid var(--ecs-line);
	border-radius: 50%;
	color: var(--ecs-text);
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ecs-social__link:hover,
.ecs-social__link:focus-visible {
	border-color: var(--ecs-text);
	background: color-mix(in srgb, var(--ecs-text) 12%, transparent);
}

.ecs-contacts a:focus-visible,
.ecs-social__link:focus-visible {
	outline: 2px solid var(--ecs-text);
	outline-offset: 3px;
}

.ecs-footer {
	padding-block: 1.5rem;
	padding-inline: var(--ecs-gutter);
	color: var(--ecs-soft);
	font-size: 0.875rem;
}

.ecs-art {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Design 1: Minimal — centred and quiet
 * ------------------------------------------------------------------------ */
.ecs-t-minimal .ecs-shell {
	text-align: center;
}

.ecs-t-minimal .ecs-header {
	justify-content: center;
	padding-block-start: 2.5rem;
}

.ecs-t-minimal .ecs-main {
	align-items: center;
}

.ecs-t-minimal .ecs-contacts,
.ecs-t-minimal .ecs-social,
.ecs-t-aurora .ecs-contacts,
.ecs-t-aurora .ecs-social {
	justify-content: center;
}

/*
 * Weak overlay on an image: the picture is unknown, so the text is light
 * and sits on a soft dark scrim.
 */
.ecs-has-scrim.ecs-t-minimal .ecs-main {
	background: radial-gradient(ellipse closest-side at center, rgba(11, 13, 18, 0.66), rgba(11, 13, 18, 0.42) 60%, transparent 100%);
}

/* Soft dark bands behind the logo (top) and the footer (bottom). */
.ecs-has-scrim .ecs-shell::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to bottom, rgba(11, 13, 18, 0.6), transparent 9rem, transparent calc(100% - 8rem), rgba(11, 13, 18, 0.7));
	pointer-events: none;
}

.ecs-has-scrim .ecs-footer {
	color: var(--ecs-text);
}

.ecs-has-scrim .ecs-header,
.ecs-has-scrim .ecs-footer,
.ecs-has-scrim.ecs-t-minimal .ecs-main {
	text-shadow: 0 1px 3px rgba(11, 13, 18, 0.75);
}

.ecs-has-scrim.ecs-t-minimal .ecs-button {
	text-shadow: none;
}

/* ---------------------------------------------------------------------------
 * Design 2: Aurora — colour glows behind a glass card
 * ------------------------------------------------------------------------ */
.ecs-t-aurora .ecs-bg__glow::before,
.ecs-t-aurora .ecs-bg__glow::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	filter: blur(90px);
}

.ecs-t-aurora .ecs-bg__glow::before {
	inset-block-start: -22vmax;
	inset-inline-start: -16vmax;
	inline-size: 58vmax;
	block-size: 58vmax;
	background: var(--ecs-button);
	opacity: 0.3;
	animation: ecs-drift 16s ease-in-out infinite alternate;
}

.ecs-t-aurora .ecs-bg__glow::after {
	inset-block-end: -24vmax;
	inset-inline-end: -16vmax;
	inline-size: 54vmax;
	block-size: 54vmax;
	background: #7c5cff;
	opacity: 0.32;
	animation: ecs-drift 20s ease-in-out infinite alternate-reverse;
}

@keyframes ecs-drift {
	from {
		transform: translate3d(0, 0, 0) scale(1);
	}

	to {
		transform: translate3d(0, 4vmax, 0) scale(1.12);
	}
}

.ecs-t-aurora .ecs-shell {
	text-align: center;
}

.ecs-t-aurora .ecs-header {
	justify-content: center;
}

.ecs-t-aurora .ecs-main {
	align-items: center;
	align-self: center;
	justify-self: center;
	inline-size: min(46rem, 100% - 2.5rem);
	margin-block: 2rem;
	padding-block: clamp(2.5rem, 6vw, 4rem);
	padding-inline: clamp(1.5rem, 5vw, 3.5rem);
	border: 1px solid var(--ecs-line);
	border-radius: 28px;
	background: color-mix(in srgb, var(--ecs-surface) 55%, transparent);
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
}

/* On a photo the glass card is more opaque, to keep the text readable. */
.ecs-has-image.ecs-t-aurora .ecs-main {
	background: color-mix(in srgb, var(--ecs-surface) 72%, transparent);
}

.ecs-t-aurora .ecs-title {
	background: linear-gradient(120deg, var(--ecs-text) 35%, color-mix(in srgb, var(--ecs-button) 70%, var(--ecs-text)));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	/* Room for descenders, which the clipped gradient would otherwise cut. */
	padding-block-end: 0.12em;
}

.ecs-t-aurora .ecs-button {
	box-shadow: 0 12px 40px -12px color-mix(in srgb, var(--ecs-button) 75%, transparent);
}

/* ---------------------------------------------------------------------------
 * Design 3: Split — text on one side, artwork on the other
 * ------------------------------------------------------------------------ */
.ecs-t-split .ecs-shell {
	grid-template-rows: auto auto 1fr auto;
	grid-template-areas:
		"header"
		"art"
		"main"
		"footer";
}

.ecs-t-split .ecs-header {
	grid-area: header;
}

.ecs-t-split .ecs-main {
	grid-area: main;
	align-items: flex-start;
}

.ecs-t-split .ecs-footer {
	grid-area: footer;
}

.ecs-t-split .ecs-title {
	max-inline-size: min(var(--ecs-title-width, 14ch), 100%);
}

.ecs-t-split .ecs-art {
	grid-area: art;
	position: relative;
	display: block;
	min-block-size: 11rem;
	margin-block: 1.5rem 0;
	margin-inline: var(--ecs-gutter);
	overflow: hidden;
	border: 1px solid var(--ecs-line);
	border-radius: 24px;
	background: linear-gradient(160deg, color-mix(in srgb, var(--ecs-button) 24%, var(--ecs-bg)), var(--ecs-bg) 75%);
}

/* Grid lines, fading towards the edges. */
.ecs-t-split .ecs-art::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(var(--ecs-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--ecs-line) 1px, transparent 1px);
	background-size: 44px 44px;
	-webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 78%);
	mask-image: radial-gradient(ellipse at center, #000 25%, transparent 78%);
}

/* Glowing orb with two rings. */
.ecs-t-split .ecs-art::after {
	content: "";
	position: absolute;
	inset: 0;
	inline-size: min(38%, 15rem);
	aspect-ratio: 1;
	block-size: auto;
	margin: auto;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--ecs-button) 60%, #fff), var(--ecs-button) 48%, color-mix(in srgb, var(--ecs-button) 45%, var(--ecs-bg)));
	box-shadow:
		0 0 0 1.75rem color-mix(in srgb, var(--ecs-button) 12%, transparent),
		0 0 0 4rem color-mix(in srgb, var(--ecs-button) 6%, transparent),
		0 0 7rem color-mix(in srgb, var(--ecs-button) 55%, transparent);
}

/* Split with a background image: the image fills the artwork panel. */
.ecs-t-split .ecs-art--image {
	background-position: var(--ecs-image-position);
	background-repeat: no-repeat;
	background-size: cover;
}

.ecs-t-split .ecs-art--image::before {
	background: var(--ecs-overlay);
	opacity: var(--ecs-overlay-opacity);
	-webkit-mask-image: none;
	mask-image: none;
}

.ecs-t-split .ecs-art--image::after {
	content: none;
}

@media (min-width: 60rem) {
	.ecs-t-split .ecs-shell {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
		grid-template-rows: auto 1fr auto;
		grid-template-areas:
			"header art"
			"main   art"
			"footer art";
	}

	.ecs-t-split .ecs-art {
		margin: 1rem;
		border-radius: 28px;
	}
}

/* ---------------------------------------------------------------------------
 * Accessibility
 * ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
