/* Pantalla /login — panel de marca oscuro + formulario claro */

.login-page { min-height: 100vh; min-height: 100dvh; background: var(--Darkest-Hour); }

.login {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Panel de marca ---------- */

.login-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(28px, 4vw, 56px);
  color: var(--Cloud-Dancer);
}

/* Retícula técnica que se desvanece hacia los bordes */
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 35% 45%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 35% 45%, #000 30%, transparent 80%);
}

/* Resplandores de marca */
.login-hero__glow {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: flotar 18s ease-in-out infinite alternate;
}
.login-hero__glow--violet { width: 520px; height: 520px; left: -140px; top: 18%; background: rgba(107, 95, 200, .45); }
.login-hero__glow--orange { width: 360px; height: 360px; right: -80px; bottom: -60px; background: rgba(254, 88, 42, .28); animation-delay: -9s; }

@keyframes flotar {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, -30px, 0) scale(1.08); }
}

.login-hero__logo { display: inline-block; align-self: flex-start; }
.login-hero__logo img { width: clamp(150px, 12vw, 176px); height: auto; }

.login-hero__body { max-width: 640px; }

.login-hero__title {
  margin-top: 22px;
  font-family: var(--font-head);
  font-size: clamp(2.125rem, 3.4vw, 3.25rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.login-hero__lead {
  margin-top: 18px;
  max-width: 30em;
  color: var(--Blue-Violet-soft);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.5;
}

.login-hero__features { display: grid; gap: 14px; margin-top: 32px; }
.login-hero__features li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-head);
  font-size: .9375rem;
  font-weight: 500;
}
.login-hero__features .icono {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(243, 240, 235, .12);
  border-radius: 10px;
  background: var(--glass-dark);
  color: var(--Sun-Glare);
}
.login-hero__features .icono svg { width: 18px; height: 18px; }

/* Conversación de ejemplo: WhatsApp → agente IA → CRM */
.login-hero__demo {
  position: relative;
  max-width: 500px;
  padding: 16px;
  border: 1px solid rgba(243, 240, 235, .1);
  border-radius: var(--radius);
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-dark);
}
.demo-top__nombre {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: .875rem;
  font-weight: 600;
}
.demo-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--Gradient-Light);
  color: var(--Darkest-Hour);
  font-size: .6875rem;
  font-weight: 700;
}

.demo-chat { display: grid; gap: 8px; padding: 14px 0; }

.burbuja {
  position: relative;
  max-width: 82%;
  padding: 9px 12px 20px;
  border-radius: 14px;
  font-size: .875rem;
  line-height: 1.4;
  opacity: 0;
  animation: entrar-burbuja .45s var(--ease-out) forwards;
}
.burbuja--cliente {
  justify-self: start;
  border-bottom-left-radius: 4px;
  background: rgba(243, 240, 235, .09);
  color: var(--Cloud-Dancer);
}
.burbuja--agente {
  justify-self: end;
  border-bottom-right-radius: 4px;
  background: var(--Blue-Violet);
  color: #fff;
}
.burbuja__hora {
  position: absolute;
  right: 10px;
  bottom: 4px;
  font-size: .625rem;
  opacity: .7;
}
.burbuja:nth-child(1) { animation-delay: .4s; }
.burbuja:nth-child(2) { animation-delay: 1.3s; }
.burbuja:nth-child(3) { animation-delay: 2.2s; }

@keyframes entrar-burbuja {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.demo-crm {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(218, 255, 2, .25);
  border-radius: 12px;
  background: rgba(218, 255, 2, .06);
  opacity: 0;
  animation: entrar-burbuja .5s 3s var(--ease-out) forwards;
}
.demo-crm__icono {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--Sun-Glare);
  color: var(--Darkest-Hour);
}
.demo-crm__icono svg { width: 16px; height: 16px; }
.demo-crm__texto {
  display: grid;
  flex: 1;
  color: var(--Blue-Violet-soft);
  font-size: .8125rem;
}
.demo-crm__texto b { color: var(--Cloud-Dancer); font-family: var(--font-head); font-weight: 600; }
.demo-crm__texto em { color: var(--Sun-Glare); font-style: normal; }
.demo-crm__etapa {
  padding: 3px 8px;
  border: 1px solid rgba(243, 240, 235, .15);
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: .6875rem;
  letter-spacing: .04em;
}

.login-hero__live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--Sun-Glare);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .6875rem;
}
.login-hero__live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--Sun-Glare);
  box-shadow: 0 0 0 0 rgba(218, 255, 2, .6);
  animation: pulso 2s ease-out infinite;
}
@keyframes pulso {
  70% { box-shadow: 0 0 0 10px rgba(218, 255, 2, 0); }
  100% { box-shadow: 0 0 0 0 rgba(218, 255, 2, 0); }
}

/* ---------- Panel del formulario ---------- */

.login-main {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 56px);
  background: var(--Cloud-Dancer);
}
/* Filo con el degradado de marca entre los dos paneles */
.login-main::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--Blue-Violet), var(--Exuberant-Orange) 55%, var(--Sun-Glare));
}

.login-card {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding-block: 24px;
  animation: aparecer .5s .1s var(--ease-out) both;
}

.login-card__eyebrow {
  color: var(--Blue-Violet);
  font-family: var(--font-head);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.login-card h1 {
  margin-top: 10px;
  font-family: var(--font-head);
  font-size: clamp(1.875rem, 2.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.login-card__sub {
  margin: 10px 0 28px;
  color: var(--muted-strong);
  font-size: .9375rem;
}

.login-card .input[type="password"],
.login-card .input--password { padding-right: 52px; }

.field__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color .15s, background-color .15s;
}
.field__toggle:hover { color: var(--Blue-Violet); background: var(--Blue-Violet-tint); }
.field__toggle svg { width: 20px; height: 20px; }
.field__toggle .icono-ocultar { display: none; }
.field__toggle[aria-pressed="true"] .icono-ver { display: none; }
.field__toggle[aria-pressed="true"] .icono-ocultar { display: block; }

.login-card__opciones { margin: 4px 0 24px; }

.login-card__seguridad {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-light);
  color: var(--muted-strong);
  font-size: .8125rem;
  line-height: 1.5;
}
.login-card__seguridad svg { flex: none; width: 18px; height: 18px; color: var(--Blue-Violet); }

.login-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--muted-strong);
  font-family: var(--font-head);
  font-size: .75rem;
}
.login-footer a { color: inherit; }

/* ---------- Pantallas de escritorio bajas (laptops 768–960 px de alto) ---------- */

@media (min-width: 961px) and (max-height: 960px) {
  .login-hero { gap: 28px; padding-block: 36px; }
  .login-hero__lead { display: none; }
  .login-hero__features { margin-top: 24px; gap: 10px; }
  .demo-chat { padding: 10px 0; }
}

@media (min-width: 961px) and (max-height: 820px) {
  .login-hero__features { display: none; }
}

/* ---------- Tablet y móvil ---------- */

@media (max-width: 960px) {
  .login { grid-template-columns: minmax(0, 1fr); }

  .login-hero { gap: 20px; padding: 24px 20px 44px; }
  .login-hero__glow--violet { width: 320px; height: 320px; left: -120px; top: -80px; }
  .login-hero__glow--orange { width: 240px; height: 240px; right: -100px; bottom: -120px; }
  .login-hero__title { margin-top: 14px; font-size: clamp(1.75rem, 7vw, 2.25rem); }
  .login-hero__lead,
  .login-hero__features,
  .login-hero__demo { display: none; }

  /* El formulario sube como una hoja sobre el panel oscuro */
  /* overflow: hidden recorta el filo con el mismo redondeo de la hoja (si no, se ve cortado en las esquinas) */
  .login-main {
    margin-top: -20px;
    padding: 8px 20px 24px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
  }
  .login-main::before {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 3px;
    background: var(--Gradient-Light);
  }
  .login-card { margin: 0 auto; padding-block: 28px 32px; }
  .login-footer { justify-content: center; text-align: center; }
}
