/*
 * Borealis Essentials — lead form and consent banner.
 * Self-contained (own custom properties) so it works with any theme.
 * Mobile-first; touch targets are at least 48px; inputs use 16px text so iOS
 * does not zoom the page when a field is focused.
 */

:root {
	--bdl-e-ink: #0b1a2e;
	--bdl-e-body: #3d4f66;
	--bdl-e-muted: #64778e;
	--bdl-e-line: #d8e0ea;
	--bdl-e-teal: #2d9c8f;
	--bdl-e-glow: #47d6c0;
	--bdl-e-error: #d92d20;
	--bdl-e-cta: linear-gradient(120deg, #57b14b 0%, #2d9c8f 100%);
	--bdl-e-font-head: var(--wp--preset--font-family--heading, ui-sans-serif, system-ui, sans-serif);
}

/* ---------- Lead form ---------- */

.bdl-form-card {
	position: relative;
	background: #fff;
	color: var(--bdl-e-body);
	border-radius: 20px;
	padding: clamp(22px, 5vw, 32px);
	box-shadow: 0 0 0 1px rgba(71, 214, 192, 0.35), 0 30px 70px -30px rgba(0, 0, 0, 0.65), 0 0 50px -20px rgba(71, 214, 192, 0.5);
	box-sizing: border-box;
	width: 100%;
}
.bdl-form-card :where(p) { margin: 0; }
.bdl-form-title {
	font: 600 1.25rem/1.25 var(--bdl-e-font-head);
	color: var(--bdl-e-ink) !important;
	letter-spacing: -0.015em;
	margin: 0 0 1.1rem !important;
}
.bdl-form { display: grid; gap: 14px; }
.bdl-field { display: grid; gap: 6px; }
.bdl-field label { font-size: 0.875rem; font-weight: 600; color: var(--bdl-e-ink); }
.bdl-field input {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	font: inherit;
	font-size: 16px;
	color: var(--bdl-e-ink);
	background: #f7f9fb;
	border: 1px solid var(--bdl-e-line);
	border-radius: 12px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.bdl-field input::placeholder { color: #98a4b3; }
.bdl-field input:focus {
	outline: none;
	background: #fff;
	border-color: var(--bdl-e-teal);
	box-shadow: 0 0 0 4px rgba(45, 156, 143, 0.18);
}
.bdl-form [aria-invalid="true"] { border-color: var(--bdl-e-error) !important; box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12) !important; }

.bdl-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; line-height: 1.5; color: var(--bdl-e-body); }
.bdl-check input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--bdl-e-teal);
	cursor: pointer;
}
.bdl-check a { color: var(--bdl-e-teal); font-weight: 600; }

.bdl-form-error { color: var(--bdl-e-error); font-size: 0.875rem; font-weight: 600; min-height: 0; }
.bdl-form-error:empty { display: none; }

.bdl-form-submit {
	min-height: 52px;
	width: 100%;
	border: 0;
	border-radius: 12px;
	cursor: pointer;
	font: 600 1rem/1 var(--bdl-e-font-head);
	color: #fff;
	background: var(--bdl-e-cta);
	box-shadow: 0 12px 30px -12px rgba(45, 156, 143, 0.9);
	transition: transform 0.15s ease, filter 0.15s ease;
}
.bdl-form-submit:hover { transform: translateY(-1px); filter: brightness(1.06); }
.bdl-form-submit:disabled { opacity: 0.7; cursor: progress; transform: none; }
.bdl-form-submit:focus-visible { outline: 3px solid var(--bdl-e-glow); outline-offset: 3px; }
.bdl-form-note { font-size: 0.8rem; color: var(--bdl-e-muted); text-align: center; }

.bdl-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.bdl-form-done { text-align: center; padding-block: clamp(32px, 7vw, 48px); outline: none; }
.bdl-form-done::before {
	content: "";
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	/* Two layers: a gradient is an image, so it cannot share one with the check. */
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 26px no-repeat, var(--bdl-e-cta);
	box-shadow: 0 12px 30px -10px rgba(45, 156, 143, 0.9);
}

/* ---------- Consent banner ---------- */

.bdl-cc {
	position: fixed;
	z-index: 99999;
	left: 12px;
	right: 12px;
	bottom: 12px;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	overflow-y: auto;
	box-sizing: border-box;
	padding: 20px;
	border-radius: 18px;
	color: #c6d4e2;
	background: rgba(8, 18, 31, 0.97);
	border: 1px solid rgba(71, 214, 192, 0.28);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 60px -30px rgba(71, 214, 192, 0.6);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	font: 15px/1.55 var(--wp--preset--font-family--body, ui-sans-serif, system-ui, sans-serif);
	transform: translateY(16px);
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}
.bdl-cc.is-open { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .bdl-cc { transition: none; } }
.bdl-cc * { box-sizing: border-box; }
.bdl-cc p { margin: 0; }
.bdl-cc a { color: var(--bdl-e-glow); text-decoration: underline; text-underline-offset: 2px; }

.bdl-cc-title { font: 600 1.05rem/1.3 var(--bdl-e-font-head); color: #fff; margin: 0 0 0.4rem !important; padding-right: 36px; }
.bdl-cc-text { margin-bottom: 0.4rem !important; }
.bdl-cc-more { font-size: 0.85rem; color: #93a6ba; }

.bdl-cc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
/* Accept and Reject share size and weight: refusing must be as easy as accepting. */
.bdl-cc-btn {
	min-height: 48px;
	padding: 10px 14px;
	border-radius: 12px;
	border: 0;
	cursor: pointer;
	font: 600 0.95rem/1.2 var(--bdl-e-font-head);
}
.bdl-cc-accept { background: var(--bdl-e-cta); color: #fff; }
.bdl-cc-reject { background: #eef3f7; color: #0b1a2e; }
.bdl-cc-btn:hover { filter: brightness(1.07); }
.bdl-cc-link {
	grid-column: 1 / -1;
	min-height: 44px;
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 12px;
	color: #e6eef6;
	font: 600 0.9rem/1.2 var(--bdl-e-font-head);
	cursor: pointer;
}
.bdl-cc-link:hover { border-color: rgba(71, 214, 192, 0.6); }
.bdl-cc :focus-visible { outline: 3px solid var(--bdl-e-glow); outline-offset: 2px; }

.bdl-cc-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 0;
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.bdl-cc-cat { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 12px 0; }
.bdl-cc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bdl-cc-cat-name { font-weight: 600; color: #fff; cursor: pointer; }
.bdl-cc-cat-desc { font-size: 0.85rem; color: #9fb2c6; margin-top: 4px !important; }
.bdl-cc-always { font-size: 0.8rem; font-weight: 600; color: #8ae07a; white-space: nowrap; }

/* Switch */
.bdl-cc-switch {
	-webkit-appearance: none;
	appearance: none;
	flex: none;
	width: 46px;
	height: 26px;
	margin: 0;
	border-radius: 999px;
	background: #3a4a5e;
	position: relative;
	cursor: pointer;
	transition: background 0.2s ease;
}
.bdl-cc-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s ease;
}
.bdl-cc-switch:checked { background: #2d9c8f; }
.bdl-cc-switch:checked::after { transform: translateX(20px); }
.bdl-cc-switch:disabled { opacity: 0.4; cursor: not-allowed; }

@media (min-width: 640px) {
	.bdl-cc { left: 20px; right: auto; bottom: 20px; width: 440px; padding: 22px; }
	.bdl-cc-prefs { width: 480px; }
}
