/* ========================================
   MODERN LOGIN DESIGN FOR BACKOFFICE
   ======================================== */

/* Importar las variables de color del frontend */
:root {
  --color-primario-oscuro: #003b56;
  --color-primario: #007695;
  --color-primario-claro: #00b3c7;
  --color-primario-masclaro: #8ae4eb;
  --color-destacado: #8bc864;
  --color-destacado-claro: #b3e0de;
  --color-neutro: #e9f0f2;
  --color-neutro-oscuro: #364144;
  --color-neutro-claro: #d5dddf;
  --color-blanco: #ffffff;
  --color-negro: #000000;
  --color-error: #d84646;
  --color-warning: #ebad29;
  --font: "Roboto", sans-serif;
}

/* Fondo de la página */
.login-page {
  background: linear-gradient(135deg, var(--color-primario-oscuro) 0%, var(--color-primario) 50%, var(--color-primario-claro) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  position: relative;
  overflow: hidden;
}

/* Animación de fondo */
.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
  0%, 100% { transform: translateX(0) translateY(0); }
  33% { transform: translateX(-10px) translateY(10px); }
  66% { transform: translateX(10px) translateY(-10px); }
}

/* Contenedor principal del login */
.login-box {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 500px; /* Aumentado de 400px a 500px */
  margin: 0 auto;
}

/* Ajustar el grid para desktop */
@media (min-width: 992px) {
  .login-box {
    max-width: 550px; /* Aún más ancho en pantallas grandes */
  }
  
  /* Mejor distribución en desktop */
  .row.align-items-center .col-sm-8 {
    flex: 0 0 65%;
    max-width: 65%;
  }
  
  .row.align-items-center .col-sm-4 {
    flex: 0 0 35%;
    max-width: 35%;
  }
}

@media (min-width: 1200px) {
  .login-box {
    max-width: 600px; /* Máximo ancho en pantallas muy grandes */
  }
}

/* Logo modernizado */
.login-logo {
  text-align: center;
  margin-bottom: 30px;
  animation: fadeInDown 0.8s ease-out;
}

.login-logo img {
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.login-logo img:hover {
  transform: scale(1.05);
}

/* Tarjeta de login moderna */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.card-body {
  padding: 40px;
}

/* Más padding en desktop */
@media (min-width: 768px) {
  .card-body {
    padding: 50px;
  }
}

@media (min-width: 1200px) {
  .card-body {
    padding: 60px;
  }
}

/* Grupos de entrada modernos */
.input-group {
  position: relative;
  margin-bottom: 25px;
}

.form-control {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(0, 118, 149, 0.1);
  border-radius: 12px;
  padding: 15px 20px 15px 50px;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-primario-oscuro);
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  width: 100%;
}

/* Inputs más grandes en desktop */
@media (min-width: 768px) {
  .form-control {
    padding: 18px 25px 18px 55px;
    font-size: 17px;
  }
  
  .input-group {
    margin-bottom: 30px;
  }
}

.form-control:focus {
  background: white;
  border-color: var(--color-primario);
  box-shadow: 0 0 0 4px rgba(0, 118, 149, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
  outline: none;
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: rgba(54, 65, 68, 0.6);
  font-weight: 400;
}

/* Iconos en los inputs */
.input-group-append {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-group-text {
  background: none;
  border: none;
  padding: 0;
  width: auto;
}

.input-group-text .fas {
  color: var(--color-primario);
  font-size: 18px;
  transition: all 0.3s ease;
}

.form-control:focus + .input-group-append .input-group-text .fas {
  color: var(--color-primario-oscuro);
  transform: scale(1.1);
}

/* Iconos más grandes en desktop */
@media (min-width: 768px) {
  .input-group-append {
    left: 20px;
  }
  
  .input-group-text .fas {
    font-size: 20px;
  }
}

/* Botón principal moderno */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-primario-claro) 100%);
  border: none;
  border-radius: 12px;
  padding: 15px 30px;
  font-weight: 600;
  font-size: 16px;
  color: white;
  box-shadow: 0 8px 20px rgba(0, 118, 149, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(0, 118, 149, 0.4);
  background: linear-gradient(135deg, var(--color-primario-oscuro) 0%, var(--color-primario) 100%);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 118, 149, 0.3);
}

.btn-primary:focus {
  box-shadow: 0 0 0 4px rgba(0, 118, 149, 0.2);
}

/* Arreglar el layout de la fila de acceso */
.row.align-items-center {
  display: flex;
  align-items: center;
  gap: 20px; /* Aumentado de 15px a 20px */
  margin-bottom: 20px;
}

.row.align-items-center .col-sm-8 {
  flex: 1;
  max-width: none;
}

.row.align-items-center .col-sm-4 {
  flex: 0 0 auto;
  min-width: 140px; /* Aumentado de 120px para mejor proporción */
}

/* Mejor distribución en tablets y desktop */
@media (min-width: 768px) {
  .row.align-items-center {
    gap: 25px;
  }
  
  .row.align-items-center .col-sm-4 {
    min-width: 160px;
  }
}

/* Checkbox moderno */
.icheck-primary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icheck-primary input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-primario);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.icheck-primary input[type="checkbox"]:checked {
  background: var(--color-primario);
  border-color: var(--color-primario);
}

.icheck-primary input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.icheck-primary label {
  color: var(--color-primario-oscuro);
  font-weight: 500;
  cursor: pointer;
  margin: 0;
}

/* Mensajes de error modernos */
.text-danger {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border: 1px solid var(--color-error);
  border-radius: 8px;
  color: var(--color-error);
  font-weight: 500;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Enlaces modernos */
.text-info a {
  color: var(--color-primario);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.text-info a:hover {
  color: var(--color-primario-oscuro);
  text-decoration: none;
}

.text-info a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primario);
  transition: width 0.3s ease;
}

.text-info a:hover::after {
  width: 100%;
}

/* Animaciones de entrada */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsivo */
@media (max-width: 768px) {
  .card-body {
    padding: 30px 20px;
  }
  
  .login-logo img {
    max-width: 150px;
  }
  
  .form-control {
    padding: 12px 15px 12px 45px;
    font-size: 14px;
  }
  
  .btn-primary {
    padding: 12px 25px;
    font-size: 14px;
  }
}

/* Footer del login */
.main-footer {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 20px;
}

/* Ocultar elementos innecesarios */
.content-header {
  padding: 0;
  margin: 0;
}

.content-wrapper {
  background: transparent;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container-fluid {
  width: 100%;
  max-width: none;
  padding: 20px;
}

/* Título modernos */
h4 {
  font-family: var(--font);
  margin-bottom: 1rem;
}

/* Efectos adicionales para los inputs */
.input-group {
  position: relative;
}

.input-group-append {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Ajustes responsivos mejorados */
@media (max-width: 576px) {
  .login-box {
    padding: 0 15px;
  }
  
  .card-body {
    padding: 25px 20px;
  }
  
  .row.align-items-center {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .row.align-items-center .col-7,
  .row.align-items-center .col-5 {
    width: 100%;
    max-width: 100%;
    flex: none;
  }
  
  .btn-primary {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .form-control {
    padding: 12px 15px 12px 45px;
    font-size: 14px;
  }
}

/* Mejoras adicionales */
.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Arreglar el checkbox */
.icheck-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.icheck-primary input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.icheck-primary label {
  margin: 0;
  line-height: 1.4;
  font-size: 14px;
}

/* Mejorar el espaciado */
.mb-3 {
  margin-bottom: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

/* Centrar contenido */
.text-center {
  text-align: center !important;
}
