/* LOGIN-E3 — estilos del login E3 espacial (referencia: worlds-login-e3-final.html).
   Acotado a section.v-e3 y sus hijos; fuera de él solo van las dos reglas de página
   imprescindibles (margen y desbordamiento horizontal del body).

   FONDO: .v-e3 es position:fixed con scroll propio, así que el degradado no depende de la
   altura de body (no reintroduce el corte horizontal de FONDO-CONTINUO).

   MULTIMEDIA: figure.media (16:9). Hijo .art = contenido gráfico temporal (estado actual).
   Hijo .vid = hueco para el vídeo futuro. Para incorporar el vídeo: colocar un <video>
   dentro de .vid y cambiar data-media="art" por data-media="video" en section.v-e3. */

html, body { margin: 0; }
body { overflow-x: hidden; }

.v-e3 {
  --ink: #16132f; --muted: #625e85; --soft: #9a96b8;
  --blue: #2f95ea; --violet: #6c4cf1; --pink: #e04f9b;
  --grad: linear-gradient(100deg, #2f95ea 0%, #7c5cf5 52%, #e04f9b 100%);
  --sans: "Ubuntu", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Ubuntu Mono", "DejaVu Sans Mono", ui-monospace, monospace;
  --err: #c42d5b;
  font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased;
}
.v-e3, .v-e3 *, .v-e3 *::before, .v-e3 *::after { box-sizing: border-box; }
.v-e3 button, .v-e3 input { font: inherit; color: inherit; }
.v-e3 a { color: inherit; }
.v-e3 .oculto { display: none !important; }
.v-e3 :focus-visible { outline: 3px solid rgba(124,92,245,.6); outline-offset: 2px; }

/* Contenedor fijo con scroll propio y fondo de tres radiales sobre lineal */
.v-e3 {
  position: fixed; inset: 0; overflow-x: hidden; overflow-y: auto;
  background:
    radial-gradient(42vw 42vw at 4% 10%, rgba(120,200,250,.75), transparent 62%),
    radial-gradient(36vw 36vw at 100% 42%, rgba(242,150,200,.6), transparent 62%),
    radial-gradient(38vw 38vw at 46% 108%, rgba(170,148,250,.55), transparent 62%),
    linear-gradient(115deg, #d9effc 0%, #eeeafc 50%, #f9e4ef 100%);
}

/* ---- Escena decorativa ---- */
.v-e3 .scene { position: fixed; inset: 0; perspective: 1200px; perspective-origin: 50% 46%; pointer-events: none; overflow: hidden; }
.v-e3 .p { position: absolute; transform-style: preserve-3d; will-change: transform; }
.v-e3 .base, .v-e3 .spin { transform-style: preserve-3d; }
.v-e3 .floor { position: absolute; left: -60%; right: -60%; bottom: -38%; height: 78%; transform: rotateX(78deg); transform-origin: 50% 100%;
  background: repeating-linear-gradient(90deg, rgba(108,76,241,.18) 0 1px, transparent 1px 80px), repeating-linear-gradient(0deg, rgba(47,149,234,.16) 0 1px, transparent 1px 80px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 75%); mask-image: linear-gradient(to top, #000 0%, transparent 75%); }
.v-e3 .gate { width: min(300px, 20vw); height: min(640px, 72vh); border-radius: 26px; border: 1px solid rgba(255,255,255,.85);
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.08)); box-shadow: inset 0 0 0 1px rgba(108,76,241,.12); }
.v-e3 .gate::before { content: ""; position: absolute; inset: 18px; border-radius: 16px; border: 1px solid rgba(108,76,241,.18); }
.v-e3 .gate.l { background: linear-gradient(180deg, rgba(132,205,250,.45), rgba(255,255,255,.05)); }
.v-e3 .gate.r { background: linear-gradient(180deg, rgba(240,160,205,.42), rgba(255,255,255,.05)); }
.v-e3 .slab { width: 420px; height: 300px; border-radius: 24px; border: 1px solid rgba(255,255,255,.9); }
.v-e3 .slab.b { background: linear-gradient(135deg, rgba(64,170,240,.55), rgba(64,170,240,.08)); }
.v-e3 .slab.v { background: linear-gradient(135deg, rgba(124,92,245,.45), rgba(124,92,245,.06)); }
.v-e3 .slab.k { background: linear-gradient(135deg, rgba(230,110,175,.5), rgba(230,110,175,.06)); }
.v-e3 .cube { position: relative; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.7,.3,1); }
.v-e3 .cube i { position: absolute; inset: 0; border: 1px solid rgba(108,76,241,.42); background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.15)); }
.v-e3 .cube.tb i { border-color: rgba(47,149,234,.5); background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(132,205,250,.25)); }
.v-e3 .cube.tk i { border-color: rgba(224,79,155,.45); background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(240,160,205,.25)); }
.v-e3 .cube i:nth-child(1) { transform: translateZ(var(--h)); }
.v-e3 .cube i:nth-child(2) { transform: rotateY(180deg) translateZ(var(--h)); }
.v-e3 .cube i:nth-child(3) { transform: rotateY(90deg) translateZ(var(--h)); }
.v-e3 .cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(var(--h)); }
.v-e3 .cube i:nth-child(5) { transform: rotateX(90deg) translateZ(var(--h)); }
.v-e3 .cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(var(--h)); }
.v-e3 .spin { animation: e3-espin var(--d, 60s) linear infinite; }
@keyframes e3-espin { to { transform: rotateX(360deg) rotateY(360deg); } }
.v-e3 .frag { border: 1px solid rgba(108,76,241,.35); background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.1)); border-radius: 6px; }
.v-e3 .dia { width: 7px; height: 7px; transform: rotate(45deg); background: var(--c, #7c5cf5); opacity: .55; border-radius: 1px; }
.v-e3 .ln { height: 1px; background: linear-gradient(90deg, transparent, rgba(108,76,241,.45), transparent); }
.v-e3 .glow { position: fixed; left: 50%; top: 48%; width: 760px; height: 560px; margin: -280px 0 0 -380px; border-radius: 50%; filter: blur(70px); opacity: .55;
  background: radial-gradient(circle, var(--gl, rgba(124,92,245,.45)), transparent 70%); transition: background .6s ease; pointer-events: none; }

/* ---- Rejilla de tres columnas: las laterales iguales centran el formulario ---- */
.v-e3 .wrap { position: relative; z-index: 3; min-height: 100%;
  display: grid; grid-template-columns: minmax(0,1fr) minmax(430px, clamp(430px, 34vw, 530px)) minmax(0,1fr);
  column-gap: clamp(28px, 3.4vw, 64px); row-gap: 18px; align-items: center; align-content: center; padding: 40px 36px 56px; }
.v-e3 .stackr { display: contents; }
.v-e3 .msg3 { justify-self: end; width: 100%; max-width: 300px; }
.v-e3 .pl.right { justify-self: start; width: 100%; max-width: 500px; }
.v-e3 .pl { border-radius: 24px; background: rgba(255,255,255,.5); border: 1px solid #fff; padding: 22px; backdrop-filter: blur(6px); }
.v-e3 .pl.right { padding: 14px; transform: perspective(1200px) rotateY(-20deg); transform-origin: 0 50%; }
.v-e3 .pl.right .media { box-shadow: none; }
.v-e3 .pl.right .tag { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #6a6690; padding: 4px 6px 10px; }

/* ---- Texto ---- */
.v-e3 .msg3 { position: relative; color: var(--ink); padding: 6px 2px; }
.v-e3 .msg3 h1 { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.08; font-size: clamp(26px, 2.1vw, 34px); }
.v-e3 .msg3 p { margin: 14px 0 0; font-size: 15px; line-height: 1.5; color: #4f4b72; max-width: 30ch; }
.v-e3 .msg3 .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.v-e3 .msg3.ta h1 span { display: flex; align-items: center; gap: 12px; }
.v-e3 .msg3.ta h1 span::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); border-radius: 2px; background: var(--c); }
.v-e3 .msg3.ta h1 span:nth-child(2) { padding-left: 18px; }
.v-e3 .msg3.ta h1 span:nth-child(3) { padding-left: 36px; }
.v-e3 .msg3.ta p { padding-left: 36px; border-left: 1.5px solid rgba(108,76,241,.25); margin-left: 4px; padding-top: 2px; }

/* ---- Panel del formulario ---- */
.v-e3 .panel { width: 100%; padding: 40px 44px 32px; border-radius: 30px; background: rgba(255,255,255,.84); border: 1px solid #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 30px 70px -36px rgba(76,52,170,.45); backdrop-filter: blur(14px); transition: transform .9s cubic-bezier(.2,.7,.3,1), opacity .6s; }
.v-e3 .panel .logo { display: block; height: 40px; width: auto; margin: 0 auto 10px; }
.v-e3 .panel .sub { text-align: center; margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.v-e3 .lf { display: grid; gap: 16px; }
.v-e3 .fld { display: grid; gap: 7px; }
.v-e3 .fld label { font-family: var(--mono); font-weight: 400; letter-spacing: .14em; text-transform: uppercase; font-size: 11.5px; color: #5d5980; }
.v-e3 .fld input { width: 100%; height: 54px; padding: 0 16px; border-radius: 12px; background: #fff; border: 1.5px solid #e3ddf8; font-size: 16.5px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s; }
.v-e3 .fld input:focus { border-color: var(--fc, #7c5cf5); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fc, #7c5cf5) 16%, transparent); }
.v-e3 .pw { position: relative; }
.v-e3 .pw input { padding-right: 52px; }
.v-e3 .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer; display: grid; place-items: center; opacity: .75; font-size: 17px; line-height: 1; padding: 0; }
.v-e3 .eye:hover { opacity: 1; }
.v-e3 .chk { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #38345a; user-select: none; }
.v-e3 .chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--violet); cursor: pointer; }
.v-e3 .chk label { cursor: pointer; }
.v-e3 .msg-error, .v-e3 .msg-ok { min-height: 20px; margin: 0; font-size: 13.5px; font-weight: 600; }
.v-e3 .msg-error { color: var(--err); }
.v-e3 .msg-ok { color: #14766d; }
.v-e3 .go { width: 100%; height: 56px; border: 0; border-radius: 14px; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--grad); color: #fff;
  box-shadow: 0 14px 28px -14px rgba(124,92,245,.85); transition: transform .12s, box-shadow .18s, filter .18s; }
.v-e3 .go:hover { filter: brightness(1.06); }
.v-e3 .go:active { transform: translateY(1px); }
.v-e3 .go:disabled { opacity: .6; cursor: default; filter: none; }
.v-e3 .links { display: flex; flex-direction: column; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: 14px; }
.v-e3 .links a, .v-e3 .links .login-link { color: #4a2fd0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; background: none; border: 0; padding: 0; }

/* ---- Enlaces legales (los pinta js/textos-legales.js dentro de footer[data-pie-legal]) ---- */
.v-e3 .legal { grid-column: 2; position: relative; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 0; padding: 0; font-size: 12.5px; color: #6a6690; }
.v-e3 .legal a { color: #5d5980; text-decoration: underline; text-underline-offset: 3px; }
.v-e3 .legal a:hover { color: #4a2fd0; }

/* ---- Multimedia 16:9 ---- */
.v-e3 .media { position: relative; aspect-ratio: 16/9; border-radius: 20px; overflow: hidden; border: 1px solid #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 24px 50px -30px rgba(76,52,170,.45); background: #f3f0fd; margin: 0; }
.v-e3 .media > div { position: absolute; inset: 0; transition: opacity .45s; }
.v-e3[data-media="art"] .media .vid { opacity: 0; visibility: hidden; }
.v-e3[data-media="video"] .media .art { opacity: 0; visibility: hidden; }
.v-e3 .art { background: radial-gradient(70% 90% at 15% 10%, rgba(132,205,250,.75), transparent 60%), radial-gradient(70% 90% at 95% 85%, rgba(240,160,205,.7), transparent 60%), linear-gradient(120deg, #e4f3fd, #efeafd 55%, #fbe7f1); perspective: 700px; }
.v-e3 .art .afl { position: absolute; left: -30%; right: -30%; bottom: -48%; height: 95%; transform: rotateX(76deg); transform-origin: 50% 100%;
  background: repeating-linear-gradient(90deg, rgba(108,76,241,.22) 0 1px, transparent 1px 34px), repeating-linear-gradient(0deg, rgba(47,149,234,.2) 0 1px, transparent 1px 34px);
  -webkit-mask-image: linear-gradient(to top, #000, transparent 85%); mask-image: linear-gradient(to top, #000, transparent 85%); }
.v-e3 .art .stack { position: absolute; left: 50%; top: 44%; transform-style: preserve-3d; transform: rotateX(52deg) rotateZ(-38deg); }
.v-e3 .art .lay { position: absolute; width: 150px; height: 150px; left: -75px; top: -75px; border-radius: 16px; border: 1px solid rgba(255,255,255,.95); animation: e3-float 7s ease-in-out infinite; }
.v-e3 .art .lay.l1 { transform: translateZ(0); background: linear-gradient(135deg, rgba(64,170,240,.55), rgba(255,255,255,.2)); }
.v-e3 .art .lay.l2 { transform: translateZ(34px); background: linear-gradient(135deg, rgba(124,92,245,.5), rgba(255,255,255,.2)); animation-delay: -2s; }
.v-e3 .art .lay.l3 { transform: translateZ(68px); background: linear-gradient(135deg, rgba(230,110,175,.55), rgba(255,255,255,.25)); animation-delay: -4s; }
@keyframes e3-float { 50% { margin-top: -6px; } }
.v-e3 .art .ac { position: absolute; transform-style: preserve-3d; }
.v-e3 .art .ac .cube { animation: e3-espin var(--d, 40s) linear infinite; }
.v-e3 .art .cap { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.v-e3 .art .cap span { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #4a2fd0; background: rgba(255,255,255,.82); border: 1px solid #fff; border-radius: 999px; padding: 5px 10px; }
.v-e3 .vid { background: linear-gradient(135deg, #eceaf6, #e2def3); display: grid; place-items: center; }
.v-e3 .vid::before { content: ""; position: absolute; inset: 14px; border: 1px dashed rgba(108,76,241,.35); border-radius: 12px; }
.v-e3 .vid span { position: relative; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #6a6690; }

/* ---- Responsive ---- */
@media (min-width: 1600px) {
  .v-e3 .panel { width: 100%; padding: 46px 50px 36px; }
}
@media (max-width: 1199px) and (min-width: 901px) {
  .v-e3 .wrap { grid-template-columns: minmax(0,1fr) minmax(0,1fr); row-gap: 24px; }
  .v-e3 .panel { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: min(500px, 100%); }
  .v-e3 .legal { grid-column: 1 / -1; grid-row: 2; }
  .v-e3 .msg3 { grid-column: 1; grid-row: 3; justify-self: end; align-self: center; }
  .v-e3 .pl.right { grid-column: 2; grid-row: 3; transform: perspective(1200px) rotateY(-8deg); }
}
@media (max-height: 780px) and (min-width: 901px) {
  .v-e3 .wrap { padding: 22px 36px 40px; }
  .v-e3 .media { max-height: 34vh; }
  .v-e3 .panel { padding: 30px 40px 24px; }
  .v-e3 .panel .sub { margin-bottom: 18px; }
  .v-e3 .lf { gap: 12px; }
}
@media (max-width: 900px) {
  .v-e3 { position: relative; min-height: 100vh; overflow-x: clip; overflow-y: visible; }
  body { overflow-y: auto; }
  .v-e3 .gate, .v-e3 .sec-hide { display: none; }
  .v-e3 .wrap { display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding: 96px 16px 40px; }
  .v-e3 .pl { transform: none !important; }
  .v-e3 .panel { order: -1; width: 100%; max-width: 560px; align-self: center; padding: 32px 24px 26px; border-radius: 24px; }
  .v-e3 .msg3, .v-e3 .pl.right { max-width: none; justify-self: stretch; }
  .v-e3 .msg3 { padding: 4px 6px; }
  .v-e3 .msg3 p { max-width: none; }
  .v-e3 .legal { align-self: center; }
}
@media (max-width: 420px) {
  .v-e3 .links { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .v-e3, .v-e3 *, .v-e3 *::before, .v-e3 *::after { animation: none !important; transition: none !important; }
}

/* ---- Modo solo fondo (registro de alumnos): section.v-e3.v-e3-fondo ----
   Capa fija de pantalla completa con degradado y escena, detrás del contenido de la página
   (que sigue en su flujo normal y hace su propio scroll). Va al final para ganar a las media
   queries que vuelven .v-e3 relativo en móvil. */
.v-e3.v-e3-fondo { position: fixed; inset: 0; z-index: 0; min-height: 0; overflow: hidden; pointer-events: none; }
