@font-face {
	font-family: "Styrene B LC";
	src:
		url("fonts/styreneblc-regular.woff2") format("woff2"),
		url("fonts/styreneblc-regular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Styrene B LC";
	src:
		url("fonts/styreneblc-bold.woff2") format("woff2"),
		url("fonts/styreneblc-bold.woff") format("woff");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family:
		"Styrene B LC",
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		Helvetica,
		Arial,
		sans-serif;
	background: transparent;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1a1a1a;
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
}

.hidden {
	display: none !important;
}

/* ─── Overlay ─── */

.overlay {
	width: 100%;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: #d0d0d0;
}

/* ─── Card ─── */

.card {
	position: relative;
	background: #fff;
	border-radius: 24px;
	width: 100%;
	max-width: 752px;
	padding: 40px;
}

/* ─── Close button ─── */

.close-btn {
	position: absolute;
	top: -12px;
	right: 0;
	border-radius: 50%;
	border: 1px solid #000;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s;
	opacity: 1;
	padding: 11px;
	top: -46px;
	background: transparent;
}

.close-btn:hover {
	opacity: 0.7;
}

/* ─── Form card ─── */

.card__title {
	font-size: 22px;
	line-height: 26px;
	font-weight: 700;
	margin-bottom: 16px;
	color: #0f0f0f;
}

.card__subtitle {
	font-size: 16px;
	color: #0f0f0f;
	margin-bottom: 24px;
	line-height: 24px;
}

/* ─── Inputs ─── */

.content {
	max-width: 558px;
	margin: 0 auto;
}

.form-group {
	margin-bottom: 16px;
}

.form-row {
	display: flex;
	gap: 16px;
	justify-content: space-between;
	margin-bottom: 24px;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
	width: 100%;
	padding: 19px 12px;
	font-size: 14px;
	border: 1px solid #cbced0;
	border-radius: 4px;
	background: #f0f0f0;
	color: #000;
	outline: none;
	height: 56px;
	transition:
		box-shadow 0.15s,
		background 0.15s;
}

input::placeholder {
	color: #3c3c43a8;
}

input:focus {
	background: #e8e8e8;
	box-shadow: 0 0 0 2px #ef3124;
}

input.invalid {
	box-shadow: 0 0 0 2px #ef3124;
	background: #fff5f5;
}

/* ─── Checkboxes ─── */

.checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	max-width: 271px;
	height: fit-content;
}

.checkbox input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.checkbox__mark {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	border: 1px solid #919198;
	border-radius: 4px;
	background: #fff;
	transition:
		background 0.15s,
		border-color 0.15s;
	position: relative;
}

.checkbox input:checked + .checkbox__mark {
	background: #ef3124;
	border-color: #ef3124;
}

.checkbox input:checked + .checkbox__mark::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 5px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.checkbox__text {
	color: #919198;
	font-size: 12px;
}

.footer {
	display: flex;
	justify-content: space-between;
	gap: 16px;
}

/* ─── Submit / CTA button ─── */

.submit-btn {
	display: block;
	width: 100%;
	padding: 16px;
	font-size: 16px;
	line-height: 24px;
	color: #fff;
	background: #ef3124;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	height: fit-content;
	transition: opacity 0.2s;
	max-width: 271px;
	height: 56px;
	font-family: "Styrene B LC";
}

.submit-btn:hover {
	opacity: 0.8;
}

.submit-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* ─── Loading card ─── */

.card--loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 35px;
	gap: 16px;
	max-width: 383px;
}

.loading__text {
	font-size: 16px;
	line-height: 24px;
	letter-spacing: 0px;
	color: #0f0f0f;
	white-space: nowrap;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #f0e0df;
	border-top-color: #ef3124;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* ─── Success card ─── */

.card--success {
	text-align: center;
	padding: 40px;
	max-width: 383px;
}

.success__title {
	font-size: 22px;
	line-height: 26px;
	font-weight: 700;
	margin-bottom: 16px;
	color: #0f0f0f;
}

.success__text {
	font-size: 16px;
	line-height: 24px;
	color: #0f0f0f;
	margin-bottom: 24px;
}

.field-wrap {
	position: relative;
	width: 100%;
}

.form-row .field-wrap {
	max-width: 271px;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
	padding: 24px 12px 8px;
}

.field-wrap label {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 14px;
	color: #3c3c43a8;
	pointer-events: none;
	transition:
		top 0.15s,
		font-size 0.15s,
		color 0.15s,
		transform 0.15s;
}

.field-wrap input:focus + label,
.field-wrap input:not(:placeholder-shown) + label,
.field-wrap input.has-value + label {
	top: 7px;
	transform: translateY(0);
	color: #3c3c43a8;
}

@media (max-width: 480px) {
	.overlay {
		padding: 0;
	}

	.overlay:has(#formCard:not(.hidden)) {
		align-items: flex-end;
	}

	.close-btn {
		right: 16px;
	}

	.card {
		padding: 40px 16px;
	}

	.card--form {
		border-radius: 0;
		border-top-left-radius: 24px;
		border-top-right-radius: 24px;
	}

	.card__title {
		font-size: 20px;
	}

	.card__subtitle {
		font-size: 16px;
	}

	.form-row {
		flex-direction: column;
	}

	.form-row .field-wrap {
		max-width: 100%;
	}

	input[type="email"],
	input[type="tel"],
	input[type="text"] {
		max-width: 100%;
	}

	.footer {
		flex-direction: column;
		gap: 24px;
	}

	.submit-btn {
		max-width: 100%;
	}

	.card--loading {
		padding: 40px 16px;
	}
}

.final-btn {
	margin: 0 auto;
	max-width: 303px;
	white-space: nowrap;
}
