@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700&display=swap');

/* ─── Design Tokens ─── */
:root {
	--bg: #000000;
	--card-bg: #111111;
	--text-main: #FFFFFF;
	--text-muted: #888888;
	--white: #FFFFFF;
	--gray-dark: #222222;
	--gray-light: #444444;
	--error: #FF4444;
	--radius-full: 9999px;
	--radius-md: 12px;
	--ease: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	-webkit-font-smoothing: antialiased;
}

/* ─── Base ─── */
/* Body rule moved to bottom for better organization with responsive styles */

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: var(--gray-dark);
	border-radius: 4px;
}

/* ─── Page Container ─── */
.form-page {
	width: 100%;
	max-width: 650px;
}

/* ─── Card Shell ─── */
.form-card {
	background: var(--card-bg);
	border-radius: 24px;
	border: 2px solid rgba(255, 255, 255, 0.2);
	display: flex;
	flex-direction: column;
	height: 80vh;
	max-height: 800px;
	overflow: hidden;
	padding: 0;
	position: relative;
	z-index: 1;
}

/* ─── Header & Footer (anchored) ─── */
.form-header {
	padding: 3rem 3rem 1rem 3rem;
	flex-shrink: 0;
	background: var(--card-bg);
	z-index: 2;
}

.form-footer {
	padding: 1rem 3rem 3rem 3rem;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1.25rem;
	background: var(--card-bg);
	z-index: 2;
}

.form-footer-buttons {
	display: flex;
	justify-content: flex-end;
	gap: 1rem;
	width: 100%;
}

.legal-consent {
	font-size: 0.8rem;
	color: var(--text-muted);
	text-align: right;
	width: 100%;
}

.legal-consent a {
	color: var(--text-muted);
	text-decoration: underline;
}

.legal-consent a:hover {
	color: var(--text-main);
}

/* ─── Carousel (multi-step forms) ─── */
.carousel-viewport {
	flex: 1;
	height: 0;
	min-height: 0;
	overflow: hidden;
	position: relative;
	width: 100%;
	background: var(--card-bg);
	transition: height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-track {
	display: flex;
	width: 100%;
	height: 100%;
	transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
	align-items: stretch;
}

.step-card {
	width: 100%;
	flex-shrink: 0;
	min-height: 0;
	margin: 0;
	border: none;
	background: transparent;
	padding: 0;
	display: flex;
	flex-direction: column;
}

/* Hide header/footer if accidentally nested inside steps */
.step-card .form-header,
.step-card .form-footer {
	display: none;
}

/* ─── Scrollable Content Area ─── */
.form-scroll-area {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 3rem 2rem 3rem;
}

.form-scroll-area>ul,
.form-scroll-area>form>ul {
	margin: 0 0 1.5rem 0;
	padding-left: 1.5rem;
	list-style: disc;
}

/* ─── Typography ─── */
.form-title {
	font-size: 2.2rem;
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.step-indicator {
	color: var(--text-muted);
	font-size: 1rem;
	font-weight: 500;
	margin-bottom: 1rem;
}

.form-subtitle {
	font-size: 1.4rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
	color: var(--text-main);
	opacity: 0.9;
}

.form-desc {
	color: var(--text-main);
	font-size: 1rem;
	margin-bottom: 2.5rem;
}

a {
	color: var(--text-main);
}

a:hover {
	opacity: 0.5;
}

/* ─── Field Groups ─── */
.field-group {
	margin-bottom: 2rem;
}

.field-label {
	display: block;
	font-weight: 500;
	font-size: 0.95rem;
	margin-bottom: 0.75rem;
}

.optional-mark {
	color: var(--text-muted);
	font-weight: 400;
	font-size: 0.85rem;
	opacity: 0.5;
	margin-left: 6px;
	font-style: normal;
}

.field-hint {
	font-size: 0.85rem;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
}

.field-error {
	color: var(--error);
	font-size: 0.85rem;
	margin-top: 0.5rem;
	display: none;
}

.email-warning {
	margin-top: 0.5rem;
	font-size: 0.85rem;
	color: #ffb400;
	display: none;
}

/* ─── Mini Checkbox ─── */
.checkbox-mini {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.75rem;
	cursor: pointer;
	position: relative;
}

.checkbox-mini input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.checkbox-mini label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.85rem;
	color: var(--text-muted);
	/* transition: var(--ease); */
}

.checkbox-mini label::before {
	content: '';
	width: 16px;
	height: 16px;
	border-radius: 4px;
	border: 2px solid var(--gray-light);
	flex-shrink: 0;
}

.checkbox-mini:hover label {
	color: var(--text-main);
}

.checkbox-mini:hover label::before {
	border-color: var(--text-muted);
}

.checkbox-mini input[type="checkbox"]:checked+label::before {
	background: var(--white);
	border-color: var(--white);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
	background-size: 10px;
	background-position: center;
	background-repeat: no-repeat;
}

.checkbox-mini input[type="checkbox"]:checked+label {
	color: var(--text-main);
}

/* ─── Inputs & Textareas ─── */
input[type="text"],
textarea {
	width: 100%;
	background: var(--gray-dark);
	border-radius: var(--radius-md);
	border: none;
	color: var(--text-main);
	font-family: 'Rubik', sans-serif;
	font-size: 1rem;
	padding: 1rem 1.25rem;
	/* transition: var(--ease); */
	/* outline: none; */
}

/* input[type="text"]:focus,
textarea:focus {
	background-color: #2a2a2a;
} */

textarea {
	min-height: 120px;
	resize: vertical;
}

/* ─── Custom Dropdown ─── */
.custom-select {
	position: relative;
	width: 100%;
}

.custom-select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: var(--gray-dark);
	border: 2px solid transparent;
	border-radius: var(--radius-md);
	color: var(--text-main);
	font-family: 'Rubik', sans-serif;
	font-size: 1rem;
	padding: 1rem 1.25rem;
	cursor: pointer;
	/* transition: var(--ease); */
	user-select: none;
}

.custom-select-trigger:hover {
	border-color: var(--gray-light);
}

.custom-select.open .custom-select-trigger {
	border-color: rgba(255, 255, 255, 0.4);
	background: #2a2a2a;
	border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.custom-select-trigger .placeholder {
	color: var(--text-muted);
}

.custom-select-chevron {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	/* transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); */
	stroke: var(--text-muted);
}

.custom-select.open .custom-select-chevron {
	transform: rotate(180deg);
	stroke: var(--white);
}

.custom-select-options {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #2a2a2a;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top: 1px solid var(--gray-light);
	border-radius: 0 0 var(--radius-md) var(--radius-md);
	z-index: 10;
	max-height: 0;
	overflow: hidden;
	/* transition: max-height 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.2s ease; */
	opacity: 0;
}

.custom-select.open .custom-select-options {
	max-height: 300px;
	opacity: 1;
	overflow-y: auto;
}

.custom-select-option {
	padding: 0.9rem 1.25rem;
	cursor: pointer;
	/* transition: background 0.15s ease; */
	font-size: 1rem;
	color: var(--text-main);
}

.custom-select-option:hover {
	background: rgba(255, 255, 255, 0.08);
}

.custom-select-option.selected {
	background: rgba(255, 255, 255, 0.12);
	font-weight: 500;
}

/* ─── Buttons ─── */
button,
.btn-primary {
	background: var(--white);
	color: #000000;
	border: none;
	border-radius: var(--radius-full);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: 'Rubik', sans-serif;
	font-weight: 700;
	font-size: 1rem;
	padding: 1rem 2.5rem;
	/* transition: var(--ease); */
	text-decoration: none;
	width: auto;
}

button:hover,
.btn-primary:hover {
	opacity: 0.7;
}

button:active,
.btn-primary:active {
	opacity: 0.5;
}

.btn-secondary {
	background: transparent;
	color: var(--text-muted);
	border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
	color: var(--white);
	border-color: var(--white);
	background: rgba(255, 255, 255, 0.05);
	opacity: 1;
}

/* ─── Radio Options ─── */
.field-body .radio-option {
	display: block;
	position: relative;
	margin-bottom: 0.75rem;
}

.field-body .radio-option label {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: var(--gray-dark);
	padding: 1.25rem;
	border-radius: var(--radius-md);
	cursor: pointer;
	/* transition: var(--ease); */
	border: 2px solid transparent;
}

.field-body input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

/* Radio indicator circle */
.field-body .radio-option label::before {
	content: '';
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid var(--gray-light);
	flex-shrink: 0;
	/* transition: var(--ease); */
	box-shadow: inset 0 0 0 0px var(--white);
}

.field-body input[type="radio"]:checked+label {
	border-color: rgba(255, 255, 255, 0.3);
	background: #2a2a2a;
}

.field-body input[type="radio"]:checked+label::before {
	border-color: var(--white);
	box-shadow: inset 0 0 0 6px var(--white);
}

.field-body .radio-option:hover label {
	background: #2a2a2a;
}

.field-body .radio-option:hover label::before {
	border-color: var(--text-muted);
}

/* ─── Checkbox ─── */
.field-body .checkbox-option {
	display: block;
	position: relative;
	margin-bottom: 0.75rem;
}

.field-body .checkbox-option label {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: var(--gray-dark);
	padding: 1.25rem;
	border-radius: var(--radius-md);
	cursor: pointer;
	/* transition: var(--ease); */
	border: 2px solid transparent;
}

.field-body input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

/* Checkbox indicator square */
.field-body .checkbox-option label::before {
	content: '';
	width: 22px;
	height: 22px;
	border-radius: 6px;
	border: 2px solid var(--gray-light);
	flex-shrink: 0;
	/* transition: var(--ease); */
	background: transparent;
}

.field-body input[type="checkbox"]:checked+label {
	border-color: rgba(255, 255, 255, 0.3);
	background: #2a2a2a;
}

.field-body input[type="checkbox"]:checked+label::before {
	background: var(--white);
	border-color: var(--white);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
	background-size: 14px;
	background-position: center;
	background-repeat: no-repeat;
}

.field-body .checkbox-option:hover label {
	background: #2a2a2a;
}

.field-body .checkbox-option:hover label::before {
	border-color: var(--text-muted);
}

/* ─── Info Card (Notes) ─── */
.info-card {
	background: rgba(255, 255, 255, 0.05);
	padding: 1.5rem;
	border-radius: var(--radius-md);
	margin-bottom: 2.5rem;
}

.info-card b {
	display: block;
	margin-bottom: 0.5rem;
	color: var(--white);
}

.info-card ul {
	padding-left: 1.25rem;
}

.info-card li {
	margin-bottom: 0.25rem;
	color: var(--text-muted);
}

/* ─── Section Divider ─── */
.section-divider {
	margin-bottom: 2rem;
}

.section-divider h2 {
	font-size: 1.2rem;
	font-weight: 600;
}

/* ─── File Upload ─── */
.file-upload-label {
	display: block;
	background: var(--gray-dark);
	padding: 1.25rem;
	border-radius: var(--radius-md);
	text-align: center;
	cursor: pointer;
	color: var(--text-muted);
	border: 1px dashed var(--gray-light);
	/* transition: var(--ease); */
}

.file-upload-label:hover {
	background: #2a2a2a;
	color: var(--white);
}

input[type="file"] {
	display: none;
}

/* ─── Base ─── */
html,
body {
	overscroll-behavior: none;
}

body {
	background-color: var(--bg);
	color: var(--text-main);
	font-family: 'Rubik', sans-serif;
	line-height: 1.5;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	/* Center Vertically */
	padding: 2rem 1rem;
}

/* ─── Site Banner ─── */
.site-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 40px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 1);
	font-size: .9rem;
	color: var(--text-main);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	z-index: 100;
}

.site-banner b {
	color: var(--text-main);
}

.site-banner a {
	color: var(--text-main);
	text-decoration: underline;
	margin-left: 0.5rem;
	font-weight: 500;
}

/* ─── Site Footer ─── */
.site-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 1.5rem;
	font-size: 0.85rem;
	color: var(--text-muted);
	text-align: center;
	background: linear-gradient(to top, var(--bg), transparent);
	z-index: 100;
}

.site-footer a {
	color: var(--text-muted);
	text-decoration: underline;
	/* transition: var(--ease); */
}

.site-footer a:hover {
	color: var(--text-main);
}

/* ... existing styles ... */

/* ─── Responsive ─── */
@media (max-width: 600px) {

	html,
	body {
		overflow: hidden;
		height: 100dvh;
	}

	body {
		padding: 40px 0 0 0;
		align-items: stretch;
		justify-content: flex-start;
	}

	.form-page {
		max-width: none;
	}

	.form-card {
		height: calc(100dvh - 40px);
		max-height: none;
		border-radius: 0;
		border-left: none;
		border-right: none;
		border-bottom: none;
		border-top: none;
	}

	.form-header {
		padding: 1.5rem 1.5rem 1rem 1.5rem;
	}

	.form-footer {
		padding: 1rem 1.5rem 1.5rem 1.5rem;
		/* Reduced padding */
		gap: 1rem;
	}

	.form-footer-buttons {
		flex-direction: column-reverse;
		gap: 0.75rem;
	}

	.legal-consent {
		text-align: center;
	}

	.form-scroll-area {
		padding: 0 1.5rem 1rem 1.5rem;
		/* Reduced padding */
	}

	.form-title {
		font-size: 1.6rem;
	}

	.form-subtitle {
		font-size: 1.2rem;
	}

	.form-footer button,
	.form-footer .btn-primary,
	.form-footer .btn-secondary {
		width: 100%;
		justify-content: center;
	}
}

/* ─── Turnstile Modal ─── */
.turnstile-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	/* 30% darken */
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 1000;
	display: none;
	justify-content: center;
	align-items: center;
	padding: 1rem;
}

.turnstile-modal.form-card {
	width: 100%;
	max-width: 400px;
	height: auto;
	max-height: none;
	min-height: 0;
	padding: 2rem;
	text-align: center;
	justify-content: center;
	align-items: center;
	gap: 1.5rem;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
	background: #111111;
	/* Explicit bg since form-card var might depend on scope */
}

.turnstile-title {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--white);
	margin: 0;
}

.turnstile-loading {
	color: var(--text-muted);
	font-size: 0.9rem;
	margin: 0;
}

#turnstile-widget {
	min-height: 65px;
	/* Prevent layout shift */
	display: flex;
	justify-content: center;
}

@media (max-width: 600px) {
	.turnstile-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.turnstile-modal.form-card {
		height: auto;
		max-width: 100%;
		border-radius: 24px 24px 0 0;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
		animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	}
}

@keyframes slideUpModal {
	from {
		transform: translateY(100%);
	}

	to {
		transform: translateY(0);
	}
}

/* ─── Completion Screen ─── */
.completion-card {
	text-align: center;
	padding: 3rem 2rem;
}

.completion-header {
	margin-bottom: 2rem;
}

.completion-icon {
	background: rgba(255, 255, 255, 0.05);
	border-radius: 50%;
	width: 72px;
	height: 72px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 1.5rem;
}

.completion-details {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 1.5rem;
	text-align: left;
	margin-bottom: 2rem;
	max-height: 250px;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.completion-details::-webkit-scrollbar {
	width: 6px;
}

.completion-details::-webkit-scrollbar-track {
	background: transparent;
}

.completion-details::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 10px;
}

.completion-details::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

.completion-details-title {
	font-size: 1rem;
	color: rgba(255, 255, 255, 1);
	margin-bottom: 1rem;
}

.completion-detail-label {
	font-size: 0.75rem;
	color: var(--text-muted);
	margin-bottom: 0.2rem;
}

.completion-detail-value {
	color: #fff;
	margin-bottom: 1rem;
	white-space: pre-wrap;
	word-break: break-word;
}

.completion-detail-value.monospace {
	font-family: monospace;
	font-size: 1rem;
}

.completion-actions {
	display: flex;
	gap: 1rem;
	justify-content: center;
}

.completion-actions button {
	font-size: 0.9rem;
}

/* ─── Formal Printing ─── */
.print-only {
	display: none;
}

@media print {
	body {
		background: #fff !important;
		color: #000 !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	body>* {
		display: none !important;
	}

	.form-page,
	.print-only {
		display: block !important;
	}

	.completion-card {
		display: none !important;
	}

	.print-only {
		font-family: Arial, sans-serif !important;
		padding: 40px !important;
		background: #fff !important;
		color: #000 !important;
		max-width: 100% !important;
	}

	.print-only h1 {
		font-size: 22pt !important;
		margin: 0 0 10px 0 !important;
		font-weight: bold !important;
		color: #000 !important;
	}

	.print-meta {
		font-size: 10pt !important;
		opacity: 0.5 !important;
		margin-bottom: 30px !important;
	}

	.print-section-title {
		font-size: 16pt !important;
		margin: 30px 0 15px 0 !important;
		font-weight: bold !important;
		color: #000 !important;
	}

	.print-row {
		margin-bottom: 15px !important;
		page-break-inside: avoid !important;
	}

	.print-label {
		font-size: 10pt !important;
		opacity: 0.5 !important;
		margin-bottom: 2px !important;
	}

	.print-value {
		font-size: 12pt !important;
		font-weight: bold !important;
		color: #000 !important;
		white-space: pre-wrap !important;
		line-height: 1.4 !important;
	}

	.print-divider {
		display: none !important;
	}

	.print-footer {
		margin-top: 50px !important;
		font-size: 9pt !important;
		color: #999 !important;
		text-align: center !important;
	}
}