/* ==========================================================================
   LOGIN — estilos propios (reemplazo de Bootstrap + AdminLTE)
   bioService
   ========================================================================== */

:root {
  --bio:        #ff5d00;
  --bio-dark:   #d94f00;
  --azul:       #0064ab;
  --azul-claro: #4157d5;
  --rojo:       #e23636;
  --verde:      #26b726;
  --gris:       #888d88;
  --texto:      #34404a;
  --texto-soft: #6b7884;
  --borde:      #d7dde3;
  --bg-card:    rgba(255, 255, 255, 0.92);
  --sombra:     0 18px 45px rgba(0, 0, 0, 0.18);
  --radio:      14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Source Sans Pro', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
  background: linear-gradient(135deg, #0a3d62 0%, #0064ab 45%, #ff5d00 130%);
  background-attachment: fixed;
}

/* ---------- Encabezado / logo ---------- */
.login-title {
  width: 100%;
  text-align: center;
  color: #fff;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: .5px;
  margin: 10px 0 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.login-logo {
  text-align: center;
  margin-bottom: 18px;
}
.login-logo img {
  height: 96px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .3));
  animation: girar 9s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Tarjeta ---------- */
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 26px 24px 22px;
}

.login-card h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bio);
  text-align: center;
}

/* ---------- Campos con ícono ---------- */
.field { margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--texto-soft);
  margin-bottom: 5px;
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--borde);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-group:focus-within {
  border-color: var(--bio);
  box-shadow: 0 0 0 3px rgba(255, 93, 0, .15);
}
.input-group.error {
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px rgba(226, 54, 54, .15);
}

.input-addon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  color: var(--texto-soft);
  background: #f3f6f9;
  border-right: 1px solid var(--borde);
  font-size: 1rem;
}

.input-group input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  padding: 11px 12px;
  font-size: .95rem;
  color: var(--texto);
  background: transparent;
  min-width: 0;
}
.input-group input::placeholder { color: #aab4bd; }

.btn-eye {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f6f9;
  border-left: 1px solid var(--borde);
  color: var(--texto-soft);
  cursor: pointer;
  user-select: none;
}
.btn-eye:hover { color: var(--bio); }

/* ---------- Captcha ---------- */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
#captchaCanvas {
  width: 150px;
  height: 50px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #eef2f6;
  user-select: none;
}
.captcha-refresh {
  color: var(--azul);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform .3s;
}
.captcha-refresh:hover { transform: rotate(-90deg); color: var(--bio); }

.captcha-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: 9px;
  text-transform: uppercase;
  outline: 0;
  font-size: .95rem;
  letter-spacing: 2px;
}
.captcha-input:focus {
  border-color: var(--bio);
  box-shadow: 0 0 0 3px rgba(255, 93, 0, .15);
}

.captcha-msg {
  display: none;
  align-items: center;
  gap: 5px;
  color: var(--rojo);
  font-size: .8rem;
  margin: 4px 0 0;
}
.captcha-ok {
  display: none;
  align-items: center;
  gap: 5px;
  color: var(--verde);
  font-size: .8rem;
  margin: 4px 0 0;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  padding: 11px 18px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background .15s, opacity .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-bio    { background: var(--bio);   color: #fff; width: 100%; }
.btn-bio:not([disabled]):hover { background: var(--bio-dark); }
.btn-azul   { background: var(--azul);  color: #fff; }
.btn-verde  { background: var(--verde); color: #fff; }
.btn-gris   { background: #e7ecf0;      color: var(--texto); }

.link-forgot {
  display: block;
  text-align: right;
  margin-top: 14px;
}
.link-forgot span {
  font-size: .8rem;
  font-weight: 600;
  color: var(--azul);
  cursor: pointer;
}
.link-forgot span:hover { color: var(--bio); text-decoration: underline; }

/* ---------- Mensajes flash (setmensaje del servidor) ---------- */
.alert {
  position: relative;
  max-width: 380px;
  margin: 0 auto 14px;
  padding: 12px 38px 12px 14px;
  border-radius: 9px;
  font-size: .9rem;
  box-shadow: var(--sombra);
}
.alert-danger  { background: #fdecea; color: #b3261e; border: 1px solid #f5c2c0; }
.alert-success { background: #e9f7ec; color: #1e7a32; border: 1px solid #bfe6c8; }
.alert-warning { background: #fff4e0; color: #946200; border: 1px solid #f3dca7; }
.alert .close {
  position: absolute;
  top: 8px; right: 10px;
  background: none; border: 0;
  font-size: 1rem; cursor: pointer;
  color: inherit; opacity: .7;
}
.alert .close:hover { opacity: 1; }
/* clases de grilla heredadas de los mensajes — neutralizadas */
.col-12, .col-lg-5, .col-md-8, .col-sm-10, .col-xs-10, .mx-auto { }

/* ---------- Modales propios ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, .55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.show { display: flex; }

.modal-box {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
  animation: modalIn .18s ease-out;
}
@keyframes modalIn {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--azul);
  color: #fff;
}
.modal-header h5 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.modal-close { cursor: pointer; font-size: 1.1rem; opacity: .85; }
.modal-close:hover { opacity: 1; }

.modal-body  { padding: 20px 18px; }
.modal-body .field { margin-bottom: 14px; }
.modal-body input {
  width: 100%;
  border: 1px solid var(--borde);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: .95rem;
  outline: 0;
}
.modal-body input:focus { border-color: var(--bio); box-shadow: 0 0 0 3px rgba(255,93,0,.15); }
.modal-icon { text-align: center; color: var(--bio); font-size: 3rem; margin-bottom: 12px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--borde);
}

/* ---------- Modal de error ---------- */
.modal-error .modal-box { max-width: 420px; }
.modal-error-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  background: #f0717d;
  color: #fff;
}
.modal-error-content i.icono { font-size: 3rem; color: #fff; }
.modal-error-content .titulo { font-weight: 700; }

/* ---------- Loader ---------- */
.loader-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(2px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.loader-overlay.show { display: flex; }
.loader-overlay .marca {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--bio);
  margin-bottom: 10px;
}
.lds-ellipsis { position: relative; width: 80px; height: 24px; }
.lds-ellipsis div {
  position: absolute;
  top: 6px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bio);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) { left: 8px;  animation: lds1 .6s infinite; }
.lds-ellipsis div:nth-child(2) { left: 8px;  animation: lds2 .6s infinite; }
.lds-ellipsis div:nth-child(3) { left: 32px; animation: lds2 .6s infinite; }
.lds-ellipsis div:nth-child(4) { left: 56px; animation: lds3 .6s infinite; }
@keyframes lds1 { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes lds3 { 0% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes lds2 { 0% { transform: translate(0,0); } 100% { transform: translate(24px,0); } }

/* ---------- Íconos SVG inline ---------- */
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.captcha-refresh .icon { width: 22px; height: 22px; }
.captcha-msg .icon, .captcha-ok .icon { width: 14px; height: 14px; flex: 0 0 auto; }
.modal-error-content .icono { width: 44px; height: 44px; flex: 0 0 auto; }

/* ---------- Honeypot (señuelo anti-bot) ----------
   display:none → los gestores de contraseñas NO rellenan estos campos,
   pero los bots que llenan todos los inputs sí caen en la trampa. */
.hp-wrap { display: none; }

.hidden { display: none !important; }

@media (max-width: 420px) {
  .login-title { font-size: 1.55rem; }
  .login-logo img { height: 78px; }
}
