/* Entry gate overlay (design boards Entry 1 Disclaimer, Entry 2 Access code).
   Hidden unless the head script put `py-gated` on <html> (JS on, cookie missing), so without JS
   the page shows normally. `data-py-gate` on <html> picks the step shown. */
.py-gate { display: none; }

html.py-gated { overflow: hidden; }
html.py-gated .py-gate {
	position: fixed; inset: 0; z-index: 1000; display: flex; padding: 40px;
	overflow-y: auto; overscroll-behavior: contain; color: var(--py-ink);
}
/* Fully opaque (client: no page content visible behind the gate). Same dark ground as the boards. */
.py-gate__backdrop {
	position: fixed; inset: 0;
	background-color: #2A2A2E;
	background-image:
		repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 14px),
		radial-gradient(circle at 50% 38%, #47474D 0%, #1B1B1F 74%);
}

.py-gate__dialog {
	position: relative; display: none; width: 100%; max-width: 640px; margin: auto; padding: 44px 48px 40px;
	background: var(--py-white); border-top: 4px solid var(--py-alert);
}
html[data-py-gate="disclaimer"] .py-gate__dialog--disclaimer,
html[data-py-gate="code"] .py-gate__dialog--code { display: block; }
.py-gate__dialog--code { padding-top: 40px; border-top-color: var(--py-gold); }
.py-gate :focus-visible { outline: 2px solid var(--py-navy); outline-offset: 3px; }
.py-gate__dialog:focus { outline: none; }

.py-gate__title { margin: 0 0 18px; font-size: 38px; font-weight: 400; line-height: 1.1; color: var(--py-ink); }
.py-gate__dialog--code .py-gate__title { margin-bottom: 12px; }

/* Disclaimer */
.py-gate__text { margin-bottom: 32px; font-size: 15px; line-height: 1.65; color: #3A3A40; }
.py-gate__text > * { margin: 0 0 1em; }
.py-gate__text > :last-child { margin-bottom: 0; }
.py-gate__text a { color: var(--py-navy); }

.py-gate__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.py-gate__btn {
	flex: 1 1 200px; height: 56px; padding: 0 20px; border: 1px solid var(--py-ink);
	font-size: 16px; font-weight: 600; cursor: pointer; transition: background-color .15s ease;
}
.py-gate__btn--accept { background: var(--py-ink); color: var(--py-white); }
.py-gate__btn--accept:hover { background: #000; }
.py-gate__btn--leave { background: var(--py-white); color: var(--py-ink); }
.py-gate__btn--leave:hover { background: var(--py-surface); }

/* Access code */
.py-gate__lead { margin: 0 0 24px; font-size: 15px; color: var(--py-muted); }
.py-gate__contact {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px;
	margin-bottom: 26px; padding: 14px 18px; background: var(--py-surface);
}
.py-gate__contact p { margin: 0; font-size: 14px; font-weight: 600; }
.py-gate__contact a { font-size: 15px; font-weight: 600; color: var(--py-navy); overflow-wrap: anywhere; }
.py-gate__contact a:hover { text-underline-offset: 4px; }

.py-gate__form { margin: 0; }
.py-gate__label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.py-gate__field { display: flex; align-items: stretch; height: 64px; border: 1px solid var(--py-ink); background: var(--py-white); }
.py-gate__field:focus-within { outline: 2px solid var(--py-navy); outline-offset: 2px; }
.py-gate__prefix {
	display: inline-flex; align-items: center; padding: 0 18px; background: var(--py-ink); color: var(--py-white);
	font-size: 20px; letter-spacing: .08em;
}
.py-gate__input {
	flex: 1; min-width: 0; padding: 0 20px; border: 0; border-radius: 0; background: transparent;
	font: inherit; font-size: 26px; letter-spacing: .5em; color: var(--py-ink);
}
.py-gate__input:focus, .py-gate__input:focus-visible { outline: none; }
.py-gate__input:read-only { color: var(--py-muted); }

.py-gate__status { display: flex; align-items: center; gap: 10px; min-height: 28px; margin: 12px 0 0; font-size: 14px; color: var(--py-muted); }
.py-gate__spinner { display: none; flex: none; color: var(--py-navy); animation: py-gate-spin .9s linear infinite; }
.py-gate.is-checking .py-gate__spinner { display: block; }
/* Wrong code, too many attempts, network error (not in the design boards). */
.py-gate.is-error .py-gate__field { border-color: var(--py-alert); box-shadow: inset 0 0 0 1px var(--py-alert); }
.py-gate.is-error .py-gate__status { font-weight: 600; color: var(--py-alert); }

@keyframes py-gate-spin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
	html.py-gated .py-gate { padding: 20px; }
	.py-gate__dialog { padding: 32px 24px 28px; }
	.py-gate__dialog--code { padding-top: 30px; }
	.py-gate__title { font-size: 32px; }
	.py-gate__prefix { padding: 0 14px; }
	.py-gate__input { padding: 0 14px; letter-spacing: .4em; }
}

@media (prefers-reduced-motion: reduce) {
	.py-gate__spinner { animation: none; }
	.py-gate__btn { transition: none; }
}
