/* ==========================================================================
   Rediseño de las pantallas de login (resources/views/auth/login.blade.php
   y resources/views/pages/auth-login.blade.php, esta ultima es la que se
   sirve realmente en "/"). Todo va scopeado bajo #auth-login-v2 para no
   afectar authentication.css, que tambien usan register.blade.php,
   passwords/email.blade.php, etc.
   ========================================================================== */

#auth-login-v2 {
  --auth-page-bg: #eef1f6;
  --auth-bg: #ffffff;
  --auth-text: #1c2434;
  --auth-text-muted: #6b7280;
  --auth-border: #e5e7eb;
  --auth-input-bg: #f9fafb;
  --auth-accent: #2c6de9;
  --auth-accent-dark: #1c4fb0;

  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: var(--auth-page-bg);
  color: var(--auth-text);
}

#auth-login-v2[data-theme="dark"] {
  --auth-page-bg: #0b0f16;
  --auth-bg: #131a26;
  --auth-text: #edf1f7;
  --auth-text-muted: #97a3b6;
  --auth-border: #263042;
  --auth-input-bg: #1b2333;
}

/* la tarjeta ocupa el 100% de la pantalla (sin margen/tarjeta flotante) */
#auth-login-v2 .auth-card {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: var(--auth-bg);
}

/* ---------- panel izquierdo: hero de marca ---------- */
#auth-login-v2 .auth-hero {
  position: relative;
  flex: 1 1 46%;
  display: flex;
  align-items: flex-end;
  padding: 3rem;
  overflow: hidden;
  background-color: var(--auth-accent-dark);
  background-image: linear-gradient(160deg, var(--auth-accent) 0%, var(--auth-accent-dark) 100%);
  background-size: cover;
  background-position: center;
}

/* variante mas ancha del hero (por ahora solo en pages/auth-login.blade.php,
   via @include('panels.auth-hero-carousel', ['heroClass' => 'auth-hero-wide'])) */
#auth-login-v2 .auth-hero.auth-hero-wide {
  flex: 1 1 60%;
}

#auth-login-v2 .auth-hero.auth-hero-wide ~ .auth-form-panel {
  flex: 1 1 40%;
}

/* variante sin foto (solo pages/auth-login.blade.php): fondo solido con el
   degradado de marca + patron de puntos + un blob decorativo, en vez del
   carrusel de fotos compartido con las otras pantallas de login */
#auth-login-v2 .auth-hero-solid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 1.4rem;
}

#auth-login-v2 .auth-hero-blob {
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  z-index: 0;
}

#auth-login-v2 .auth-hero-secure {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .75);
}

#auth-login-v2 .auth-hero-secure i {
  font-size: 1rem;
}

/* carrusel de fotos del hero: cada slide trae su propia foto + su propio
   texto y se desvanece hacia el siguiente. El scrim (::after) y el texto
   (.auth-hero-content) van DENTRO de cada slide (no como hijos sueltos de
   .auth-hero) para que su z-index se compare entre ellos y no contra capas
   de otro nivel -> si el scrim quedara fuera del slide, el texto (anidado)
   nunca lograría pintarse por encima de él aunque tuviera z-index mayor. */
#auth-login-v2 .auth-hero-slides {
  position: absolute;
  inset: 0;
}

#auth-login-v2 .auth-hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 3rem;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#auth-login-v2 .auth-hero-slide.is-active {
  opacity: 1;
}

#auth-login-v2 .auth-hero-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(8, 15, 28, .82) 0%, rgba(8, 15, 28, .55) 40%, rgba(8, 15, 28, .25) 100%);
}

/* puntos de navegacion: posicion fija en la esquina para que nunca se
   superpongan con el texto de cada slide (que puede variar de largo) */
#auth-login-v2 .auth-hero-badge {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 5;
  display: flex;
  align-items: center;
}

#auth-login-v2 .auth-hero-badge img {
  height: 40px;
  width: auto;
  display: block;
}

#auth-login-v2 .auth-hero-dots {
  position: absolute;
  right: 3rem;
  bottom: 3rem;
  z-index: 3;
  display: flex;
  gap: .4rem;
}

#auth-login-v2 .auth-hero-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
  cursor: pointer;
  transition: background-color .15s ease, width .15s ease;
}

#auth-login-v2 .auth-hero-dots button.is-active {
  width: 20px;
  border-radius: 4px;
  background: #fff;
}

#auth-login-v2 .auth-hero-pattern {
  position: absolute;
  inset: 0;
  opacity: .12;
  background-image:
    radial-gradient(circle at 15% 20%, #fff 0, transparent 2%),
    radial-gradient(circle at 85% 15%, #fff 0, transparent 2%),
    radial-gradient(circle at 60% 45%, #fff 0, transparent 2%),
    radial-gradient(circle at 30% 70%, #fff 0, transparent 2%),
    radial-gradient(circle at 90% 80%, #fff 0, transparent 2%);
  background-size: 260px 260px;
  font-size: 46px;
}

#auth-login-v2 .auth-hero-icons i {
  position: absolute;
  color: #fff;
  opacity: .16;
}

#auth-login-v2 .auth-hero-icons i:nth-child(1) { top: 8%;  left: 10%; font-size: 3.4rem; transform: rotate(-12deg); }
#auth-login-v2 .auth-hero-icons i:nth-child(2) { top: 18%; right: 14%; font-size: 2.4rem; transform: rotate(10deg); }
#auth-login-v2 .auth-hero-icons i:nth-child(3) { top: 46%; left: 22%;  font-size: 2rem; transform: rotate(-6deg); }
#auth-login-v2 .auth-hero-icons i:nth-child(4) { top: 55%; right: 20%; font-size: 3.2rem; transform: rotate(14deg); }
#auth-login-v2 .auth-hero-icons i:nth-child(5) { bottom: 22%; left: 46%; font-size: 2.2rem; transform: rotate(4deg); }

#auth-login-v2 .auth-hero-content {
  position: relative;
  z-index: 2;
  max-width: 420px;
  color: #fff;
}

#auth-login-v2 .auth-hero-quote-mark {
  font-size: 3rem;
  line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
  color: rgba(255, 255, 255, .55);
  display: block;
  margin-bottom: .5rem;
}

#auth-login-v2 .auth-hero-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .9rem;
}
.auth-hero-title {
 color: #fff;
}

#auth-login-v2 .auth-hero-title span {
  color: #fff;
}

/* sobre una foto (en vez del degradado liso) el celeste pierde contraste
   contra fondos claros de la imagen -> se deja el texto en blanco solido */
#auth-login-v2 .auth-hero-photo .auth-hero-title span {
  color: #fff;
}

#auth-login-v2 .auth-hero-text {
  font-size: .95rem;
  color: rgba(255, 255, 255, .85);
  margin: 0 0 1.2rem;
}

#auth-login-v2 .auth-hero-signature {
  font-size: .85rem;
  color: rgba(255, 255, 255, .7);
}

/* ---------- panel derecho: formulario ---------- */
#auth-login-v2 .auth-form-panel {
  position: relative;
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

#auth-login-v2 .auth-theme-toggle {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--auth-border);
  background: var(--auth-input-bg);
  color: var(--auth-text-muted);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

#auth-login-v2 .auth-theme-toggle:hover {
  background: var(--auth-border);
}

#auth-login-v2 .auth-theme-toggle .bx-moon { display: none; }
#auth-login-v2[data-theme="dark"] .auth-theme-toggle .bx-sun { display: none; }
#auth-login-v2[data-theme="dark"] .auth-theme-toggle .bx-moon { display: block; }

#auth-login-v2 .auth-form-wrap {
  width: 100%;
  max-width: 400px;
}

#auth-login-v2 .auth-logo {
  height: 34px;
  margin-bottom: 1.6rem;
}

#auth-login-v2 .auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: var(--auth-text);
}

#auth-login-v2 .auth-subtitle {
  font-size: .9rem;
  color: var(--auth-text-muted);
  margin: 0 0 1rem;
}

#auth-login-v2 .auth-register-hint {
  font-size: .85rem;
  color: var(--auth-text-muted);
  margin: 0 0 1.6rem;
}

#auth-login-v2 .auth-register-hint a,
#auth-login-v2 .auth-forgot-link {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

#auth-login-v2 .auth-register-hint a:hover,
#auth-login-v2 .auth-forgot-link:hover {
  text-decoration: underline;
}

#auth-login-v2 .auth-field {
  margin-bottom: 1.1rem;
}

#auth-login-v2 .auth-field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: .4rem;
}

#auth-login-v2 .auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: .55rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#auth-login-v2 .auth-input-group:focus-within {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(44, 109, 233, .15);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 15%, transparent);
}

#auth-login-v2 .auth-input-group.is-invalid,
#auth-login-v2 .auth-input-group:has(input.is-invalid) {
  border-color: #ea5455;
}

#auth-login-v2 .auth-input-group:has(input.is-valid) {
  border-color: #28c76f;
}

#auth-login-v2 .auth-input-group > i:first-child {
  padding: 0 .3rem 0 .85rem;
  color: var(--auth-text-muted);
  font-size: 1.1rem;
}

#auth-login-v2 .auth-input-group input {
  flex: 1;
  border: none;
  background: transparent;
  padding: .7rem .5rem;
  font-size: .92rem;
  color: var(--auth-text);
  outline: none;
  min-width: 0;
}

#auth-login-v2 .auth-toggle-pass {
  border: none;
  background: transparent;
  color: var(--auth-text-muted);
  padding: 0 .85rem;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

#auth-login-v2 .auth-error {
  display: block;
  color: #ea5455;
  font-size: .78rem;
  margin-top: .35rem;
}

#auth-login-v2 .auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.4rem;
}

#auth-login-v2 .auth-checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--auth-text);
  cursor: pointer;
}

#auth-login-v2 .auth-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--auth-accent);
}

#auth-login-v2 .auth-forgot-link {
  font-size: .85rem;
}

#auth-login-v2 .auth-submit {
  width: 100%;
  border: none;
  border-radius: .55rem;
  background: var(--auth-accent);
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
  transition: background-color .15s ease;
}

#auth-login-v2 .auth-submit:hover {
  background: var(--auth-accent-dark);
}

/* opacity:1 explicito porque bootstrap le aplica opacity:.65 a los botones
   :disabled por defecto, lo que desvanece el texto blanco contra el fondo
   (color del tema) y pierde contraste */
#auth-login-v2 .auth-submit:disabled {
  background: var(--auth-accent-dark);
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
}

/* spinner del boton de ingreso mientras se procesa la autenticacion */
#auth-login-v2 .auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
  vertical-align: middle;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* aviso informativo (ej. instrucciones en recuperar contraseña) */
#auth-login-v2 .auth-notice {
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: .55rem;
  padding: .8rem 1rem;
  font-size: .82rem;
  color: var(--auth-text-muted);
  margin-bottom: 1.2rem;
}

#auth-login-v2 .auth-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.4rem 0;
  color: var(--auth-text-muted);
  font-size: .8rem;
}

#auth-login-v2 .auth-divider::before,
#auth-login-v2 .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

#auth-login-v2 .auth-social {
  display: flex;
  gap: .8rem;
  margin-bottom: 1.6rem;
}

#auth-login-v2 .auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem;
  border: 1px solid var(--auth-border);
  border-radius: .55rem;
  color: var(--auth-text);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s ease;
}

#auth-login-v2 .auth-social-btn:hover {
  background: var(--auth-input-bg);
  color: var(--auth-text);
}

#auth-login-v2 .auth-social-btn .bxl-google { color: #ea4335; }
#auth-login-v2 .auth-social-btn .bxl-microsoft { color: #00a4ef; }

#auth-login-v2 .auth-secure {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .78rem;
  color: var(--auth-text-muted);
}

#auth-login-v2 .auth-secure i {
  color: var(--auth-accent);
  font-size: 1.1rem;
  margin-top: .1rem;
}

/* ---------- variantes usadas en pages/auth-login.blade.php ---------- */
#auth-login-v2 .auth-row-end {
  justify-content: flex-end;
}

#auth-login-v2 .auth-form-wrap .alert {
  font-size: .82rem;
  padding: .6rem .9rem;
}

/* el .close de bootstrap trae padding pensado para el alert de tamano
   default (mas alto) -> con este alert compacto queda descentrado, se
   centra verticalmente independiente de la altura real */
#auth-login-v2 .auth-form-wrap .alert-dismissible .close {
  top: 50%;
  right: .9rem;
  padding: 0;
  transform: translateY(-50%);
}

#auth-login-v2 .auth-logo-link {
  display: inline-block;
  margin-bottom: 1.6rem;
}

#auth-login-v2 .auth-logo-link .auth-logo {
  margin-bottom: 0;
  max-width: 220px;
  height: auto;
  max-height: 44px;
}

#auth-login-v2 .auth-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--auth-border);
}

#auth-login-v2 .auth-powered-by img {
  height: 26px;
  width: auto;
  opacity: .75;
}

#auth-login-v2 .auth-browsers {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--auth-text-muted);
}

#auth-login-v2 .auth-browsers img {
  height: 20px;
  width: auto;
  opacity: .7;
}

#auth-login-v2 .auth-optimized-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.4rem;
  padding: .75rem 1rem;
  border: 1px solid var(--auth-border);
  border-radius: .55rem;
  background: var(--auth-input-bg);
}

#auth-login-v2 .auth-optimized-box img {
  height: 28px;
  width: auto;
  opacity: .85;
}

#auth-login-v2 .auth-secure-note {
  margin: 1rem 0 0;
  font-size: .78rem;
  color: var(--auth-text-muted);
  text-align: center;
}

@media (max-width: 991px) {
  #auth-login-v2 .auth-hero {
    display: none;
  }
}
