  @keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
  }

  @keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(25px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  @keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
  }

  @keyframes logoPulse {
    0%, 100% {
      filter: drop-shadow(0 4px 15px rgba(234, 179, 8, 0.3)) drop-shadow(0 0 8px rgba(234, 179, 8, 0.15));
      transform: scale(1);
    }
    50% {
      filter: drop-shadow(0 4px 25px rgba(234, 179, 8, 0.55)) drop-shadow(0 0 15px rgba(234, 179, 8, 0.35));
      transform: scale(1.01);
    }
  }

  .login-bg {
    background: linear-gradient(-45deg, #001a33, #003363, #001a33, #0d1b2a);
    background-size: 400% 400%;
    animation: gradientShift 18s ease infinite;
  }

  .login-card {
    animation: fadeSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .login-card.shake {
    animation: shake 0.45s ease-in-out;
  }

  .stagger-item {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .stagger-1 { animation-delay: 0.1s; }
  .stagger-2 { animation-delay: 0.2s; }
  .stagger-3 { animation-delay: 0.3s; }
  .stagger-4 { animation-delay: 0.4s; }

  .input-glow:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 0 18px rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
  }

  /* Ocultar el icono del ojo del navegador para mantener el texto centrado */
  input[type="password"]::-ms-reveal,
  input[type="password"]::-ms-clear {
    display: none;
  }

  input[type="password"]::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
  }

  /* Suprimir el fondo blanco/amarillo que pinta el navegador al autocompletar
     (mantiene el estilo glass del input) */
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(10, 25, 55, 0.65) inset !important;
    box-shadow: 0 0 0 1000px rgba(10, 25, 55, 0.65) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    caret-color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
  }
  input:-moz-autofill {
    box-shadow: 0 0 0 1000px rgba(10, 25, 55, 0.65) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
  }
  /* Autofill + focus: reactivar el glow azul sin perder el fondo glass */
  input:-webkit-autofill:focus {
    -webkit-box-shadow:
      0 0 0 1000px rgba(10, 25, 55, 0.65) inset !important,
      0 0 0 3px rgba(59, 130, 246, 0.35),
      0 0 18px rgba(59, 130, 246, 0.25) !important;
    box-shadow:
      0 0 0 1000px rgba(10, 25, 55, 0.65) inset !important,
      0 0 0 3px rgba(59, 130, 246, 0.35),
      0 0 18px rgba(59, 130, 246, 0.25) !important;
  }

  .btn-shine {
    position: relative;
    overflow: hidden;
  }
  .btn-shine::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(25deg);
    transition: left 0.7s ease;
  }
  .btn-shine:hover::after {
    left: 110%;
  }

  .spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
  }

  .floating-watermark {
    animation: float 8s ease-in-out infinite;
  }

  /* Panel del formulario - sin blur */
  .glass-panel {
    background: rgba(0, 20, 50, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }

  .glass-card {
    background: rgba(0, 30, 60, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  /* Orbs responsivos */
  .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: pulse-glow 6s ease-in-out infinite;
  }

  .orb-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(59, 130, 246, 0.1) 70%);
    top: -5%;
    left: -5%;
  }

  .orb-2 {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(234, 179, 8, 0.3) 0%, rgba(234, 179, 8, 0.05) 70%);
    bottom: -5%;
    right: -5%;
    animation-delay: -3s;
  }

  .orb-3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: -1.5s;
  }

  @media (min-width: 640px) {
    .orb-1 { width: 350px; height: 350px; }
    .orb-2 { width: 400px; height: 400px; }
    .orb-3 { width: 250px; height: 250px; }
  }

  .logo-container {
    width: 100%;
    max-width: 220px;
  }

  .logo-glow {
    animation: logoPulse 2.5s ease-in-out infinite;
    will-change: filter, transform;
  }

  .glass-form-panel {
    margin-top: 0;
    padding: 28px 24px 24px;
  }

  @media (min-width: 640px) {
    .logo-container { max-width: 300px; }
    .glass-form-panel { padding: 32px 28px 28px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* === #1 Toggle password eye === */
  .pwd-wrap { position: relative; }
  .toggle-pwd {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 0.35rem 0.45rem;
    border-radius: 0.5rem;
    transition: color 0.18s ease, background 0.18s ease;
    z-index: 5;
    line-height: 0;
  }
  .toggle-pwd:hover,
  .toggle-pwd:focus-visible {
    color: #facc15;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
  }
  .toggle-pwd:focus-visible {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.6);
  }
  .toggle-pwd svg { width: 18px; height: 18px; pointer-events: none; display: block; }
  .toggle-pwd .hidden { display: none !important; }

  /* === #3 Ripple effect === */
  .btn-shine { position: relative; }
  .btn-shine .ripple-dot {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.42);
    animation: ripple-anim 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 2;
  }
  @keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
  }

  /* === #7 Tooltip Ctrl+Enter on the submit button === */
  .btn-shine::before {
    content: 'Ctrl+Enter ↵';
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(15, 30, 55, 0.95);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.32rem 0.6rem;
    border-radius: 0.4rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    z-index: 4;
  }
  .btn-shine:hover::before,
  .btn-shine:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .btn-shine::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(15, 30, 55, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 4;
  }
  .btn-shine:hover::after,
  .btn-shine:focus-visible::after {
    opacity: 1;
  }

  /* === #8 Inline progress bar === */
  .progress-track {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.65rem;
    transition: opacity 0.18s ease;
  }
  .progress-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, #60a5fa, #facc15);
    border-radius: 9999px;
    animation: progress-fill 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  }
  @keyframes progress-fill {
    from { width: 0%; }
    to { width: 100%; }
  }

  /* === Submit "success" state === */
  .btn-success {
    background-image: linear-gradient(90deg, #0e8345, #16a34a) !important;
  }

/* ====================================================
   ACCESO 2026-09-25 — encabezado, rótulos visibles,
   separación del panel y aviso de error sin salto.
   Nota: los margenes interiores de los campos se declaran
   aqui porque las clases pl-4/pr-12 no existen en la hoja
   compilada de Tailwind (hoja desactualizada).
   ==================================================== */

.login-heading {
  text-align: center;
  margin-bottom: 1.15rem;
}
.login-heading h1 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
}
.login-heading p {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(203, 213, 225, 0.9);
}

.field-label {
  display: block;
  margin: 0 0 0.35rem 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.9);
}

/* Margen interior garantizado y texto alineado a la izquierda,
   para que los rotulos y lo que se escribe queden alineados. */
.login-card input[type="text"],
.login-card input[type="password"] {
  padding-left: 1rem;
  padding-right: 1rem;
  text-align: left;
}
/* El campo de contrasena reserva espacio para el ojo (icono a la derecha). */
.login-card .pwd-wrap input[type="password"] {
  padding-right: 3rem;
}

/* Separacion del panel respecto al sello del fondo. */
.glass-form-panel {
  background: rgba(0, 20, 50, 0.86);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Aviso de error: mismas esquinas que el resto del panel (12px) y
   aparicion/desaparicion suave, sin que la tarjeta salte de golpe. */
#message-area {
  border-radius: 12px;
  max-height: 160px;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.28s ease,
              margin 0.28s ease, padding 0.28s ease;
}
#message-area.hidden {
  display: block !important;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}

/* Estado del widget Turnstile.
   El widget ya comunica por si mismo el resultado (check verde / error), asi
   que el texto auxiliar no se muestra en el flujo normal: solo aparece si la
   verificacion falla o hay que esperar, para no dejar al usuario sin pista
   cuando el envio del formulario se bloquea. */
.turnstile-status {
  display: none;
}
.turnstile-status.fail {
  display: block;
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #fecaca;
}
.turnstile-status.ok {
  display: block;
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #86efac;
}

/* Verificacion superada: el widget se retira solo para dejar limpio el
   formulario. Misma tecnica que #message-area (max-height + opacidad) para que
   el boton "Ingresar" suba acompanando, sin salto.
   Se usa max-height y no display:none a proposito: el widget queda en el DOM y
   onTurnstileExpired/Error puede devolverlo al flujo. Si lo sacaramos del todo,
   un token vencido dejaria al usuario con el formulario "limpio" pero sin
   ninguna forma de volver a verificar. */
.turnstile-wrap {
  max-height: 480px;
  overflow: hidden;
  transition:
    max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease,
    margin 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* El `opacity` no se define aqui a proposito: `.stagger-item` lo declara en 0 y
   el JS lo fija inline al terminar la entrada, asi que un `opacity: 0` desde
   esta clase competiria con ese valor inline. La opacidad la maneja el JS
   (1 al mostrar, 0 al retirar) y esta transicion es la que la anima. */
.turnstile-wrap.ts-done {
  max-height: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  pointer-events: none;
}

/* Halo suave en "Ingresar" cuando la verificacion ya esta lista: confirma que
   el retiro del widget fue un exito y no un fallo silencioso. */
@keyframes ts-ready-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); }
}
#login-submit.ts-ready {
  animation: ts-ready-pulse 1.1s ease-out 1;
}

@media (prefers-reduced-motion: reduce) {
  .turnstile-wrap { transition: none; }
  #login-submit.ts-ready { animation: none; }
}

/* ==== Ajustes visuales: acento dorado del logo, widget, pie y foco ==== */

/* Boton principal en el dorado del logo, con texto azul marino oscuro para
   que el contraste sea alto. Va por ID para ganar a las clases de Tailwind. */
#login-submit {
  background-image: none;
  background-color: #f5b700;
  color: #0f2a47;
  box-shadow: 0 10px 24px -12px rgba(245, 183, 0, 0.6);
}
#login-submit:hover:not(:disabled) {
  background-color: #ffc92e;
}
#login-submit:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* Widget de Cloudflare dentro de la tarjeta: mismo radio y borde que los campos. */
.login-card .cf-turnstile {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Foco de teclado visible en campos (el resto ya tiene su propio foco). */
.login-card input:focus-visible {
  outline: 2px solid rgba(245, 183, 0, 0.9);
  outline-offset: 2px;
}
