/* ========== Página de inicio de sesión (index.php) ========== */

body {
  background-image: url("../imagenes/finanzas_opt.jpg");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Velado suave: la imagen se nota más, sin tapar tanto */
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.38) 0%,
    rgba(30, 58, 138, 0.22) 42%,
    rgba(15, 23, 42, 0.36) 100%
  );
}

body.with-banner::before {
  top: 40px;
}

/* Fondo detrás del modal */
#modal_login.modal {
  z-index: 1055;
}

.modal-backdrop.show {
  opacity: 0.35;
}

#modal_login .modal-dialog.form-m {
  max-width: min(520px, calc(100vw - 1.5rem));
  margin-left: auto;
  margin-right: auto;
}

#modal_login.modal .modal-dialog {
  border-radius: 0;
  box-shadow: none !important;
}

#modal_login .modal-content {
  border: none;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  /* Sin anillo inset claro: en las esquinas se veía “blanco” sobre el pie oscuro */
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.06),
    0 24px 48px -12px rgba(0, 0, 0, 0.35);
  isolation: isolate;
}

#modal_login.show .modal-content {
  animation: login-modal-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes login-modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#modal_login .modal-header.titulos-form {
  padding: 1.15rem 1.35rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: linear-gradient(125deg, #0f172a 0%, #1e3a8a 52%, #2563eb 100%);
  color: #f8fafc;
}

#modal_login .modal-header .row {
  width: 100%;
  align-items: center;
}

#modal_login .modal-title {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

#modal_login .modal-body {
  padding: 1.35rem 1.35rem 0.75rem;
  background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 35%);
}

#modal_login .modal-body > .col-md-12,
#modal_login .modal-body > .col-md-6 {
  margin-bottom: 0.9rem;
}

#modal_login .modal-body > .col-md-12:last-child,
#modal_login .modal-body > .col-md-6:last-child {
  margin-bottom: 0;
}

#modal_login #div_logo {
  margin-bottom: 0.25rem;
  border: 0 !important;
}

#modal_login #div_logo #logo {
  max-width: 240px;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

#modal_login #div_nombre_distribuidor,
#modal_login #fecha_vence {
  color: #475569;
  font-size: 0.8125rem;
}

#modal_login .login-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

#modal_login .login-label--inline {
  display: inline;
  margin-right: 0.15rem;
  margin-bottom: 0;
  font-size: 0.8125rem;
  text-transform: none;
  letter-spacing: 0;
  color: #334155;
}

#modal_login .login-label--inline ~ label {
  margin-left: 0.15rem;
  font-weight: 500;
}

#modal_login input[name="pin_serial"] {
  accent-color: #2563eb;
  width: 1rem;
  height: 1rem;
  vertical-align: text-bottom;
}

#modal_login .input-group-text {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 12px 0 0 12px;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

#modal_login .input-group .form-control {
  border-radius: 0 12px 12px 0;
  border-left: 0;
}

#modal_login .input-group:focus-within .input-group-text {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

#modal_login .input-group:focus-within .form-control {
  border-color: #93c5fd;
  box-shadow: none;
}

#modal_login .form-control,
#modal_login .form-select {
  height: 44px;
  font-size: 0.9375rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#modal_login .form-control:focus,
#modal_login .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

#modal_login .form-select {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

#modal_login #url_eshop_business {
  margin-top: 0.15rem;
  padding: 1rem 1rem 1.05rem;
  text-align: center;
  background: linear-gradient(165deg, #ecfdf5 0%, #f0fdf4 38%, #ffffff 100%);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 14px;
  border-left: 4px solid #10b981;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 16px -4px rgba(16, 185, 129, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.85) inset;
}

#modal_login #url_eshop_business b {
  display: inline-block;
  margin-bottom: 0.45rem;
}

#modal_login #url_eshop_business b u {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none !important;
  color: #047857;
  padding: 0.28rem 0.75rem;
  background: rgba(16, 185, 129, 0.18);
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

#modal_login #url_eshop_business a {
  display: block;
  margin-top: 0.15rem;
  color: #0d9488;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.45;
  word-break: break-word;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(13, 148, 136, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#modal_login #url_eshop_business a:hover {
  color: #0f766e;
  background: #fff;
  border-color: rgba(13, 148, 136, 0.55);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#modal_login .modal-footer.footer-form {
  margin-top: 0;
  padding: 1rem 1.35rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  width: 100%;
  background: #fff;
}

#modal_login .modal-footer .btn-success {
  width: 100%;
  max-width: 280px;
  padding: 0.75rem 1.25rem !important;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#modal_login .modal-footer .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.42);
}

#modal_login .modal-footer .btn-success:active {
  transform: translateY(0);
}

#modal_login #div_legal_notice {
  margin: 0;
  border-radius: 0 0 20px 20px;
  overflow: hidden;
  /* Capa propia evita filtrado del fondo claro del .modal-content en subpíxeles del radio */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%), #0f172a !important;
  color: rgba(248, 250, 252, 0.88) !important;
  font-size: 0.6875rem !important;
  line-height: 1.5 !important;
  padding: 0.9rem 1rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#modal_login #div_legal_notice b {
  font-weight: 600;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  #modal_login.show .modal-content {
    animation-duration: 0.01ms !important;
  }

  #modal_login .modal-footer .btn-success {
    transition: none;
  }

  #modal_login .modal-footer .btn-success:hover {
    transform: none;
  }
}
