/**
 * Global elements (CGS Design System, Figma page "07 — Global Elements").
 *
 * Sticky mobile CTA, form notices, empty states and the 404 page. Loaded on every
 * page after main.css. Values follow the design system tokens, so these pieces
 * already match the new look while the rest of the site still uses main.css.
 *
 * @package CGS
 */

:root {
	--cgs-ge-ink: #111111;
	--cgs-ge-body: #333333;
	--cgs-ge-muted: #6d6c6b;
	--cgs-ge-border: #e1e1e1;
	--cgs-ge-paper: #f8f8f8;
	--cgs-ge-page: #ffffff;
	--cgs-ge-mint: #00ad96;
	--cgs-ge-mint-dark: #007d6c;
	--cgs-ge-success-bg: #e6f6f3;
	--cgs-ge-error-text: #a3352a;
	--cgs-ge-error-bg: #fbe9e7;
	--cgs-ge-radius: 8px;
	--cgs-ge-radius-card: 20px;
	--cgs-ge-display: "Poppins", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--cgs-ge-sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--cgs-ge-focus: 0 0 0 2px var(--cgs-ge-page), 0 0 0 4px var(--cgs-ge-mint-dark);
}

/* ---------------------------------------------------------------------------
 * Buttons (Button / MD: 48px, black primary, quiet secondary)
 * ------------------------------------------------------------------------- */

.cgs-ge-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid transparent;
	border-radius: var(--cgs-ge-radius);
	font-family: var(--cgs-ge-sans);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.cgs-ge-button:focus-visible {
	outline: none;
	box-shadow: var(--cgs-ge-focus);
}

.cgs-ge-button--primary {
	background-color: var(--cgs-ge-ink);
	color: var(--cgs-ge-page);
}

.cgs-ge-button--primary:hover {
	background-color: #000000;
	color: var(--cgs-ge-page);
}

.cgs-ge-button--secondary {
	background-color: var(--cgs-ge-page);
	border-color: var(--cgs-ge-border);
	color: var(--cgs-ge-ink);
}

.cgs-ge-button--secondary:hover {
	border-color: var(--cgs-ge-ink);
	color: var(--cgs-ge-ink);
}

/* ---------------------------------------------------------------------------
 * Form notice (.cgs-contact-block__notice / .cgs-form__notice)
 * Two tones, as in the code: success and error. Stays until the next submit.
 * ------------------------------------------------------------------------- */

.cgs-contact-block__notice--success,
.cgs-contact-block__notice--error {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 16px;
	border: 0;
	border-radius: var(--cgs-ge-radius);
	font-family: var(--cgs-ge-sans);
	font-size: 16px;
	line-height: 1.5;
}

.cgs-contact-block__notice--success::before,
.cgs-contact-block__notice--error::before {
	content: "";
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	background-color: currentColor;
	-webkit-mask: var(--cgs-ge-notice-icon) center / 24px no-repeat;
	mask: var(--cgs-ge-notice-icon) center / 24px no-repeat;
}

.cgs-contact-block__notice--success {
	--cgs-ge-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
	background-color: var(--cgs-ge-success-bg);
	color: var(--cgs-ge-mint-dark);
}

.cgs-contact-block__notice--error {
	--cgs-ge-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4L2.5 20h19L12 4z'/%3E%3Cpath d='M12 10v4.5M12 17.5v.01'/%3E%3C/svg%3E");
	background-color: var(--cgs-ge-error-bg);
	color: var(--cgs-ge-error-text);
}

/* ---------------------------------------------------------------------------
 * Empty state
 * ------------------------------------------------------------------------- */

.cgs-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	max-width: 560px;
	margin: 0 auto;
	padding: 48px 28px;
	border-radius: var(--cgs-ge-radius-card);
	background-color: var(--cgs-ge-paper);
	text-align: center;
	font-family: var(--cgs-ge-sans);
}

.cgs-empty-state__icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: var(--cgs-ge-page);
	color: var(--cgs-ge-muted);
}

.cgs-empty-state__title {
	margin: 0;
	font-family: var(--cgs-ge-display);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--cgs-ge-ink);
}

.cgs-empty-state__body {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	color: var(--cgs-ge-body);
}

/* ---------------------------------------------------------------------------
 * 404
 * ------------------------------------------------------------------------- */

.cgs-404 {
	padding: 120px 20px;
	font-family: var(--cgs-ge-sans);
}

.cgs-404__inner {
	max-width: 860px;
	margin: 0 auto;
}

.cgs-404__inner > * {
	max-width: 700px;
}

.cgs-404__kicker {
	margin: 0 0 16px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cgs-ge-muted);
}

.cgs-404 .cgs-404__title {
	margin: 0 0 20px;
	font-family: var(--cgs-ge-display);
	font-size: 49px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--cgs-ge-ink);
}

.cgs-404 .cgs-404__message {
	max-width: 700px;
	margin: 0 0 32px;
	font-size: 20px;
	line-height: 1.5;
	color: var(--cgs-ge-body);
}

.cgs-404__links {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	margin: 0 0 40px;
	padding: 0;
	list-style: none;
}

.cgs-404__links a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 24px;
	padding-bottom: 2px;
	border-bottom: 2px solid var(--cgs-ge-mint);
	font-size: 16px;
	font-weight: 700;
	color: var(--cgs-ge-ink);
	text-decoration: none;
	transition: color 200ms ease;
}

.cgs-404__links a:hover {
	color: var(--cgs-ge-mint-dark);
}

.cgs-404__links a:focus-visible {
	outline: none;
	box-shadow: var(--cgs-ge-focus);
	border-radius: 2px;
}

.cgs-404__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

@media (max-width: 599px) {
	.cgs-404 {
		padding: 72px 16px;
	}

	.cgs-404 .cgs-404__title {
		font-size: 31px;
	}

	.cgs-404 .cgs-404__message {
		font-size: 16px;
	}

	.cgs-404__links {
		flex-direction: column;
		align-items: flex-start;
	}

	.cgs-404__actions {
		flex-direction: column;
	}

	.cgs-404__actions .cgs-ge-button {
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Sticky mobile CTA (phones only)
 * ------------------------------------------------------------------------- */

.cgs-sticky-cta {
	display: none;
}

@media (max-width: 767px) {
	.cgs-sticky-cta {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 90;
		display: flex;
		gap: 12px;
		align-items: center;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid var(--cgs-ge-border);
		background-color: var(--cgs-ge-page);
		box-shadow: 0 -8px 24px rgba(17, 17, 17, 0.08);
		opacity: 0;
		transform: translateY(8px);
		visibility: hidden;
		transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 200ms;
	}

	.cgs-sticky-cta.is-visible {
		opacity: 1;
		transform: none;
		visibility: visible;
		transition: opacity 200ms ease, transform 200ms ease, visibility 0s;
	}

	.cgs-sticky-cta__main {
		flex: 1 1 auto;
	}

	.cgs-sticky-cta__call {
		flex: 0 0 48px;
		width: 48px;
		padding: 0;
		color: var(--cgs-ge-ink);
	}

	body.cgs-has-sticky-cta {
		padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
	.cgs-sticky-cta,
	.cgs-sticky-cta.is-visible {
		transform: none;
	}
}
