/* Return 0 — puerta de entrada (index.html): la consola que pide el código. Usa las variables y
   las piezas de style.css (título, ventana, consola, botón). */

.gate-page {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gate {
	width: min(680px, 100% - 32px);
	padding: 40px 0;
	text-align: center;
}

.gate .title { margin: 0; }
.gate .subtitle { margin: 4px 0 34px; }

.gate-window { text-align: left; }

.gate-body { padding: 18px 20px 22px; }

.gate-log {
	min-height: 120px;
	margin: 0 0 16px;
}

.gate-log .err { color: var(--warning); text-shadow: 0 0 6px rgba(255, 77, 64, 0.5); }
.gate-log .ok { color: var(--title); text-shadow: var(--glow); }

.gate-form {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.gate-label { color: var(--text); white-space: nowrap; }
.gate-prompt { color: var(--text-dim); }

.gate-field {
	position: relative;
	flex: 1;
	display: flex;
	min-width: 160px;
}

.gate-input {
	flex: 1;
	min-width: 0;
	padding-right: 110px !important;
	letter-spacing: 2px;
	font: inherit;
	font-size: 26px;
	color: var(--title);
	background: #000;
	border: 1px solid var(--panel-border);
	padding: 4px 10px;
	caret-color: var(--title);
	outline: none;
	text-shadow: var(--glow);
}

/* Caracteres tapados sin ser un campo de contraseña (el navegador no ofrece guardarlo). */
.gate-input.masked { -webkit-text-security: disc; text-security: disc; }

.gate-input:focus { border-color: var(--text); box-shadow: 0 0 12px rgba(89, 255, 128, 0.25); }
.gate-input:disabled { opacity: 0.6; }

.gate-reveal {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	font: inherit;
	font-size: 18px;
	color: var(--text-dim);
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 2px 4px;
}

.gate-reveal:hover, .gate-reveal[aria-pressed="true"] { color: var(--text); }

.gate-submit { font: inherit; font-size: 24px; padding: 4px 16px; cursor: pointer; }

.gate-foot { margin: 28px 0 0; color: var(--text-dim); }

.shake { animation: gate-shake 0.4s; }

@keyframes gate-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-10px); }
	40% { transform: translateX(8px); }
	60% { transform: translateX(-6px); }
	80% { transform: translateX(4px); }
}

.granted .gate-window { box-shadow: 0 0 0 1px #000, 0 0 40px rgba(89, 255, 128, 0.35); transition: box-shadow 0.4s; }

/* Celulares (o poca altura): todo arriba y compacto, así el teclado no tapa el campo. */
@media (max-width: 640px), (max-height: 620px) {
	.gate-page { align-items: flex-start; }
	.gate { padding: 18px 0 40vh; }
	.gate .title { font-size: 56px; letter-spacing: 4px; }
	.gate .subtitle { margin: 2px 0 16px; font-size: 20px; letter-spacing: 6px; }
	.gate-body { padding: 12px 14px 14px; }
	.gate-log { min-height: 0; margin-bottom: 10px; font-size: 19px; }
	.gate-log div:not(:last-child):not(:nth-last-child(2)) { display: none; }
	.gate-form { gap: 8px; }
	.gate-label { width: 100%; }
	.gate-field { min-width: 0; }
	.gate-input { font-size: 24px; }
	.gate-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.shake { animation: none; }
}
