/**
 * Gate IQ — front-end gate form.
 *
 * Self-contained and theme-agnostic: every color/spacing value is a custom
 * property with a sane default, so it looks clean dropped into any theme,
 * and a site owner (or theme) can override just the properties instead of
 * fighting selector specificity.
 */

.gate-iq-form {
	--gate-iq-accent: #2f6f5e;
	--gate-iq-accent-contrast: #ffffff;
	--gate-iq-bg: #ffffff;
	--gate-iq-text: #1c1e21;
	--gate-iq-muted: #63676c;
	--gate-iq-border: #e2e4e7;
	--gate-iq-error-bg: #fdecea;
	--gate-iq-error-text: #7a271a;
	--gate-iq-notice-bg: #eef6f3;
	--gate-iq-notice-text: #1c4a3d;
	--gate-iq-radius: 14px;
	--gate-iq-max-width: 440px;

	box-sizing: border-box;
	max-width: var(--gate-iq-max-width);
	width: 100%;
	margin: 2.5rem auto;
	padding: 2.25rem 2rem;
	background: var(--gate-iq-bg);
	color: var(--gate-iq-text);
	border: 1px solid var(--gate-iq-border);
	border-radius: var(--gate-iq-radius);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	text-align: center;
}

.gate-iq-form *,
.gate-iq-form *::before,
.gate-iq-form *::after {
	box-sizing: border-box;
}

.gate-iq-headline {
	display: block;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--gate-iq-text);
	margin-bottom: 0.5rem;
}

.gate-iq-instructions {
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--gate-iq-muted);
	margin-bottom: 1.5rem;
}

.gate-iq-instructions p {
	margin: 0 0 0.5em;
}

.gate-iq-instructions p:last-child {
	margin-bottom: 0;
}

.gate-iq-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}

.gate-iq-input {
	display: block;
	width: 100%;
	margin: 0 0 0.75rem;
	padding: 0.7rem 0.9rem;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--gate-iq-text);
	background: var(--gate-iq-bg);
	border: 1px solid var(--gate-iq-border);
	border-radius: 999px;
	text-align: center;
	outline: none;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gate-iq-input:focus {
	border-color: var(--gate-iq-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--gate-iq-accent) 20%, transparent);
}

.gate-iq-submit {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0.75rem 1rem;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
	border-radius: 999px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.gate-iq-submit--primary {
	background: var(--gate-iq-accent);
	color: var(--gate-iq-accent-contrast);
}

.gate-iq-submit--primary:hover {
	opacity: 0.9;
}

.gate-iq-submit--secondary {
	background: transparent;
	color: var(--gate-iq-accent);
	border-color: var(--gate-iq-border);
	font-size: 0.85rem;
	padding: 0.6rem 1rem;
}

.gate-iq-submit--secondary:hover {
	background: var(--gate-iq-notice-bg);
}

.gate-iq-message {
	margin-top: 0.75rem;
	padding: 0.6rem 0.85rem;
	border-radius: 10px;
	font-size: 0.85rem;
	line-height: 1.4;
}

.gate-iq-message--error {
	background: var(--gate-iq-error-bg);
	color: var(--gate-iq-error-text);
}

.gate-iq-message--notice {
	background: var(--gate-iq-notice-bg);
	color: var(--gate-iq-notice-text);
}

.gate-iq-forgot-toggle {
	margin-top: 1rem;
}

.gate-iq-forgot-link {
	font-size: 0.82rem;
	color: var(--gate-iq-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.gate-iq-forgot-link:hover {
	color: var(--gate-iq-accent);
}

.gate-iq-forgot-fieldset {
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--gate-iq-border);
}

/* Belt-and-suspenders: the [hidden] attribute already does this natively,
   but !important guards against an aggressively broad theme rule (e.g. a
   theme-wide `fieldset { display: block !important; }`) forcing it open. */
.gate-iq-forgot-fieldset[hidden] {
	display: none !important;
}

.gate-iq-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Success interstitial */

.gate-iq-form--success {
	padding-top: 2.75rem;
	padding-bottom: 2.75rem;
}

.gate-iq-success-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0 auto 1rem;
	border-radius: 50%;
	background: var(--gate-iq-accent);
	color: var(--gate-iq-accent-contrast);
	font-size: 1.4rem;
	line-height: 1;
}

.gate-iq-success-message {
	font-size: 1.05rem;
	color: var(--gate-iq-text);
	margin: 0 0 0.75rem;
}

.gate-iq-success-continue {
	margin: 0;
	font-size: 0.85rem;
}

.gate-iq-success-continue a {
	color: var(--gate-iq-accent);
}

@media (prefers-color-scheme: dark) {
	.gate-iq-form {
		--gate-iq-bg: #1e2124;
		--gate-iq-text: #f2f3f4;
		--gate-iq-muted: #a7abb0;
		--gate-iq-border: #33373b;
		--gate-iq-error-bg: #3a2020;
		--gate-iq-error-text: #f3b4ab;
		--gate-iq-notice-bg: #1f2e29;
		--gate-iq-notice-text: #b7ded0;
	}
}

@media (max-width: 480px) {
	.gate-iq-form {
		margin: 1.25rem auto;
		padding: 1.75rem 1.25rem;
		border-radius: 10px;
	}
}
