:root {
	color-scheme: light dark;
	--hsgc-gold: #c79528;
	--hsgc-gold-deep: #946814;
	--hsgc-maroon: #741f2b;
	--hsgc-maroon-mid: #852a38;
	--hsgc-maroon-dark: #4d111a;
	--hsgc-orange: #b54d00;
	--hsgc-ink: #241c17;
	--hsgc-muted: #675d55;
	--hsgc-faint: #8a7e73;
	--hsgc-paper: #ffffff;
	--hsgc-panel: #fbf7f0;
	--hsgc-border: #e6dac5;
	--hsgc-rule: #eee7db;
	--hsgc-error: #a92121;
	--hsgc-error-bg: #fdf1f1;
	--hsgc-error-border: #edb9b9;
	--hsgc-warn: #7a5a12;
	--hsgc-warn-bg: #fdf6e4;
	--hsgc-warn-border: #e8d296;
	--hsgc-success: #1f6b39;
	--hsgc-success-bg: #eef7f0;
	--hsgc-shadow: 0 24px 65px rgba(72, 42, 11, 0.18);
}

* {
	box-sizing: border-box;
}

html,
body {
	min-height: 100%;
}

body.hsgc-wag-gate-page {
	position: relative;
	margin: 0;
	overflow-x: hidden;
	background: #2a211b;
	color: var(--hsgc-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
}

body.hsgc-wag-gate-page::before {
	position: fixed;
	z-index: 0;
	inset: 0;
	background:
		linear-gradient(150deg, rgba(31, 23, 18, 0.66), rgba(34, 24, 17, 0.8)),
		url("../images/hsgc-temple-background.jpg") center / cover no-repeat;
	content: "";
	pointer-events: none;
}

/* ---------- Shell and card ---------- */

.hsgc-wag-gate-shell {
	position: relative;
	z-index: 1;
	display: grid;
	min-height: 100vh;
	min-height: 100dvh;
	place-items: center;
	padding: 30px 16px;
}

.hsgc-wag-gate-card {
	position: relative;
	width: min(100%, 560px);
	padding: 40px 42px 28px;
	overflow: hidden;
	background: var(--hsgc-paper);
	border: 1px solid var(--hsgc-border);
	border-radius: 22px;
	box-shadow: var(--hsgc-shadow);
	text-align: center;
}

.hsgc-wag-gate-card::before {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 6px;
	background: linear-gradient(90deg, var(--hsgc-maroon), var(--hsgc-gold), var(--hsgc-maroon));
	content: "";
}

.hsgc-wag-emblem {
	display: block;
	width: 78px;
	height: 78px;
	margin: 0 auto 14px;
	border-radius: 50%;
	filter: drop-shadow(0 7px 12px rgba(79, 46, 9, 0.26));
	object-fit: contain;
}

.hsgc-wag-site-name {
	margin: 0 0 8px;
	color: var(--hsgc-orange);
	font-size: 12.5px;
	font-weight: 750;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.hsgc-wag-gate-card h1 {
	margin: 0;
	color: var(--hsgc-ink);
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(27px, 5.6vw, 37px);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.16;
}

.hsgc-wag-message {
	max-width: 430px;
	margin: 14px auto 0;
	color: var(--hsgc-muted);
	font-size: 15.5px;
}

/* ---------- Step indicator ---------- */

.hsgc-wag-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 24px auto 22px;
	padding: 0;
	list-style: none;
}

.hsgc-wag-step {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--hsgc-faint);
	font-size: 13px;
	font-weight: 650;
	transition: color 160ms ease;
}

.hsgc-wag-step + .hsgc-wag-step::before {
	display: block;
	width: 26px;
	height: 2px;
	background: var(--hsgc-rule);
	border-radius: 2px;
	content: "";
}

.hsgc-wag-step-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 25px;
	height: 25px;
	background: var(--hsgc-panel);
	border: 1.5px solid var(--hsgc-rule);
	border-radius: 50%;
	font-size: 12.5px;
	font-weight: 750;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hsgc-wag-step.is-current {
	color: var(--hsgc-maroon);
}

.hsgc-wag-step.is-current .hsgc-wag-step-dot {
	background: #fff;
	border-color: var(--hsgc-maroon);
	color: var(--hsgc-maroon);
	box-shadow: 0 0 0 4px rgba(116, 31, 43, 0.1);
}

.hsgc-wag-step.is-done {
	color: var(--hsgc-success);
}

.hsgc-wag-step.is-done .hsgc-wag-step-dot {
	background: var(--hsgc-success);
	border-color: var(--hsgc-success);
	color: #fff;
	font-size: 0;
}

.hsgc-wag-step.is-done .hsgc-wag-step-dot::after {
	font-size: 13px;
	content: "✓";
}

/* ---------- Notices ---------- */

.hsgc-wag-notice {
	margin: 0 0 20px;
	padding: 14px 16px;
	border: 1px solid;
	border-radius: 12px;
	text-align: left;
}

.hsgc-wag-notice-title {
	margin: 0;
	font-size: 14.5px;
	font-weight: 750;
}

.hsgc-wag-notice-text {
	margin: 5px 0 0;
	font-size: 14px;
}

.hsgc-wag-notice-list {
	margin: 9px 0 0;
	padding-left: 19px;
	font-size: 14px;
}

.hsgc-wag-notice-list li + li {
	margin-top: 4px;
}

.hsgc-wag-notice-error {
	background: var(--hsgc-error-bg);
	border-color: var(--hsgc-error-border);
	color: #7f1d1d;
}

.hsgc-wag-notice-wait,
.hsgc-wag-notice-vpn {
	background: var(--hsgc-warn-bg);
	border-color: var(--hsgc-warn-border);
	color: var(--hsgc-warn);
}

/* ---------- Form ---------- */

.hsgc-wag-form {
	display: grid;
	gap: 14px;
	max-width: 400px;
	margin: 0 auto;
}

.hsgc-wag-widget {
	position: relative;
	display: grid;
	min-height: 68px;
	place-items: center;
}

.hsgc-wag-widget .cf-turnstile {
	width: 100%;
	min-height: 65px;
}

.hsgc-wag-widget-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 10px 14px;
	background: var(--hsgc-panel);
	border: 1px dashed var(--hsgc-border);
	border-radius: 10px;
	color: var(--hsgc-faint);
	font-size: 13px;
	line-height: 1.35;
	pointer-events: none;
	text-align: left;
}

.hsgc-wag-widget-placeholder .hsgc-wag-spinner {
	flex: 0 0 auto;
}

.hsgc-wag-retry {
	justify-self: center;
	margin-top: -4px;
	padding: 9px 16px;
	background: transparent;
	border: 1.5px solid var(--hsgc-maroon);
	border-radius: 9px;
	color: var(--hsgc-maroon);
	cursor: pointer;
	font: inherit;
	font-size: 13.5px;
	font-weight: 700;
}

.hsgc-wag-retry:hover {
	background: var(--hsgc-maroon);
	color: #ffffff;
}

.hsgc-wag-retry:focus-visible {
	outline: 3px solid rgba(199, 149, 40, 0.5);
	outline-offset: 2px;
}

.hsgc-wag-retry[hidden] {
	display: none;
}

.hsgc-wag-widget.is-rendered .hsgc-wag-widget-placeholder {
	display: none;
}

.hsgc-wag-widget-placeholder.is-failed {
	background: var(--hsgc-error-bg);
	border-color: var(--hsgc-error-border);
	border-style: solid;
	color: var(--hsgc-error);
	font-weight: 650;
}

.hsgc-wag-widget-placeholder.is-failed .hsgc-wag-spinner {
	display: none;
}

.hsgc-wag-spinner {
	width: 15px;
	height: 15px;
	border: 2px solid var(--hsgc-border);
	border-radius: 50%;
	border-top-color: var(--hsgc-gold-deep);
	animation: hsgc-wag-spin 700ms linear infinite;
}

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

.hsgc-wag-verification-status {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin: 0;
	color: var(--hsgc-muted);
	font-size: 13px;
	text-align: left;
}

.hsgc-wag-status-icon {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	background: var(--hsgc-faint);
	border-radius: 50%;
}

.hsgc-wag-verification-status.is-success {
	color: var(--hsgc-success);
	font-weight: 650;
}

.hsgc-wag-verification-status.is-success .hsgc-wag-status-icon {
	background: var(--hsgc-success);
}

.hsgc-wag-verification-status.is-error {
	color: var(--hsgc-error);
	font-weight: 650;
}

.hsgc-wag-verification-status.is-error .hsgc-wag-status-icon {
	background: var(--hsgc-error);
}

.hsgc-wag-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 52px;
	padding: 13px 20px;
	background: linear-gradient(180deg, var(--hsgc-maroon-mid), var(--hsgc-maroon));
	border: 1px solid var(--hsgc-maroon-dark);
	border-radius: 11px;
	box-shadow: 0 7px 16px rgba(91, 25, 35, 0.2);
	color: #ffffff;
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	font-weight: 750;
	transition: transform 130ms ease, box-shadow 130ms ease, opacity 130ms ease;
}

.hsgc-wag-submit:hover:not(:disabled) {
	box-shadow: 0 10px 22px rgba(91, 25, 35, 0.28);
	transform: translateY(-1px);
}

.hsgc-wag-submit:active:not(:disabled) {
	transform: translateY(0);
}

.hsgc-wag-submit:focus-visible {
	outline: 3px solid rgba(199, 149, 40, 0.5);
	outline-offset: 3px;
}

.hsgc-wag-submit:disabled {
	background: linear-gradient(180deg, #b7a79f, #a08f86);
	border-color: #8e7d74;
	box-shadow: none;
	cursor: not-allowed;
}

.hsgc-wag-submit.is-busy .hsgc-wag-submit-label::after {
	display: inline-block;
	margin-left: 8px;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: hsgc-wag-spin 700ms linear infinite;
	content: "";
	vertical-align: -2px;
}

.hsgc-wag-reset-row {
	display: flex;
	justify-content: flex-end;
	margin-top: -6px;
}

.hsgc-wag-reset {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 7px;
	border-radius: 7px;
	color: var(--hsgc-gold-deep);
	font-size: 12.5px;
	font-weight: 650;
	line-height: 1.25;
	text-decoration: none;
}

.hsgc-wag-reset:hover {
	background: var(--hsgc-panel);
	color: var(--hsgc-maroon);
}

.hsgc-wag-reset:focus-visible {
	outline: 2px solid rgba(199, 149, 40, 0.6);
	outline-offset: 2px;
}

.hsgc-wag-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ---------- Footer ---------- */

.hsgc-wag-foot {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--hsgc-rule);
}

.hsgc-wag-privacy {
	margin: 0;
	color: var(--hsgc-faint);
	font-size: 12px;
}

.hsgc-wag-badge {
	margin: 7px 0 0;
	color: var(--hsgc-faint);
	font-size: 11.5px;
	letter-spacing: 0.02em;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
	.hsgc-wag-gate-shell {
		padding: 14px 11px;
	}

	.hsgc-wag-gate-card {
		padding: 32px 20px 22px;
		border-radius: 18px;
	}

	.hsgc-wag-emblem {
		width: 66px;
		height: 66px;
	}

	.hsgc-wag-steps {
		gap: 8px;
		margin: 20px auto 18px;
	}

	.hsgc-wag-step {
		font-size: 12px;
	}

	.hsgc-wag-step + .hsgc-wag-step::before {
		width: 18px;
	}
}

@media (max-width: 360px) {
	.hsgc-wag-step-label {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsgc-wag-submit,
	.hsgc-wag-step,
	.hsgc-wag-step-dot {
		transition: none;
	}

	.hsgc-wag-spinner,
	.hsgc-wag-submit.is-busy .hsgc-wag-submit-label::after {
		animation: none;
	}
}

/* ---------- Dark scheme ---------- */

@media (prefers-color-scheme: dark) {
	:root {
		--hsgc-gold-deep: #f0c35f;
		--hsgc-orange: #ffad33;
		--hsgc-ink: #f7efe5;
		--hsgc-muted: #d3c8bb;
		--hsgc-faint: #a89c8f;
		--hsgc-paper: #211c19;
		--hsgc-panel: #2b2420;
		--hsgc-border: #4d4034;
		--hsgc-rule: #3a3129;
		--hsgc-error: #ff9b9b;
		--hsgc-error-bg: #391f21;
		--hsgc-error-border: #743b40;
		--hsgc-warn: #f0d587;
		--hsgc-warn-bg: #352d1e;
		--hsgc-warn-border: #725d28;
		--hsgc-success: #6ddc94;
		--hsgc-success-bg: #1d2d22;
		--hsgc-shadow: 0 24px 65px rgba(0, 0, 0, 0.5);
	}

	body.hsgc-wag-gate-page {
		background: #211b16;
	}

	.hsgc-wag-notice-error {
		color: var(--hsgc-error);
	}

	.hsgc-wag-notice-wait,
	.hsgc-wag-notice-vpn {
		color: var(--hsgc-warn);
	}

	.hsgc-wag-step.is-current .hsgc-wag-step-dot {
		background: var(--hsgc-panel);
		border-color: var(--hsgc-gold-deep);
		color: var(--hsgc-gold-deep);
		box-shadow: 0 0 0 4px rgba(240, 195, 95, 0.12);
	}

	.hsgc-wag-step.is-current {
		color: var(--hsgc-gold-deep);
	}

	.hsgc-wag-submit:disabled {
		background: linear-gradient(180deg, #4a403a, #3d342f);
		border-color: #5a4e46;
		color: #b9aca1;
	}

	.hsgc-wag-retry {
		border-color: var(--hsgc-gold-deep);
		color: var(--hsgc-gold-deep);
	}

	.hsgc-wag-retry:hover {
		background: var(--hsgc-gold-deep);
		color: #2a211b;
	}
}
