@charset "UTF-8";
/* Login: usa las variables de tema de estilos.css (--fondo, --tarjeta, --borde, --texto) */
#login {
  --azul: #0a4a9f;
  --celeste: #00a3e0;
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 1rem;
  background: var(--fondo); overflow: auto;
}
#login[hidden] { display: none; }

#login::before, #login::after {
  content: ""; position: fixed; border-radius: 50%; filter: blur(70px); opacity: .35; z-index: -1;
  animation: flotar 12s ease-in-out infinite alternate;
}
#login::before { width: 380px; height: 380px; background: var(--celeste); top: -120px; left: -100px; }
#login::after  { width: 440px; height: 440px; background: var(--azul); bottom: -160px; right: -120px; animation-delay: -6s; }
@keyframes flotar { to { transform: translate(60px, 40px) scale(1.15); } }

.login-marco {
  width: min(900px, 100%); min-height: 520px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,.25);
  animation: entrada .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes entrada { from { opacity: 0; transform: translateY(30px) scale(.97); } }

.login-lado {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 2rem; color: #fff; overflow: hidden;
}
.login-lado::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(160deg, rgba(10,50,130,.9), rgba(0,140,210,.7)), url("../img/portada.jpg") center / cover;
  animation: zoom 20s ease-in-out infinite alternate;
}
@keyframes zoom { to { transform: scale(1.12); } }
.login-lado > * { position: relative; z-index: 1; }
.login-logo { font-weight: 800; font-size: 1.5rem; letter-spacing: .12em; }
.login-lado h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 .7rem; }
.login-lado p { margin: 0; opacity: .9; font-size: .98rem; }
.login-roles { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.login-roles span {
  background: rgba(255,255,255,.18); backdrop-filter: blur(4px);
  padding: .3rem .8rem; border-radius: 99px; font-size: .82rem;
}

.login-form { padding: 2.4rem 2.2rem; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 .3rem; font-size: 1.6rem; }
.login-sub { margin: 0 0 1.4rem; opacity: .7; font-size: .95rem; }

.login-form > * { animation: subir .6s ease both; }
.login-form > :nth-child(1) { animation-delay: .25s; }
.login-form > :nth-child(2) { animation-delay: .32s; }
.login-form > :nth-child(3) { animation-delay: .4s; }
.login-form > :nth-child(4) { animation-delay: .48s; }
.login-form > :nth-child(5) { animation-delay: .56s; }
@keyframes subir { from { opacity: 0; transform: translateY(14px); } }

.login-form label { display: block; margin: .8rem 0; font-size: .9rem; font-weight: 600; }
.campo { position: relative; margin-top: .3rem; }
.campo > svg {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  opacity: .5; transition: .2s; pointer-events: none;
}
.campo input {
  display: block; width: 100%; padding: .75rem .9rem .75rem 2.6rem;
  border-radius: 10px; border: 1.5px solid var(--borde);
  background: var(--fondo); color: var(--texto); font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.campo input:focus { outline: 0; border-color: var(--celeste); box-shadow: 0 0 0 4px rgba(0,163,224,.18); }
.campo:focus-within > svg { opacity: 1; stroke: var(--celeste); transform: translateY(-50%) scale(1.12); }

.ver-clave {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: .4rem; cursor: pointer; color: inherit; opacity: .55; border-radius: 8px;
}
.ver-clave:hover { opacity: 1; }
.ver-clave svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; display: block; }
.campo.con-ojo input { padding-right: 2.8rem; }

.login-form .boton {
  position: relative; width: 100%; margin-top: .6rem; padding: .85rem; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, var(--azul), var(--celeste)); color: #fff;
  font-size: 1.05rem; font-weight: 700; cursor: pointer; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.login-form .boton:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,120,200,.35); }
.login-form .boton:active { transform: translateY(0); }
.login-form .boton:disabled { opacity: .75; cursor: default; transform: none; box-shadow: none; }
.login-form .boton.cargando span { opacity: 0; }
.login-form .boton.cargando::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

#msgLogin { margin: .8rem 0 0; min-height: 1.2em; color: #c0392b; font-weight: 600; font-size: .92rem; }
[data-tema="oscuro"] #msgLogin { color: #ff8a80; }
.login-marco.error { animation: sacudir .45s; }
@keyframes sacudir {
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

@media (max-width: 760px) {
  .login-marco { grid-template-columns: 1fr; min-height: 0; }
  .login-lado { display: none; }
  .login-form { padding: 2rem 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  #login *, #login::before, #login::after { animation: none !important; }
}

/* Usuario y botón salir en la barra */
.vista { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; }
.salir { background: rgba(255,255,255,.2); color: #fff; border: 0; padding: .4rem .9rem; border-radius: 8px; font-size: .95rem; cursor: pointer; }
.salir:hover { background: rgba(255,255,255,.32); }