/* Panel Jorxel · Login «fábrica de software». Identidad de jorxel.com: tinta de plano, azul, naranja y verde de marca. */

:root {
    --tinta: #0f1829;
    --tinta-2: #131f35;
    --plano: #2f4c7a;
    --trazo: #a9c8f5;
    --papel: #eef2f8;
    --senal: #EE732E;
    --senal-2: #ff8a45;
    --azul: #25509F;
    --azul-claro: #4f7fd6;
    --verde: #0D9A39;
    --verde-claro: #2fd170;
    --cian: #2fc4b2;
    --error: #ff7b72;
    --linea: rgba(169, 200, 245, .16);
    --linea-fuerte: rgba(169, 200, 245, .3);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "Instrument Serif", Georgia, serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
    color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
    background: var(--tinta); color: var(--papel);
    font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }

/* ---------- Fondo ---------- */
#escena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.velo {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background:
        radial-gradient(60% 70% at 50% 55%, rgba(15, 24, 41, .55) 0%, rgba(15, 24, 41, 0) 70%),
        linear-gradient(to top, rgba(15, 24, 41, .9) 0%, rgba(15, 24, 41, 0) 38%);
}
/* línea de escaneo muy tenue sobre toda la pantalla */
.barrido {
    position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
    background: repeating-linear-gradient(to bottom, rgba(169, 200, 245, .025) 0 1px, transparent 1px 3px);
}

/* ---------- Composición: imagen de marca y, debajo, el acceso ---------- */
.pagina {
    position: relative; z-index: 2; min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column; align-items: center;
    padding: max(1rem, env(safe-area-inset-top)) 16px 0;
}
.marca { display: block; color: var(--papel); text-decoration: none; margin-bottom: clamp(.5rem, 2vh, 1.25rem); }
.marca img {
    display: block; margin: 0 auto; width: min(320px, 100%); height: auto; user-select: none; -webkit-user-drag: none;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .55));
}
.marca strong { font-size: 1.4rem; }
.marca:focus-visible { outline: 2px solid var(--senal); outline-offset: 6px; border-radius: 8px; }

/* ---------- Tarjeta de acceso ---------- */
.acceso { flex: 1; width: min(430px, 100%); min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(1rem, 4vh, 2.5rem) 0; }
.acceso .tarjeta { width: 100%; }
.tarjeta {
    position: relative; padding: 1.9rem 1.75rem 1.75rem; border-radius: 18px;
    background: linear-gradient(160deg, rgba(25, 38, 64, .15), rgba(15, 24, 41, .10)); /* 85–90 % transparente */
    border: 1px solid var(--linea);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
/* esquinas tipo visor */
.esq { position: absolute; width: 16px; height: 16px; border: 2px solid var(--senal); pointer-events: none; opacity: .9; }
.esq.a { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.esq.b { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.esq.c { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.esq.d { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
/* línea de luz que recorre el borde superior */
.tarjeta::before {
    content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--senal), var(--cian), transparent);
    background-size: 200% 100%; animation: flujo 4s linear infinite; opacity: .8;
}
@keyframes flujo { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.tarjeta-cab { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.25rem; }
.icono { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 0 12px rgba(79, 127, 214, .45)); }
.rotulo { font-size: .68rem; letter-spacing: .14em; color: rgba(169, 200, 245, .65); text-transform: uppercase; }
.tarjeta h2 { font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }

form { display: grid; gap: 1rem; }
.col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.nota { display: flex; gap: .5rem; align-items: flex-start; margin-top: 0; }
.nota svg { flex: none; width: 15px; height: 15px; margin-top: .1rem; fill: none; stroke: var(--cian); stroke-width: 1.8; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.campo label, .pin-cab label { display: block; font-size: .8rem; font-weight: 500; color: var(--trazo); margin-bottom: .4rem; }
.control { position: relative; display: flex; align-items: center; }
.control > svg {
    position: absolute; left: .9rem; width: 18px; height: 18px; pointer-events: none;
    fill: none; stroke: rgba(169, 200, 245, .55); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s;
}
.control input {
    width: 100%; height: 46px; padding: 0 1rem 0 2.75rem; border-radius: 12px;
    background: rgba(8, 14, 26, .6); border: 1px solid var(--linea-fuerte); outline: none;
    font-size: .98rem; transition: border-color .2s, box-shadow .2s, background .2s;
}
.control input#clave { padding-right: 3rem; }
.control input::placeholder { color: rgba(169, 200, 245, .35); }
.control input:hover { border-color: rgba(169, 200, 245, .45); }
.control input:focus { border-color: var(--azul-claro); background: rgba(8, 14, 26, .8); box-shadow: 0 0 0 4px rgba(79, 127, 214, .2), 0 0 24px rgba(79, 127, 214, .18); }
.control:focus-within > svg { stroke: var(--trazo); }
.control input:-webkit-autofill { -webkit-text-fill-color: var(--papel); -webkit-box-shadow: 0 0 0 40px #0d1626 inset; caret-color: var(--papel); }
.ojo {
    position: absolute; right: .4rem; width: 38px; height: 38px; display: grid; place-items: center;
    border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: rgba(169, 200, 245, .6);
}
.ojo:hover { background: rgba(169, 200, 245, .08); color: var(--papel); }
.ojo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ojo[aria-pressed="true"] { color: var(--senal); }
.ojo:focus-visible, .pin-otro:focus-visible { outline: 2px solid var(--senal); outline-offset: 2px; }

/* ---------- PIN ---------- */
.pin-cab { display: flex; align-items: baseline; justify-content: space-between; }
.pin-tiempo { font-size: .72rem; color: rgba(169, 200, 245, .6); letter-spacing: .06em; }
.pin-tiempo.poco { color: var(--senal); }
.pin-imagen {
    position: relative; display: flex; align-items: center; gap: .6rem; padding: .35rem .35rem .35rem .5rem; margin-bottom: .55rem;
    border-radius: 12px; border: 1px dashed var(--linea-fuerte); overflow: hidden;
    background:
        linear-gradient(rgba(169, 200, 245, .05) 1px, transparent 1px) 0 0 / 12px 12px,
        linear-gradient(90deg, rgba(169, 200, 245, .05) 1px, transparent 1px) 0 0 / 12px 12px,
        rgba(8, 14, 26, .7);
}
.pin-imagen::after { /* haz que recorre el código */
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(47, 196, 178, .14), transparent);
    animation: escaner 3.2s var(--ease) infinite;
}
@keyframes escaner { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.pin-imagen img { flex: 1; min-width: 0; width: 100%; max-width: 220px; height: auto; aspect-ratio: 22 / 7; user-select: none; -webkit-user-drag: none; transition: opacity .25s, filter .25s; }
.pin-imagen img.cargando { opacity: .15; filter: blur(3px); }
.pin-otro {
    position: relative; margin-left: auto; flex: none; width: 44px; height: 44px; display: grid; place-items: center;
    border: 0; border-radius: 50%; background: rgba(169, 200, 245, .06); cursor: pointer; color: var(--trazo); transition: background .2s, color .2s;
}
.pin-otro:hover { background: rgba(238, 115, 46, .14); color: var(--senal); }
.pin-otro .anillo { position: absolute; inset: 2px; width: 40px; height: 40px; transform: rotate(-90deg); fill: none; stroke-width: 2.4; }
.pin-otro .anillo circle { stroke: rgba(169, 200, 245, .14); }
.pin-otro .anillo .avance { stroke: var(--cian); stroke-linecap: round; stroke-dasharray: 106.8; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear, stroke .3s; }
.pin-otro.poco .anillo .avance { stroke: var(--senal); }
.pin-otro .giro { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease); }
.pin-otro.girando .giro { transform: rotate(360deg); }

.pin-casillas { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.pin-casillas input {
    position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; opacity: 0; cursor: text;
    font-size: 16px; /* sin zoom en iOS */ letter-spacing: 1em;
}
.pin-casillas span {
    height: 48px; display: grid; place-items: center; border-radius: 11px;
    background: rgba(8, 14, 26, .6); border: 1px solid var(--linea-fuerte);
    font: 600 1.35rem/1 var(--mono); color: var(--papel); text-transform: uppercase;
    transition: border-color .18s, box-shadow .18s, transform .18s var(--ease), background .18s;
}
.pin-casillas span.lleno { border-color: rgba(47, 196, 178, .55); background: rgba(47, 196, 178, .07); animation: tecla .25s var(--ease); }
.pin-casillas span.activo { border-color: var(--azul-claro); box-shadow: 0 0 0 4px rgba(79, 127, 214, .2); }
.pin-casillas span.activo:empty::after { content: ""; width: 2px; height: 22px; background: var(--trazo); animation: cursor 1s steps(2) infinite; }
@keyframes tecla { from { transform: translateY(-3px) scale(1.06); } }
@keyframes cursor { 50% { opacity: 0; } }
.ayuda { margin-top: .5rem; font-size: .76rem; color: rgba(169, 200, 245, .55); line-height: 1.45; }

/* ---------- Botón ---------- */
.entrar {
    position: relative; overflow: hidden; margin-top: auto; height: 50px; width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    border: 0; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 1rem; color: #fff;
    background: linear-gradient(135deg, var(--senal), #e0581a);
    box-shadow: 0 10px 30px rgba(238, 115, 46, .28), inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .2s;
}
.entrar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.entrar::after { /* destello */
    content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg);
    animation: destello 4.5s var(--ease) infinite 1.5s;
}
@keyframes destello { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.entrar:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(238, 115, 46, .38), inset 0 1px 0 rgba(255, 255, 255, .2); }
.entrar:hover svg { transform: translateX(3px); }
.entrar:active { transform: translateY(0); }
.entrar:focus-visible { outline: 2px solid var(--papel); outline-offset: 3px; }
.entrar.cargando { pointer-events: none; filter: saturate(.8); }
.entrar.cargando svg { display: none; }
.entrar.cargando .txt::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: puntos 1.2s steps(4) infinite; }
@keyframes puntos { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- Avisos ---------- */
.alerta { display: flex; gap: .6rem; padding: .7rem .85rem; border-radius: 11px; font-size: .86rem; line-height: 1.4; }
.alerta::before { content: ""; flex: none; width: 3px; border-radius: 2px; background: currentColor; }
.alerta.err { background: rgba(255, 123, 114, .1); color: var(--error); border: 1px solid rgba(255, 123, 114, .25); }
.alerta.ok { background: rgba(47, 209, 112, .1); color: var(--verde-claro); border: 1px solid rgba(47, 209, 112, .25); }
.con-error form { animation: sacudir .45s var(--ease); }
@keyframes sacudir { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* ---------- Pie ---------- */
.pie {
    width: 100%; display: flex; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap;
    padding: 1rem 0 max(1.1rem, env(safe-area-inset-bottom)); font-size: .7rem; letter-spacing: .04em; color: rgba(169, 200, 245, .5);
    border-top: 1px solid rgba(169, 200, 245, .08);
}

/* ---------- Entrada ---------- */
.entra { opacity: 0; transform: translateY(14px); animation: entra .9s var(--ease) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; } .d3 { animation-delay: .28s; } .d4 { animation-delay: .4s; } .d5 { animation-delay: .52s; }
@keyframes entra { to { opacity: 1; transform: none; } }

/* ---------- Pantallas anchas: cuenta a la izquierda, código y botón a la derecha ---------- */
@media (min-width: 760px) {
    .acceso { width: min(800px, 100%); }
    .tarjeta { padding: 1.6rem 1.75rem 1.6rem; }
    form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.75rem; row-gap: 1rem; }
    form > .alerta { grid-column: 1 / -1; }
    .col-cuenta .nota { margin-top: auto; }
    .col-pin { padding-left: 1.75rem; border-left: 1px solid var(--linea); }
    .pin-imagen { padding-top: .2rem; padding-bottom: .2rem; }
    .pin-imagen img { max-width: 200px; }
}

/* ---------- Pantallas bajas: todo a la vista sin scroll ---------- */
@media (max-height: 760px) {
    .marca img { width: min(240px, 100%); }
    .marca { margin-bottom: .5rem; }
    .acceso { padding: .75rem 0; }
    .tarjeta { padding: 1.2rem 1.4rem; }
    .tarjeta-cab { margin-bottom: .9rem; }
    .icono { width: 38px; height: 38px; }
    .tarjeta h2 { font-size: 1.25rem; }
    form, .col { gap: .75rem; }
    .pin-imagen { margin-bottom: .4rem; }
    .pin-imagen img { max-width: 170px; }
    .pin-otro { width: 38px; height: 38px; }
    .pin-otro .anillo { width: 34px; height: 34px; }
    .pin-casillas span { height: 44px; }
    .entrar { height: 46px; }
    .pie { padding-top: .6rem; padding-bottom: .7rem; }
}
@media (max-height: 640px) {
    .marca img { width: min(200px, 100%); }
    .nota { display: none; }
}
@media (max-height: 540px) {
    .tarjeta-cab { display: none; }
    .pie { display: none; }
}
@media (max-width: 759px) and (max-height: 700px) {
    .pie { display: none; }
}

/* ---------- Celular ---------- */
@media (max-width: 759px) {
    .pie { flex-direction: column; align-items: center; text-align: center; gap: .2rem; }
    .nota { display: none; }
}
@media (max-width: 600px) {
    .marca img { width: min(260px, 76vw); }
    .tarjeta { padding: 1.3rem 1.1rem 1.2rem; }
}
@media (max-width: 380px) {
    .pin-casillas { gap: .35rem; }
    .pin-casillas span { height: 44px; font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    .entra { animation: none; opacity: 1; transform: none; }
    .tarjeta::before, .pin-imagen::after, .entrar::after { animation: none; }
    .con-error form { animation: none; }
}
