/* ─── Login — Split-screen layout ────────────────────────────────────────── */

/* ── Base ──────────────────────────────────────────────────────────────── */

body.als-page-login {
  background: #f7f7f8;
  font-family: 'Outfit', sans-serif;
  margin: 0;
  overflow-x: hidden;
}

body.als-page-login .als-main {
  padding: 0;
}

/* Neutralizar als-fade-up: su transform rompe position:fixed del home-fab   */
body.als-page-login .als-fade-up {
  animation: none !important;
  transform: none !important;
}

/* ── Wrapper principal ─────────────────────────────────────────────────── */

.login-container {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
}

/* ── Columna imagen (izquierda) ────────────────────────────────────────── */

.login-image-column {
  position: sticky;
  top: 0;
  width: 50%;
  height: 100svh;
  flex-shrink: 0;
  overflow: hidden;
}

/* Transicion lateral sutil entre imagen y formulario */
.login-image-column::before {

  position: absolute;
  top: 0;
  right: -16px;
  width: 32px;
  height: 100%;
  background: linear-gradient(to right, rgba(7, 12, 24, 0.28), rgba(7, 12, 24, 0));
  z-index: 2;
  pointer-events: none;
}

/* Overlay inferior de legibilidad (sin ensuciar la imagen) */
.login-image-column::after {

  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 12, 24, 0.58) 0%,
    rgba(7, 12, 24, 0.34) 30%,
    rgba(7, 12, 24, 0.08) 54%,
    rgba(7, 12, 24, 0.0) 70%
  );
  z-index: 1;
  pointer-events: none;
}

.login-image {
  position: relative;
  width: 100%;
  height: 150%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
}

/* Texto del overlay — visible en la parte inferior */
.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(30px, 3.2vw, 44px);
  z-index: 3;
}

.overlay-copy {
  background: rgba(0, 0, 0, 0.82);
  border-radius: 14px;
  padding: clamp(14px, 1.6vw, 20px);
  max-width: 520px;
}

.overlay-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(24px, 1.7vw, 30px);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.overlay-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.6;
  margin: 0;
  max-width: 360px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* ── Columna formulario (derecha) ──────────────────────────────────────── */

.login-form-column {
  flex: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(40px, 5vw, 72px) clamp(36px, 4vw, 64px);
  box-sizing: border-box;
  background: #f7f7f8;
  overflow-y: auto;
}

.login-form-inner {
  width: 100%;
  max-width: clamp(500px, 36vw, 560px);
  animation: formIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Logo ──────────────────────────────────────────────────────────────── */

.logo {
  width: 84px;
  height: auto;
  margin-bottom: 34px;
  display: block;
}

/* ── Header ────────────────────────────────────────────────────────────── */

.login-header {
  margin-bottom: 30px;
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(31px, 2.2vw, 40px);
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
  line-height: 1.06;
}

.login-subtitle {
  font-size: 15px;
  color: rgba(11, 18, 32, 0.56);
  line-height: 1.62;
  margin: 0;
  max-width: 44ch;
}

/* ── Alertas ───────────────────────────────────────────────────────────── */

#alertContainer {
  width: 100%;
}

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  line-height: 1.45;
}

.alert.show {
  display: block;
  animation: fadeUp 0.28s ease both;
}

.alert.error {
  background: #fff1f1;
  color: #c53030;
  border: 1px solid #fecdcd;
}

.alert.warning {
  background: #fffbeb;
  color: #b7791f;
  border: 1px solid #fbd38d;
}

.alert.info {
  background: #ebf4ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

/* ── Formulario ────────────────────────────────────────────────────────── */

.login-form {
  width: 100%;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(11, 18, 32, 0.45);
  margin-bottom: 8px;
}

.form-field {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  min-height: 50px;
  background: #f2f3f5;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14.5px;
  font-family: 'Outfit', sans-serif;
  color: #0b1220;
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.form-field:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(11, 18, 32, 0.14);
  box-shadow: 0 0 0 3px rgba(11, 18, 32, 0.08);
}

.form-field::placeholder {
  color: rgba(11, 18, 32, 0.28);
}

/* Password */
.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(11, 18, 32, 0.35);
  padding: 7px;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
}

.password-toggle:hover {
  color: rgba(11, 18, 32, 0.7);
}

/* Validation states */
.form-field.error {
  border: 1.5px solid #fc8181;
  background: #fff5f5;
}

.form-field.success {
  border: 1.5px solid #68d391;
  background: #f0fff4;
}

.error-message {
  display: none;
  margin-top: 5px;
  font-size: 12px;
  color: #e53e3e;
  font-weight: 500;
}

.error-message.show {
  display: block;
}

/* ── Opciones ──────────────────────────────────────────────────────────── */

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 26px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 7px;
}

.remember-me input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #f2c11c;
  cursor: pointer;
  flex-shrink: 0;
}

.remember-me label {
  font-size: 13.5px;
  color: rgba(11, 18, 32, 0.5);
  cursor: pointer;
  user-select: none;
}

.forgot-password {
  font-size: 13.5px;
  color: rgba(11, 18, 32, 0.5);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.forgot-password:hover {
  color: #0b1220;
}

/* Captcha */
.captcha-container {
  margin: 0 0 18px;
  display: flex;
  justify-content: center;
}

/* ── Botón de submit ───────────────────────────────────────────────────── */

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 22px;
  background: #0b1220;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.1px;
  cursor: pointer;
  margin-bottom: 22px;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 18px rgba(11, 18, 32, 0.16);
}

.btn-login:hover {
  background: #1a2640;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(11, 18, 32, 0.22);
}

.btn-login:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(242, 193, 28, 0.35), 0 8px 24px rgba(11, 18, 32, 0.22);
}

.btn-login:active {
  transform: scale(0.98);
  box-shadow: none;
}

.btn-login:disabled {
  background: rgba(11, 18, 32, 0.12);
  color: rgba(11, 18, 32, 0.3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Spinner ───────────────────────────────────────────────────────────── */

.loading-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-right: 9px;
  flex-shrink: 0;
}

/* ── Registro ──────────────────────────────────────────────────────────── */

.signup-link {
  text-align: center;
  font-size: 14px;
  color: rgba(11, 18, 32, 0.5);
}

.signup-link a {
  color: #0b1220;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.signup-link a:hover {
  color: #b89214;
}

/* ── FAB (volver al inicio) ────────────────────────────────────────────── */

.home-fab {
  position: fixed;
  left: 18px;
  top: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #0b1220;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  z-index: 100;
}

.home-fab-icon {
  width: 20px;
  height: 20px;
}

.home-fab:hover {
  background: rgba(242, 193, 28, 0.2);
  border-color: rgba(242, 193, 28, 0.6);
  color: #f2c11c;
  transform: translateY(-2px);
}

.home-fab:focus-visible {
  outline: 2px solid #f2c11c;
  outline-offset: 3px;
}

/* ── Keyframes ─────────────────────────────────────────────────────────── */

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

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

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

/* ── Responsive ────────────────────────────────────────────────────────── */

/* Desktop grande ≥1400px: imagen más protagonista */
@media (min-width: 1400px) {
  .login-image-column {
    width: 55%;
  }

  .login-form-inner {
    max-width: 560px;
  }
}

/* Desktop estándar 1200–1399px: 50/50 por defecto (sin override) */

/* Laptop 1025–1199px: imagen ligeramente más estrecha */
@media (max-width: 1199px) and (min-width: 1025px) {
  .login-image-column {
    width: 46%;
    height: 100svh;
  }

  .login-form-column {
    padding: 52px 40px;
  }

  .login-form-inner {
    max-width: 500px;
  }
}

/* Tablet landscape 768–1024px: imagen recortada, más espacio al form */
@media (max-width: 1024px) and (min-width: 768px) {
  .login-image-column {
    width: 38%;
    height: 100svh;
  }

  .login-form-column {
    padding: 44px 32px;
  }

  .login-form-inner {
    max-width: 400px;
  }

  .overlay-title {
    font-size: 21px;
  }

  .image-overlay {
    padding: 32px 36px;
  }
}

/* Pantalla baja ≤700px de alto (laptop landscape, monitores compactos) */
@media (max-height: 700px) {
  .login-form-column {
    justify-content: flex-start;
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .logo {
    width: 68px;
    margin-bottom: 22px;
  }

  .login-header {
    margin-bottom: 20px;
  }

  .login-title {
    font-size: 26px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-options {
    margin: 4px 0 16px;
  }
}

/* Mobile ≤767px: imagen oculta, formulario full */
@media (max-width: 767px) {
  .login-container {
    display: block;
  }

  .login-image-column {
    display: none;
  }

  .login-form-column {
    min-height: 100svh;
    padding: 48px 28px 40px;
    justify-content: center;
  }

  .home-fab {
    background: rgba(11, 18, 32, 0.07);
    border-color: rgba(11, 18, 32, 0.12);
    color: rgba(11, 18, 32, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .home-fab:hover {
    background: rgba(242, 193, 28, 0.1);
    border-color: rgba(242, 193, 28, 0.4);
    color: #b89214;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Mobile pequeño ≤400px */
@media (max-width: 400px) {
  .login-form-column {
    padding: 40px 20px 36px;
  }

  .login-title {
    font-size: 28px;
  }

  .login-form-inner {
    max-width: 100%;
  }
}
