/* ============================================
   LOGIN PAGE - NUEVO DISEÑO CAFÉ/CHOCOLATE
   Tema cálido y elegante con tonos marrones
   ============================================ */

:root {
  /* Paleta de colores café/chocolate */
  --cafe-primary: #8B5A2B;
  /* Café principal */
  --cafe-light: #C4A77D;
  /* Café claro */
  --cafe-lighter: #D4BE9C;
  /* Café muy claro */
  --cafe-dark: #6B4423;
  /* Café oscuro */
  --cafe-darker: #4A2F18;
  /* Café muy oscuro */
  --cafe-accent: #A0674B;
  /* Acento cálido */
  --cafe-cream: #FDF8F3;
  /* Crema suave */
  --cafe-warm: #E8D5C4;
  /* Tono cálido */

  /* Fondos y texto */
  --card-bg: rgba(253, 248, 243, 0.97);
  --card-border: rgba(139, 90, 43, 0.15);
  --text-dark: #3D2914;
  --text-muted: #7A6554;
  --shadow-color: rgba(74, 47, 24, 0.25);
  --glow-color: rgba(196, 167, 125, 0.5);
}

/* Reset y altura completa */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* ==========================================
   FONDO DE PÁGINA CON OVERLAY SUTIL
   ========================================== */
body.login-page {
  background-color: #3D2914 !important;
  /* Fallback color café oscuro */
  background-image:
    linear-gradient(135deg,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0.25) 50%,
      rgba(0, 0, 0, 0.35) 100%),
    url('../images/back2.png') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  min-height: 100vh !important;
  height: 100% !important;
  overflow-x: hidden;
  font-family: 'Segoe UI', 'Roboto', -apple-system, sans-serif;
}

/* ==========================================
   CONTENEDOR PRINCIPAL CENTRADO
   ========================================== */
body.login-page .main-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Eliminar espaciados heredados */
body.login-page .mt-40,
body.login-page .mt-30 {
  margin-top: 0 !important;
}

body.login-page .pt-50 {
  padding-top: 0 !important;
}

body.login-page .panel-heading .text-center br {
  display: none;
}

/* Neutralizar offsets de Bootstrap */
body.login-page .col-md-offset-7.col-lg-5,
body.login-page .col-md-offset-2.col-md-10 {
  float: none;
  margin: 0 auto;
}

body.login-page .col-md-offset-7 {
  margin-left: 0 !important;
}

body.login-page .col-md-offset-2 {
  margin-left: 0 !important;
}

body.login-page .col-lg-5,
body.login-page .col-md-10,
body.login-page .col-md-11,
body.login-page .col-md-12 {
  width: 100% !important;
  float: none !important;
}

/* ==========================================
   TARJETA DE LOGIN - DISEÑO PREMIUM
   ========================================== */
.panel.login-box {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border);
  border-radius: 0;
  box-shadow:
    0 25px 60px rgba(74, 47, 24, 0.25),
    0 10px 30px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Línea decorativa superior con gradiente café */
.panel.login-box::before {
  content: "";
  display: block;
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg,
      var(--cafe-dark),
      var(--cafe-primary),
      var(--cafe-light),
      var(--cafe-primary),
      var(--cafe-dark));
  background-size: 200% 100%;
  animation: shimmer 3s ease infinite;
}

@keyframes shimmer {

  0%,
  100% {
    background-position: 200% 0;
  }

  50% {
    background-position: 0% 0;
  }
}

/* ==========================================
   ENCABEZADO DEL PANEL
   ========================================== */
.panel.login-box .panel-heading {
  background: linear-gradient(180deg,
      rgba(196, 167, 125, 0.15) 0%,
      transparent 100%);
  border-bottom: 1px solid rgba(139, 90, 43, 0.1);
  text-align: center;
  padding: 25px 20px 15px;
}

/* Logo con animación sutil */
.login-logo {
  height: 120px;
  filter: drop-shadow(0 4px 12px rgba(74, 47, 24, 0.3));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.login-logo:hover {
  transform: scale(1.05);
}

/* Título de sesión */
.panel.login-box h5 {
  color: var(--text-dark);
  letter-spacing: 1.5px;
  margin-top: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
}

/* Línea decorativa bajo el título */
.panel.login-box h5::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--cafe-primary), var(--cafe-light));
  margin: 10px auto 0;
  border-radius: 0;
}

/* ==========================================
   CUERPO DEL FORMULARIO
   ========================================== */
.panel.login-box .panel-body {
  padding: 30px 35px 35px;
}

@media (max-width: 480px) {
  .panel.login-box .panel-body {
    padding: 25px 20px 30px;
  }
}

/* ==========================================
   GRUPOS DE FORMULARIO
   ========================================== */
.admin-login .form-group {
  margin-bottom: 22px;
  position: relative;
}

.admin-login .form-group.mt-20 {
  margin-top: 25px;
}

/* Labels con estilo café */
.admin-login .form-group label {
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Iconos de los labels */
.admin-login .form-group label .fa {
  color: var(--cafe-primary);
  margin-right: 8px;
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.admin-login .form-group:focus-within label .fa {
  transform: scale(1.15);
  color: var(--cafe-dark);
}

/* ==========================================
   CAMPOS DE ENTRADA - DISEÑO ELEGANTE
   ========================================== */
.admin-login .form-control {
  background-color: #ffffff;
  border: 2px solid rgba(139, 90, 43, 0.2);
  color: var(--text-dark);
  height: 52px;
  border-radius: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  width: 100%;
  padding: 12px 20px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 2px 8px rgba(74, 47, 24, 0.06),
    inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.admin-login .form-control:hover {
  border-color: rgba(139, 90, 43, 0.35);
  box-shadow: 0 4px 12px rgba(74, 47, 24, 0.1);
}

.admin-login .form-control:focus {
  background-color: #ffffff;
  outline: none;
  border-color: var(--cafe-primary);
  box-shadow:
    0 0 0 4px rgba(139, 90, 43, 0.15),
    0 4px 16px rgba(74, 47, 24, 0.12);
}

.admin-login .form-control::placeholder {
  color: var(--text-muted);
  text-align: center;
  font-weight: 400;
  opacity: 0.8;
}

/* ==========================================
   CONTENEDOR DE CONTRASEÑA CON ICONO
   ========================================== */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper .form-control {
  padding-right: 50px;
}

.toggle-password {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cafe-primary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  opacity: 0.7;
  user-select: none;
}

.toggle-password:hover {
  opacity: 1;
  color: var(--cafe-dark);
  transform: translateY(-50%) scale(1.15);
}

.toggle-password:active {
  transform: translateY(-50%) scale(0.95);
}

/* ==========================================
   BOTÓN DE INGRESO - DISEÑO PREMIUM
   ========================================== */
.btn.login-btn {
  display: block;
  width: 100%;
  height: 54px;
  border-radius: 0;
  border: none;
  background: linear-gradient(135deg,
      var(--cafe-primary) 0%,
      var(--cafe-light) 50%,
      var(--cafe-primary) 100%);
  background-size: 200% 200%;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: 15px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 8px 25px rgba(139, 90, 43, 0.35),
    0 4px 12px rgba(74, 47, 24, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: gradientMove 4s ease infinite;
}

@keyframes gradientMove {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* Efecto de brillo en hover */
.btn.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.25),
      transparent);
  transition: left 0.5s ease;
}

.btn.login-btn:hover::before {
  left: 100%;
}

.btn.login-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 35px rgba(139, 90, 43, 0.4),
    0 6px 16px rgba(74, 47, 24, 0.25);
}

.btn.login-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 4px 15px rgba(139, 90, 43, 0.3),
    0 2px 8px rgba(74, 47, 24, 0.15);
}

/* Efecto ripple al hacer clic */
.btn.login-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn.login-btn:active::after {
  width: 300px;
  height: 300px;
}

/* ==========================================
   ENLACE DE RESTABLECER CLAVE
   ========================================== */
.admin-login .text-center {
  text-align: center !important;
  display: block;
  width: 100%;
  margin-top: 15px;
}

.reset-link {
  color: var(--cafe-primary);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
  padding: 5px 0;
  display: inline-block;
}

.reset-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cafe-primary), var(--cafe-light));
  transition: width 0.3s ease, left 0.3s ease;
  border-radius: 1px;
}

.reset-link:hover {
  color: var(--cafe-dark);
  text-decoration: none;
}

.reset-link:hover::after {
  width: 100%;
  left: 0;
}

/* ==========================================
   MODAL DE RESTABLECER CONTRASEÑA
   ========================================== */

/* Transición RÁPIDA para abrir/cerrar - casi instantánea */
body.login-page .modal.fade {
  transition: opacity 0.08s linear !important;
}

body.login-page .modal.fade .modal-dialog {
  transition: transform 0.08s ease-out !important;
  transform: translate(0, 0) !important;
}

body.login-page .modal.fade:not(.in) .modal-dialog {
  transform: translate(0, -30px) !important;
}

body.login-page .modal-backdrop.fade {
  transition: opacity 0.05s linear !important;
}

/* Asegurar que el modal esté centrado en la página de login */
body.login-page .modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

body.login-page .modal.in,
body.login-page .modal.show {
  display: block;
}

body.login-page .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6) !important;
}

body.login-page .modal-dialog {
  margin: 100px auto !important;
  max-width: 480px;
  width: 90%;
}

body.login-page .modal-content {
  background: #ffffff;
  border-radius: 16px;
  border: none;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Header del modal con gradiente café */
body.login-page .modal-header.modal-green {
  background: linear-gradient(135deg,
      var(--cafe-primary) 0%,
      var(--cafe-light) 100%) !important;
  color: #ffffff !important;
  border-radius: 16px 16px 0 0;
  padding: 20px 25px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

/* Botón cerrar (X) - posicionado en esquina superior derecha */
body.login-page .modal-header.modal-green .close {
  position: absolute;
  top: 15px;
  right: 18px;
  color: #ffffff !important;
  opacity: 1;
  text-shadow: none;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

body.login-page .modal-header.modal-green .close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Título del modal centrado */
body.login-page .modal-header.modal-green .modal-title {
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 20px;
  text-align: center;
  margin: 0;
  flex: 1;
}

/* Cuerpo del modal */
body.login-page .modal-body {
  padding: 35px 40px;
  background: #ffffff;
}

body.login-page .modal-body .form-group {
  margin-bottom: 0;
}

body.login-page .modal-body label {
  color: var(--text-dark);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Icono del label */
body.login-page .modal-body label .fa {
  color: var(--cafe-primary);
  margin-right: 10px;
  font-size: 16px;
  transition: transform 0.3s ease;
}

body.login-page .modal-body .form-group:focus-within label .fa {
  transform: scale(1.15);
  color: var(--cafe-dark);
}

/* Campo de email más grande con espaciado correcto */
body.login-page .modal-body .form-control {
  border: 2px solid rgba(139, 90, 43, 0.25);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 16px;
  height: auto;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background: #fafafa;
  text-align: center;
}

body.login-page .modal-body .form-control:focus {
  border-color: var(--cafe-primary);
  box-shadow: 0 0 0 4px rgba(139, 90, 43, 0.12);
  outline: none;
  background: #ffffff;
}

body.login-page .modal-body .form-control::placeholder {
  color: #999;
  font-size: 15px;
  text-align: center;
}

/* Pie del modal */
body.login-page .modal-footer {
  border-top: 1px solid rgba(139, 90, 43, 0.12);
  padding: 20px 40px;
  background: #f8f6f4;
  display: flex;
  justify-content: center;
  gap: 15px;
}

body.login-page .modal-footer .btn-default {
  border: 2px solid rgba(139, 90, 43, 0.35);
  color: var(--cafe-primary);
  background: transparent;
  border-radius: 10px;
  padding: 12px 28px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s ease;
}

body.login-page .modal-footer .btn-default:hover {
  background: rgba(139, 90, 43, 0.08);
  border-color: var(--cafe-primary);
}

body.login-page .modal-footer .btn-success {
  background: linear-gradient(135deg, var(--cafe-primary), var(--cafe-light));
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(139, 90, 43, 0.35);
  transition: all 0.3s ease;
}

body.login-page .modal-footer .btn-success:hover {
  background: linear-gradient(135deg, var(--cafe-dark), var(--cafe-primary));
  box-shadow: 0 8px 25px rgba(139, 90, 43, 0.45);
  transform: translateY(-2px);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* CORRECCIÓN CENTRADO EN MÓVIL/TABLET (max-width: 768px) */
@media (max-width: 768px) {

  /* Asegurar que el contenedor principal esté centrado */
  body.login-page .main-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 15px !important;
    min-height: 100vh !important;
  }

  /* Contenedores row deben permitir el centrado */
  body.login-page .row {
    width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
  }

  /* Columnas deben estar centradas */
  body.login-page .col-md-offset-7,
  body.login-page .col-lg-5,
  body.login-page .col-md-offset-2,
  body.login-page .col-md-10,
  body.login-page .col-md-11,
  body.login-page .col-md-12 {
    width: 100% !important;
    max-width: 520px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Panel login perfectamente centrado */
  .panel.login-box {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
  }
}

/* Ajustes específicos para móviles pequeños */
@media (max-width: 480px) {
  .panel.login-box {
    max-width: 100% !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
  }

  .login-logo {
    height: 100px;
  }

  .panel.login-box h5 {
    font-size: 1.1rem;
  }

  .admin-login .form-control {
    height: 48px;
  }

  .btn.login-btn {
    height: 50px;
    font-size: 14px;
  }
}

/* Evitar desplazamiento hacia abajo en móviles */
@media (max-width: 600px) {
  body.login-page .main-wrapper {
    align-items: center !important;
    padding: 15px !important;
  }

  .panel.login-box {
    margin: 0 auto !important;
  }

  /* Modal responsive en móviles */
  body.login-page .modal-dialog {
    margin: 30px auto !important;
    width: 95%;
    max-width: none;
  }

  body.login-page .modal-header.modal-green {
    padding: 18px 20px;
    min-height: 60px;
  }

  body.login-page .modal-header.modal-green .close {
    width: 36px;
    height: 36px;
    font-size: 28px;
    top: 12px;
    right: 14px;
  }

  body.login-page .modal-header.modal-green .modal-title {
    font-size: 17px;
  }

  body.login-page .modal-body {
    padding: 25px 20px;
  }

  body.login-page .modal-body .form-control {
    padding: 14px 15px;
    font-size: 15px;
  }

  body.login-page .modal-footer {
    padding: 15px 20px;
    flex-wrap: wrap;
  }

  body.login-page .modal-footer .btn-default,
  body.login-page .modal-footer .btn-success {
    padding: 12px 22px;
    font-size: 13px;
  }
}

@media (min-width: 1200px) {
  .panel.login-box {
    max-width: 520px;
  }
}

/* ==========================================
   EFECTOS DECORATIVOS ADICIONALES
   ========================================== */

/* Partículas flotantes de fondo (efecto sutil) */
body.login-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(196, 167, 125, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(139, 90, 43, 0.08) 0%, transparent 40%);
  z-index: -1;
}

/* Focus ring accesible */
.admin-login .form-control:focus-visible {
  outline: 3px solid rgba(139, 90, 43, 0.5);
  outline-offset: 2px;
}

/* Scroll suave para el body */
body.login-page {
  scroll-behavior: smooth;
}