/**
 * Research Registration Gate
 *
 * Full-screen splash that gates the site for logged-out visitors. Themed to match
 * the Paradise Compounds site: light surfaces, dark-slate navy text, Telemetry Blue
 * and Mint Green accents, Outfit / Space Mono type.
 */

/* Lock the page behind the gate. */
body.pg-gate-open {
	overflow: hidden;
}

.pg-gate {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	background: var(--bg-base, #ffffff);
	color: var(--text-primary, #0f172a);
	font-family: var(--font-sans, "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	-webkit-font-smoothing: antialiased;
}

.pg-layout {
	display: flex;
	height: 100%;
	width: 100%;
}

/* --------------------------------------------------------------------------
 * Branding (left) panel
 * ----------------------------------------------------------------------- */
.pg-aside {
	display: none;
	position: relative;
	overflow: hidden;
	width: 42%;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--bg-section-alt, #f8fafc);
	border-right: 1px solid var(--border-light, #e2e8f0);
}

.pg-aside-grid {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.05) 1px, transparent 0);
	background-size: 28px 28px;
}

.pg-glow {
	position: absolute;
	border-radius: 50%;
	filter: blur(100px);
}

.pg-glow-1 {
	top: 12%;
	left: 16%;
	width: 360px;
	height: 360px;
	background: rgba(14, 165, 233, 0.12);
}

.pg-glow-2 {
	bottom: 12%;
	right: 10%;
	width: 320px;
	height: 320px;
	background: rgba(16, 185, 129, 0.1);
}

.pg-aside-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
	width: 100%;
	max-width: 30rem;
	padding: 2.5rem;
}

.pg-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.25rem;
	text-align: center;
}

.pg-logo-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: var(--bg-surface, #fff);
	border: 1px solid var(--border-light, #e2e8f0);
	overflow: hidden;
	box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.05));
}

.pg-logo-badge img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pg-wordmark {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1;
	color: var(--text-primary, #0f172a);
}

.pg-wordmark span {
	color: var(--text-muted, #94a3b8);
}

.pg-tagline {
	margin: 0.6rem 0 0;
	font-family: var(--font-mono, "Space Mono", monospace);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--text-muted, #94a3b8);
}

.pg-divider {
	display: block;
	width: 3rem;
	height: 1px;
	background: linear-gradient(to right, transparent, var(--border-light, #e2e8f0), transparent);
}

.pg-features {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: 100%;
}

.pg-feature {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
	padding: 1rem;
	border-radius: var(--radius-lg, 8px);
	background: var(--bg-surface, #fff);
	border: 1px solid var(--border-light, #e2e8f0);
	box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.pg-feature-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	margin-top: 0.15rem;
	border-radius: var(--radius-md, 6px);
	background: var(--accent-blue-bg, rgba(14, 165, 233, 0.08));
	color: var(--accent-blue, #0ea5e9);
}

.pg-feature-title {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-primary, #0f172a);
}

.pg-feature-text {
	margin: 0.25rem 0 0;
	font-size: 0.75rem;
	line-height: 1.55;
	color: var(--text-secondary, #475569);
}

/* --------------------------------------------------------------------------
 * Form (right) panel
 * ----------------------------------------------------------------------- */
.pg-main {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow-y: auto;
	background: var(--bg-base, #fff);
}

.pg-main-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 1.1rem;
	border-bottom: 1px solid var(--border-light, #e2e8f0);
	background: var(--bg-section-alt, #f8fafc);
}

.pg-logo-badge--sm {
	width: 36px;
	height: 36px;
	box-shadow: none;
}

.pg-wordmark--sm {
	font-size: 1.1rem;
	font-weight: 800;
}

.pg-body {
	flex: 1 0 auto;
	width: 100%;
	max-width: 40rem;
	margin: 0 auto;
	padding: 2rem 1.5rem;
}

.pg-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.pg-tab {
	flex: 1;
	padding: 0.75rem;
	font-size: 0.875rem;
	font-weight: 600;
	font-family: inherit;
	border: 1px solid var(--border-light, #e2e8f0);
	border-radius: var(--radius-lg, 8px);
	cursor: pointer;
	background: var(--bg-section-alt, #f8fafc);
	color: var(--text-secondary, #475569);
	transition: var(--transition-smooth, all 0.2s ease);
}

.pg-tab:hover {
	border-color: var(--accent-blue, #0ea5e9);
	color: var(--text-primary, #0f172a);
}

.pg-tab[aria-selected="true"] {
	background: var(--btn-primary-bg, #0f172a);
	border-color: var(--btn-primary-bg, #0f172a);
	color: var(--btn-primary-text, #fff);
}

.pg-errors {
	margin-bottom: 1.25rem;
	padding: 0.85rem 1rem;
	border-radius: var(--radius-md, 6px);
	background: var(--color-danger-bg, #fef2f2);
	border: 1px solid var(--color-danger-border, #fecaca);
}

.pg-errors ul {
	margin: 0;
	padding-left: 1.1rem;
}

.pg-errors li {
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--color-danger, #b91c1c);
}

.pg-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.pg-form[hidden] {
	display: none;
}

.pg-form-head h2 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--text-primary, #0f172a);
}

.pg-form-head p {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	color: var(--text-secondary, #475569);
}

.pg-req {
	color: var(--color-danger-accent, #ef4444);
}

.pg-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.pg-field {
	display: flex;
	flex-direction: column;
}

.pg-field label {
	margin-bottom: 0.35rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--text-secondary, #475569);
}

.pg-field input,
.pg-field select {
	width: 100%;
	padding: 0.65rem 0.9rem;
	font-size: 0.875rem;
	font-family: inherit;
	color: var(--text-primary, #0f172a);
	background: var(--bg-surface, #fff);
	border: 1px solid var(--border-light, #e2e8f0);
	border-radius: var(--radius-md, 6px);
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	color-scheme: light;
}

.pg-field input::placeholder {
	color: var(--text-muted, #94a3b8);
}

.pg-field input:focus,
.pg-field select:focus {
	border-color: var(--border-focus, #0ea5e9);
	box-shadow: 0 0 0 3px var(--accent-blue-bg, rgba(14, 165, 233, 0.12));
}

.pg-field select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	padding-right: 2.25rem;
	cursor: pointer;
}

/* Password field with visibility toggle. */
.pg-pw {
	position: relative;
}

.pg-pw input {
	padding-right: 2.75rem;
}

.pg-pw-toggle {
	position: absolute;
	top: 50%;
	right: 0.65rem;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	opacity: 0.55;
	background-repeat: no-repeat;
	background-position: center;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.pg-pw-toggle:hover {
	opacity: 0.9;
}

.pg-pw-toggle.is-on {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

/* Terms box. */
.pg-terms {
	border: 1px solid var(--border-light, #e2e8f0);
	border-radius: var(--radius-md, 6px);
	overflow: hidden;
}

.pg-terms-head {
	padding: 0.55rem 0.85rem;
	font-family: var(--font-mono, "Space Mono", monospace);
	font-size: 0.68rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted, #94a3b8);
	background: var(--bg-section-alt, #f8fafc);
	border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.pg-terms-body {
	max-height: 180px;
	overflow-y: auto;
	padding: 0.85rem;
	font-size: 0.75rem;
	line-height: 1.6;
	white-space: pre-line;
	color: var(--text-secondary, #475569);
}

/* Acknowledgment / opt-in checkboxes. */
.pg-check {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.85rem;
	border-radius: var(--radius-md, 6px);
	border: 1px solid var(--border-light, #e2e8f0);
	background: var(--bg-section-alt, #f8fafc);
	cursor: pointer;
}

.pg-check input {
	margin-top: 0.2rem;
	width: 1rem;
	height: 1rem;
	accent-color: var(--accent-blue, #0ea5e9);
	flex-shrink: 0;
}

.pg-check strong {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text-primary, #0f172a);
}

.pg-check small {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.72rem;
	line-height: 1.5;
	color: var(--text-secondary, #475569);
}

/* Submit. */
.pg-submit {
	width: 100%;
	padding: 0.85rem;
	margin-top: 0.25rem;
	font-size: 0.9rem;
	font-weight: 600;
	font-family: inherit;
	color: var(--btn-primary-text, #fff);
	background: var(--btn-primary-bg, #0f172a);
	border: none;
	border-radius: var(--radius-lg, 8px);
	cursor: pointer;
	box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.08));
	transition: var(--transition-smooth, all 0.2s ease);
}

.pg-submit:hover:not(:disabled) {
	background: var(--btn-primary-hover, #1e293b);
	transform: translateY(-1px);
}

.pg-submit:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.pg-foot {
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--border-light, #e2e8f0);
}

.pg-foot p {
	margin: 0;
	font-family: var(--font-mono, "Space Mono", monospace);
	font-size: 0.65rem;
	line-height: 1.5;
	letter-spacing: 0.03em;
	color: var(--text-muted, #94a3b8);
}

/* --------------------------------------------------------------------------
 * Responsive
 * ----------------------------------------------------------------------- */
@media screen and (min-width: 1024px) {
	.pg-aside {
		display: flex;
	}

	.pg-main {
		width: 58%;
	}

	.pg-main-logo {
		display: none;
	}

	/* Center vertically when it fits; auto margins collapse to 0 on overflow,
	   keeping the top of the form reachable (unlike justify-content: center). */
	.pg-body {
		flex: 0 0 auto;
		margin-block: auto;
	}
}
