/* Login de CatPanel con Mochi pescando (2.26). Base: la demo aprobada (catpanel-login.html) + la tecnología de siempre. */
:root {
	--night: #0b0a2e;
	--indigo: #27245C;
	--violet: #412B79;
	--lilac: #8F8FD8;
	--gold: #EEE242;
	--gold-soft: #FDF798;
	--ink: #12123F;
	--text: #EDEDF7;
	--muted: #A9A7D6;
	--glass: rgba(14, 13, 48, 0.58);
	--glass-edge: rgba(143, 143, 216, 0.24);
	--field: rgba(6, 6, 28, 0.55);
	--error: #FF9C8A;
	--ok: #7FE0AE;
	--font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }
body.cm-l { background: var(--night); color: var(--text); font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
canvas.px { position: fixed; top: 0; left: 0; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
#bg { z-index: 0; }
#fg { z-index: 2; pointer-events: none; }

/* Espacio para Mochi arriba del panel (214 px) y carril a la derecha para el hilo. */
.stage {
	position: relative; z-index: 1; min-height: 100%;
	display: grid; place-items: center;
	padding-block: 214px 72px;
	padding-left: max(16px, env(safe-area-inset-left, 0px));
	padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.card {
	position: relative; width: min(420px, 100%);
	padding: 78px 32px 28px;
	border-radius: 28px;
	background: var(--glass);
	border: 1px solid var(--glass-edge);
	-webkit-backdrop-filter: blur(14px) saturate(1.25);
	backdrop-filter: blur(14px) saturate(1.25);
	box-shadow: 0 30px 80px rgba(5, 4, 25, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.brand { position: absolute; top: 30px; left: 32px; line-height: 0; }
.brand .logo { display: block; height: 15px; width: auto; max-width: none; }

.view { display: grid; gap: 14px; }
.view.in { animation: viewIn .45s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); filter: blur(5px); } }
h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; outline: none; }
.lede { margin: -4px 0 6px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.lede b { color: var(--text); font-weight: 600; word-break: break-all; }
.field { display: grid; gap: 7px; }
label { font-size: 14px; font-weight: 500; }
input[type="text"], input[type="password"], input[type="email"] {
	width: 100%; height: 48px; padding: 0 16px; margin: 0;
	border-radius: 14px; border: 1px solid var(--glass-edge);
	background: var(--field); color: var(--text);
	font: 15px/1 var(--font-ui);
	transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: rgba(169, 167, 214, 0.6); }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(238, 226, 66, 0.18); }
input[aria-invalid="true"] { border-color: var(--error); }
.pass-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.link { color: var(--lilac); font-size: 13px; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.link:hover { color: var(--gold-soft); text-decoration: underline; }

/* Ver la contraseña */
.pass { position: relative; display: block; }
.pass input { padding-right: 50px; }
.eye { position: absolute; right: 5px; top: 5px; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.eye:hover { color: var(--text); background: rgba(143, 143, 216, 0.14); }
.eye .off { display: none; }
.eye[aria-pressed="true"] .on { display: none; }
.eye[aria-pressed="true"] .off { display: block; }
.caps { margin: 0; color: var(--gold-soft); font-size: 13px; }
.caps::before { content: "⇪ "; }

.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); cursor: pointer; justify-self: start; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--gold); }

.alert { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 156, 138, 0.12); color: var(--error); font-size: 14px; line-height: 1.45; }
.alert.ok { background: rgba(127, 224, 174, 0.12); color: var(--ok); }
.alert.shake { animation: shake .42s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.primary {
	margin-top: 6px; height: 48px; border: 0; border-radius: 14px;
	background: var(--gold); color: var(--ink);
	font: 600 15px/1 var(--font-ui); cursor: pointer;
	box-shadow: inset 0 -3px 0 rgba(188, 165, 2, 0.55);
	transition: background .15s, transform .05s;
}
.primary:hover { background: var(--gold-soft); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .7; cursor: progress; }
.secondary {
	height: 44px; border-radius: 14px; border: 1px solid var(--glass-edge); background: rgba(143, 143, 216, 0.08); color: var(--text);
	font: 500 14px/1 var(--font-ui); cursor: pointer;
}
.secondary:hover { border-color: var(--lilac); }
.status { margin: 0; min-height: 1.4em; font-size: 14px; line-height: 1.4; color: var(--gold-soft); }
.status:empty { display: none; }
.foot { margin: 0; text-align: center; color: rgba(169, 167, 214, 0.8); font-size: 12.5px; }
.link:focus-visible, .primary:focus-visible, .secondary:focus-visible, .motion:focus-visible, .eye:focus-visible, .check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.corner { position: fixed; z-index: 3; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); font-size: 12px; color: var(--muted); }
.motion {
	right: max(16px, env(safe-area-inset-right, 0px));
	background: rgba(14, 13, 48, 0.7); border: 1px solid var(--glass-edge); color: var(--text);
	border-radius: 999px; padding: 8px 14px; cursor: pointer; font: 500 12px/1 var(--font-ui);
}
.motion:hover { border-color: var(--lilac); }

@media (max-width: 560px) {
	.stage { padding-right: calc(max(16px, env(safe-area-inset-right, 0px)) + 66px); padding-block: 208px 84px; }
	.card { padding: 70px 22px 24px; }
	.brand { left: 22px; top: 26px; }
	.brand .logo { height: 12px; }
	h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
	.view.in, .alert.shake { animation: none; }
}
