/* Login de Mateo2819.
   Idea: "Id, y haced discípulos" como movimiento. Una persona forma a otras y esas a otras:
   el lienzo del fondo (js/login-red.js) dibuja esa multiplicación en vivo. */
:root {
  --cobalto:       #2B41D9;
  --cobalto-luz:   #3F5BF6;
  --cobalto-hondo: #1B2A9C;
  --lima:          #C8F250;
  --papel:         #FAF9F6;
  --tinta:         #17171C;
  --tinta-suave:   #5C5B66;
  --linea:         #E6E4DE;
  --error:         #B4232A;
  --error-fondo:   #FCEDEE;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: 'Geist', system-ui, sans-serif;
  color: var(--tinta);
  background: var(--cobalto);
  overflow-x: hidden;
}

.pantalla {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 27rem);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(1.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(90% 70% at 8% 50%, var(--cobalto-luz) 0%, transparent 60%),
    linear-gradient(120deg, var(--cobalto) 0%, var(--cobalto-hondo) 100%);
  isolation: isolate;
}

/* Lienzo de la multiplicación: ocupa todo el fondo */
#red {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* ── Mensaje ───────────────────────────────────── */
.mensaje {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  min-width: 0;
}

.marca {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 500;
  font-size: .95rem;
}
.marca img { height: 34px; width: 34px; border-radius: 9px; }
.marca small { display: block; font-size: .8rem; font-weight: 400; color: rgba(255, 255, 255, .72); }

.lema {
  font-family: 'Bricolage Grotesque', 'Geist', sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 7.2vw, 6.4rem);
  line-height: .94;
  letter-spacing: -0.035em;
  font-variation-settings: 'opsz' 96;
  max-width: 9.5em;
  text-wrap: balance;
}
/* Cada palabra entra desde abajo, una tras otra */
.lema .p {
  display: inline-block;
  opacity: 0;
  transform: translateY(.55em) rotate(2deg);
  animation: sube .9s cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: calc(var(--i) * 110ms + 250ms);
}
@keyframes sube { to { opacity: 1; transform: none; } }

.cita {
  margin-top: 1.4rem;
  font-size: clamp(.95rem, 1.3vw, 1.1rem);
  color: rgba(255, 255, 255, .8);
  opacity: 0;
  animation: aparece .8s ease forwards 1.3s;
}
@keyframes aparece { to { opacity: 1; } }

.pie { font-size: .8rem; color: rgba(255, 255, 255, .6); }

/* ── Formulario ────────────────────────────────── */
.acceso {
  background: var(--papel);
  border-radius: 1.6rem;
  padding: clamp(1.6rem, 3vw, 2.6rem);
  box-shadow: 0 40px 80px -30px rgba(10, 16, 70, .65);
  opacity: 0;
  transform: translateY(1.2rem) scale(.985);
  animation: llega .9s cubic-bezier(.16, 1, .3, 1) forwards .35s;
}
@keyframes llega { to { opacity: 1; transform: none; } }

.acceso h1 {
  font-family: 'Bricolage Grotesque', 'Geist', sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.sub { margin-top: .6rem; font-size: .95rem; line-height: 1.5; color: var(--tinta-suave); }

.acceso form { margin-top: 1.7rem; }
.campo { margin-bottom: 1.05rem; }
.campo label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; }
.campo-caja { position: relative; }

.campo input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--tinta);
  background: #fff;
  border: 1.5px solid var(--linea);
  border-radius: .85rem;
  padding: .85rem 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.campo input:focus {
  outline: none;
  border-color: var(--cobalto-luz);
  box-shadow: 0 0 0 4px rgba(63, 91, 246, .18);
}

.ver-clave {
  position: absolute;
  top: 50%;
  right: .4rem;
  transform: translateY(-50%);
  border: 0;
  background: none;
  padding: .55rem;
  cursor: pointer;
  color: var(--tinta-suave);
  border-radius: .6rem;
  line-height: 0;
}
.ver-clave:hover { color: var(--tinta); }
.ver-clave:focus-visible { outline: 2px solid var(--cobalto-luz); outline-offset: 2px; }

.entrar {
  position: relative;
  width: 100%;
  margin-top: .5rem;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--cobalto-luz);
  border: 0;
  border-radius: .85rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s ease, background .18s ease;
}
.entrar:hover { background: var(--cobalto); transform: translateY(-2px); box-shadow: 0 16px 28px -14px rgba(43, 65, 217, .8); }
.entrar:active { transform: translateY(0) scale(.985); box-shadow: none; }
.entrar:focus-visible { outline: 3px solid rgba(63, 91, 246, .45); outline-offset: 3px; }
.entrar[disabled] { cursor: wait; }
/* Al enviar, una franja lima recorre el botón: algo se está moviendo */
.entrar[disabled]::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 40%;
  background: var(--lima);
  border-radius: 4px;
  animation: recorre 1.1s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes recorre { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.alerta {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  background: var(--error-fondo);
  color: var(--error);
  border-radius: .85rem;
  padding: .8rem .95rem;
  font-size: .9rem;
  line-height: 1.45;
  margin-top: 1.3rem;
  animation: sacude .45s cubic-bezier(.36, .07, .19, .97);
}
.alerta svg { flex-shrink: 0; margin-top: .15rem; }
@keyframes sacude {
  15% { transform: translateX(-6px); }
  35% { transform: translateX(5px); }
  55% { transform: translateX(-3px); }
  75% { transform: translateX(2px); }
}

/* Aviso neutro (sesión vencida): informa, no regaña */
.alerta-info { background: rgba(63, 91, 246, .1); color: var(--cobalto); animation: none; }

/* Mayúsculas activadas, bajo la contraseña */
.mayus { margin-top: .45rem; font-size: .8rem; font-weight: 600; color: var(--error); }
.mayus[hidden] { display: none; }

.ayuda { margin-top: 1.4rem; font-size: .85rem; line-height: 1.5; color: var(--tinta-suave); }

@media (max-width: 899.98px) {
  .pantalla { grid-template-columns: 1fr; align-items: end; align-content: space-between; }
  .mensaje { align-self: start; gap: 2rem; }
  .lema { font-size: clamp(2.5rem, 12vw, 4rem); }
  .pie { display: none; }
  #red { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  .lema .p, .cita, .acceso, .alerta { animation: none; opacity: 1; transform: none; }
  .entrar, .campo input { transition: none; }
  .entrar[disabled]::after { animation: none; width: 100%; }
}
