/* ====== Reset mínimo ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #050509;
  color: #e5e7eb;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ====== Fondo con grid sutil ====== */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: linear-gradient(
      to right,
      rgba(63, 63, 70, 0.3) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(63, 63, 70, 0.3) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
}

/* ====== Layout general ====== */
.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-container {
  max-width: 1120px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  /* Centramos verticalmente; la altura de la imagen la fijamos por JS */
  align-items: center;
}

/* ====== Columna de imagen ====== */
.image-column {
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-card {
  background: radial-gradient(circle at top left, #1f2937, #020617);
  border-radius: 32px;
  overflow: hidden;
  width: 100%;
  /* Altura fija generosa para mostrar completa la ilustración */
  height: 720px;
  max-height: 720px;
  position: relative;
  border: 1px solid rgba(59, 130, 246, 0.28);
  box-shadow:
    0 40px 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(15, 23, 42, 0.7);
}

/* Marco vistoso (overlay) */
.image-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-shadow:
    inset 0 0 0 1px rgba(59, 130, 246, 0.22),
    0 0 0 1px rgba(37, 99, 235, 0.12),
    0 18px 55px rgba(37, 99, 235, 0.16);
}

.image-card::after {
  content: "";
  position: absolute;
  left: -25%;
  right: -25%;
  top: -40%;
  height: 70%;
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    closest-side,
    rgba(59, 130, 246, 0.22),
    rgba(59, 130, 246, 0) 70%
  );
  transform: rotate(-10deg);
  opacity: 0.9;
}
.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* La imagen cubre todo el contenedor y respeta las esquinas redondeadas */
  object-fit: cover;
  object-position: center;
  background: transparent;
  border-radius: inherit;
  opacity: 0;
  transform: scale(1.02);
  transition:
    opacity 2.2s ease-in-out,
    transform 2.2s ease-in-out;
}

.hero-slide--active {
  opacity: 1;
  transform: scale(1);
}

/* ====== Columna de formulario ====== */
.form-column {
  display: flex;
  flex-direction: column;
  /* Center cards within the right column on all sizes */
  align-items: center;
  justify-content: center;
}

/* Tarjeta "glass" */
.glass-card {
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent)
      border-box,
    rgba(24, 24, 27, 0.85);
  border-radius: 24px;
  padding: 40px 40px 32px;
  border: 1px solid rgba(39, 39, 42, 0.9);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(22px);
  /* Prevent over-stretching on large screens and keep centered */
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

/* ====== Header de la tarjeta ====== */
.card-header {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo-wrapper {
  display: flex;
  flex-direction: column;   /* logo arriba, texto abajo */
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  width: auto;
  height: auto;
  border-radius: 0;
  box-shadow: none;         /* quita la sombra azul */
  background: none;
}

/* Tamaño del logo */
.logo-wrapper img {
  width: 110px;
  max-width: 100%;
  height: auto;
  margin-bottom: 8px;
}

/* Responsivo móvil */
@media (max-width: 480px) {
  .logo-wrapper img {
    width: 90px;
  }
}

.logo-icon {
  width: 100%;
  height: 100%;
}

.card-title {
  margin: 0 0 4px;
  color: #f9fafb;
  font-size: 1.45rem;
  font-weight: 600;
}

.card-subtitle {
  margin: 0;
  color: #9ca3af;
  font-size: 0.95rem;
}

/* ====== Formulario ====== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 16px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.icon {
  width: 20px;
  height: 20px;
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  padding-left: 44px;
  border-radius: 12px;
  border: 1px solid #3f3f46;
  background: rgba(24, 24, 27, 0.7);
  color: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    transform 0.08s ease;
}

.field-input::placeholder {
  color: #6b7280;
}

.field-input:focus {
  border-color: #3b82f6;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.4),
    0 16px 24px rgba(15, 23, 42, 0.6);
  background: rgba(24, 24, 27, 0.9);
  transform: translateY(-1px);
}

/* Botón de mostrar/ocultar password */
.password-toggle {
  position: absolute;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}

.password-toggle:hover {
  color: #e5e7eb;
}

.eye-icon {
  width: 18px;
  height: 18px;
  display: none;
}

.eye-icon--open {
  display: inline-block;
}

.password-visible .eye-icon--open {
  display: none;
}

.password-visible .eye-icon--closed {
  display: inline-block;
}

/* Mensajes de error */
.field-error {
  min-height: 16px;
  font-size: 0.8rem;
  color: #f97373;
}

/* Meta (link de forgot password) */
.form-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.form-meta--split {
  justify-content: space-between;
  gap: 12px;
}

.link-muted {
  color: #60a5fa;
  font-size: 0.86rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.link-muted:hover {
  color: #93c5fd;
}

/* Estado deshabilitado para el enlace de Forgot Password */
.link-muted.is-disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: default;
}

/* Botón principal */
.btn-primary {
  margin-top: 4px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  color: #ffffff;
  background-image: linear-gradient(90deg, #2563eb, #22d3ee);
  box-shadow:
    0 20px 40px rgba(37, 99, 235, 0.6),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow:
    0 24px 50px rgba(37, 99, 235, 0.75),
    0 0 0 1px rgba(15, 23, 42, 1);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 1);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 4px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(39, 39, 42, 0.9),
    transparent
  );
}

.divider-label {
  color: #6b7280;
  font-size: 0.8rem;
}

/* Signup text */
.signup-text {
  text-align: center;
  font-size: 0.9rem;
  color: #9ca3af;
}

.link-accent {
  color: #60a5fa;
  font-weight: 500;
  text-decoration: none;
}

.link-accent:hover {
  color: #93c5fd;
}

/* Texto de seguridad */
.security-text {
  margin-top: 18px;
  text-align: center;
  font-size: 0.8rem;
  color: #4b5563;
}

/* ====== Estados de error en inputs (via clase) ====== */
.field-input--invalid {
  border-color: #f97373;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
}

/* ====== Responsivo ====== */
@media (max-width: 960px) {
  .login-container {
    max-width: 720px;
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .image-column {
    display: none; /* ocultamos la imagen en móvil/tablet */
  }

  .form-column {
    align-items: center; /* centramos la tarjeta en pantallas pequeñas */
  }

  .glass-card {
    padding: 32px 24px 24px;
    width: 100%;
    max-width: 420px; /* ancho cómodo en móvil/tablet */
  }
}

@media (max-width: 480px) {
  .login-page {
    padding: 24px 12px;
  }

  .glass-card {
    padding: 32px 22px 24px;
    border-radius: 20px;
  }

  .card-title {
    font-size: 1.3rem;
  }

  .btn-primary {
    font-size: 1rem;
    padding: 15px 18px;
    border-radius: 14px;
  }

  /* Make inputs bigger/easier to tap on mobile */
  .login-form,
  .form-field,
  .field-wrapper {
    width: 100%;
  }

  .field-input {
    font-size: 1rem;
    padding: 15px 18px;
    padding-left: 54px;
    border-radius: 14px;
    width: 100% !important;
    flex: 1 1 auto;
    min-width: 0;
  }

  .field-icon {
    left: 20px;
  }

  .password-toggle {
    right: 16px;
    padding: 6px;
  }
}

/* ====== Custom select: Type User ====== */
.field {
  position: relative;
  display: block;
  margin-top: 10px;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.field > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.psuedo_select {
  position: relative;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid #3f3f46;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  min-width: 0;
  padding: 12px 44px 12px 14px;
  background: rgba(24, 24, 27, 0.7);
  color: #e5e7eb;
}

.psuedo_select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.85;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7.41 7.84 12 12.42l4.59-4.58L18 9.25l-6 6-6-6z'/><path d='M0-.75h24v24H0z' fill='none'/></svg>");
}

.psuedo_select .selected {
  display: block;
  width: 100%;
}

/* Placeholder when nothing selected */
.psuedo_select .selected:empty::before {
  content: "Select a user type";
  color: #6b7280;
}

/* Focus state (matches .field-input:focus) */
.field.focused .psuedo_select {
  border-color: #3b82f6;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.4),
    0 16px 24px rgba(15, 23, 42, 0.6);
  background: rgba(24, 24, 27, 0.9);
}

.psuedo_select .options {
  position: absolute;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #020617;
  border-radius: 10px;
  list-style: none;
  padding: 4px 0;
  box-shadow:
    0 18px 35px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  overflow: hidden;
  z-index: 20;
}

.psuedo_select .options .option {
  padding: 10px 12px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.psuedo_select .options .option:hover {
  background: rgba(37, 99, 235, 0.35);
}

.field .options {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.field.focused .options {
  opacity: 1;
  pointer-events: auto;
}
