/* ============================================
   LOGIN — LAYOUT SPLIT-SCREEN
   ============================================ */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2d3a4a;
  /* La imagen ahora cubre TODO el viewport (no solo el panel hero), así la card
     glassmorphism del form la deja ver detrás con su blur. */
  background-image: url('../images/login-background-2.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reset del wrapper que viene de base_basic */
#app.form-container {
  display: block;
  width: 100%;
  min-height: 100vh;
  height: auto;
  margin: 0;
  padding: 0;
  text-align: left;
}

/* Layout principal: dos columnas en desktop, apilado en mobile */
.login-page {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ============================================
   PANEL HERO (izquierda)
   ============================================ */
.login-hero {
  flex: 1 1 60%;
  position: relative;
  /* La imagen ahora la pone el body en todo el viewport. Aquí solo armamos el
     contenido encima. */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
  color: #fff;
  overflow: hidden;
}

/* Overlay sutil para mejorar contraste del texto blanco del hero */
.login-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 42, 96, 0.25) 0%, rgba(6, 42, 96, 0) 100%);
  z-index: 1;
}

.login-hero-content {
  position: relative;
  z-index: 2;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.login-hero-logo {
  max-width: 240px;
  height: auto;
  margin: 0 auto 32px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.login-hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.login-hero-tagline {
  font-size: 16px;
  font-weight: 400;
  opacity: 0.92;
  margin: 0 0 36px 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  line-height: 1.5;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-features li {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: all 0.25s ease;
}

.login-features li:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

.login-features i {
  font-size: 20px;
  flex-shrink: 0;
  width: 24px;
}

/* ============================================
   PANEL DEL FORMULARIO (derecha)
   ============================================ */
.login-form-panel {
  flex: 0 0 700px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 30px 40px 60px;
  position: relative;
  z-index: 3;
}

/* Card glassmorphism: flota sobre la imagen del fondo, con blur y borde sutil */
.login-form-wrap {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 56px 48px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 8px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-form {
  width: 100%;
}

.login-form-wrap-register {
  max-width: 540px;
  padding: 34px 36px 26px;
}

/* Avatar circular sobre el form (icono de usuario o llave en recuperación) */
.login-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.login-avatar i {
  font-size: 44px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1;
}

.login-form h2 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.login-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 32px 0;
  text-align: center;
}

.login-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 8px;
}

/* Wrapper para inputs con icono interior */
.login-input-icon {
  position: relative;
  margin-bottom: 18px;
}

.login-input-icon i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 16px;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.login-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
}

.login-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
}

.login-select option {
  color: #1f2a36;
}

.login-select-icon::after {
  content: "\F282";
  font-family: "bootstrap-icons";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  pointer-events: none;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.login-input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.login-input:focus + i,
.login-input-icon:focus-within i {
  color: rgba(255, 255, 255, 0.9);
}

/* Autofill del navegador: forzar mismos colores que el input glassmorphism */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(6, 42, 96, 0.85) inset;
  caret-color: #fff;
  transition: background-color 5000s ease-in-out 0s;
}

.login-btn-primary {
  width: 100%;
  padding: 13px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #062a60 0%, #0290e4 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(6, 42, 96, 0.3);
}

.login-btn-primary i {
  font-size: 17px;
}

.login-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 42, 96, 0.4);
  background: linear-gradient(135deg, #062a60 0%, #137cbe 100%);
}

.login-btn-primary:active {
  transform: translateY(0);
}

.login-form-links {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  gap: 8px;
  flex-wrap: wrap;
}

.login-form-links a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-form-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.login-form-links-center {
  justify-content: center;
}

.login-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.login-field {
  min-width: 0;
}

.login-field-full {
  grid-column: 1 / -1;
}

/* Variante registro: panel del form más ancho para acomodar el grid de 2 columnas */
.login-page-register .login-form-panel {
  flex: 0 0 820px;
}

.login-form-wrap-register {
  max-width: 640px;
}

/* ============================================
   SELECT — combinar con los inputs glass
   ============================================ */
select.login-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='rgba(255,255,255,0.75)'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 40px;
  cursor: pointer;
}

/* Las options nativas no heredan el fondo glass; mantenerlas legibles sobre blanco */
select.login-input option {
  color: #2d3a4a;
  background: #fff;
}

.login-page-register .login-hero {
  padding: 40px 42px;
}

.login-page-register .login-hero-content {
  max-width: 480px;
}

.login-page-register .login-hero-logo {
  max-width: 200px;
  margin-bottom: 20px;
}

.login-page-register .login-hero h1 {
  font-size: 34px;
  margin-bottom: 8px;
}

.login-page-register .login-hero-tagline {
  font-size: 14px;
  margin-bottom: 22px;
}

.login-page-register .login-features {
  gap: 8px;
}

.login-page-register .login-features li {
  padding: 11px 16px;
  font-size: 13px;
}

.login-page-register .login-avatar {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.login-page-register .login-avatar i {
  font-size: 32px;
}

.login-page-register .login-form h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

.login-page-register .login-subtitle {
  font-size: 13px;
  margin-bottom: 20px;
}

.login-page-register .login-label {
  font-size: 12px;
  margin-bottom: 6px;
}

.login-page-register .login-input-icon {
  margin-bottom: 12px;
}

.login-page-register .login-input {
  padding: 11px 14px 11px 42px;
  font-size: 13px;
}

.login-page-register .login-btn-primary {
  padding: 11px;
  margin-top: 4px;
}

.login-page-register .login-form-links {
  margin-top: 14px;
}

.login-page-register .login-footer {
  margin-top: 18px;
}

.login-footer {
  margin-top: 32px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 1.5;
}

/* ============================================
   RESPONSIVE — TABLET / MOBILE
   ============================================ */
@media (max-width: 991px) {
  .login-page {
    flex-direction: column;
    min-height: 100vh;
  }
  .login-hero {
    flex: 0 0 auto;
    min-height: 280px;
    padding: 40px 24px;
  }
  .login-hero h1 {
    font-size: 32px;
  }
  .login-hero-logo {
    max-width: 180px;
    margin-bottom: 20px;
  }
  .login-hero-tagline {
    font-size: 15px;
    margin-bottom: 24px;
  }
  .login-features {
    display: none; /* Lista oculta en mobile para ahorrar espacio. */
  }
  .login-form-panel {
    flex: 1 1 auto;
    padding: 36px 24px;
  }
  .login-page-register .login-form-panel {
    flex: 1 1 auto;
  }
  .login-form-wrap-register {
    max-width: 100%;
    padding: 40px 32px 28px;
  }
  .login-page-register .login-hero {
    padding: 36px 24px;
  }
  .login-form-grid {
    grid-template-columns: 1fr;
  }
  .login-field-full {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .login-hero {
    min-height: 220px;
    padding: 30px 20px;
  }
  .login-hero h1 {
    font-size: 26px;
  }
  .login-hero-logo {
    max-width: 150px;
    margin-bottom: 16px;
  }
  .login-hero-tagline {
    font-size: 14px;
  }
  .login-form-wrap {
    max-width: 100%;
    padding: 40px 24px;
  }
  .login-form-links {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .login-form-grid {
    grid-template-columns: 1fr;
  }
  .login-field-full {
    grid-column: auto;
  }
  .login-form-links-center {
    align-items: center;
  }
  .login-form-wrap-register {
    padding: 32px 20px 24px;
  }
}
