/* ==========================================================================
   GestIA · Inicio de sesión: hero con la vitrina de módulos y panel de ingreso
   ========================================================================== */

.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr);
  background: #fff;
}
.login.leaving { animation: fade-out .35s ease forwards; }
.boot-error { display: grid; place-items: center; min-height: 100dvh; padding: 16px; background: var(--canvas); }
.boot-error > .card { width: min(100%, 440px); animation: pop .35s var(--spring) both; }
.login-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  padding: 34px clamp(28px, 4vw, 56px);
  color: #fff;
  background: var(--navy-950);
}
.mesh { position: absolute; inset: -25%; z-index: -3; }
.blob { position: absolute; border-radius: 50%; background: radial-gradient(circle, var(--c) 0%, transparent 68%); animation: drift 20s ease-in-out infinite; will-change: transform; }
.blob.b1 { --c: #2f5bea; width: 760px; height: 760px; top: -4%; left: -12%; }
.blob.b2 { --c: #14a4dc; width: 620px; height: 620px; right: -4%; bottom: 0; animation-delay: -7s; }
.blob.b3 { --c: #7c5cfa; width: 520px; height: 520px; top: 30%; left: 30%; opacity: .75; animation-delay: -13s; }
.blob.b4 { --c: #e6498f; width: 420px; height: 420px; bottom: -6%; left: 4%; opacity: .5; animation-delay: -4s; }
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(6, 13, 43, .55) 0%, rgba(6, 13, 43, .1) 45%, rgba(6, 13, 43, .72) 100%);
}
.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--brand-pattern);
  background-size: 56px 56px;
  opacity: .07;
  -webkit-mask-image: radial-gradient(circle at 70% 40%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 70% 40%, #000 0%, transparent 70%);
}
.login-copy { max-width: 600px; display: grid; gap: 20px; animation: rise .8s var(--ease) both .1s; }
.pill-glass {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 650;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(10px);
}
.login-copy h1 { font-size: clamp(34px, 3.8vw, 54px); font-weight: 800; letter-spacing: -.035em; line-height: 1.06; }
.login-copy h1 span {
  background: linear-gradient(90deg, #8fd8ff 0%, #6ee7d6 50%, #ffc2dc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-copy p { max-width: 520px; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .78); }
.login-features { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.login-features li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .9); }
.login-features .i { width: 30px; height: 30px; padding: 7px; border-radius: 10px; background: rgba(255, 255, 255, .12); }


/* Capas del hero: el contenido queda sobre la órbita decorativa */
.login-brand, .login-copy, .login-showcase, .login-foot { position: relative; z-index: 1; }
.login-hero { --px: 0; --py: 0; }
.mesh { transform: translate3d(calc(var(--px) * 26px), calc(var(--py) * 18px), 0); transition: transform .8s var(--ease); }

/* Órbita de iconos de los módulos, girando despacio detrás de la vitrina */
.login-orbit {
  position: absolute;
  top: 9%;
  right: 5%;
  z-index: 0;
  width: 280px;
  height: 280px;
  pointer-events: none;
  translate: calc(var(--px) * -34px) calc(var(--py) * -24px);
  transition: translate .8s var(--ease);
}
.login-orbit::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .14); }
.orbit-ring { position: absolute; inset: 0; animation: spin 60s linear infinite; }
.orbit-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px;
  border-radius: 50%;
  color: var(--on-color);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px);
  transform: rotate(calc(var(--i) * 60deg)) translateX(118px) rotate(calc(var(--i) * -60deg));
}
.orbit-dot::after { content: ""; position: absolute; inset: 9px; z-index: -1; border-radius: 50%; background: var(--tone); opacity: .55; filter: blur(8px); }
.orbit-dot .i { width: 20px; height: 20px; animation: spin 60s linear infinite reverse; }

/* Vitrina: escenas por módulo que rotan con sus tres tarjetas */
.login-showcase { display: grid; gap: 18px; max-width: 620px; }
.login-float {
  position: relative;
  height: 230px;
  transform: translate3d(calc(var(--px) * -14px), calc(var(--py) * -10px), 0);
  transition: transform .6s var(--ease);
}
.showcase-scene { position: absolute; inset: 0; visibility: hidden; transition: visibility 0s .4s; }
.showcase-scene.is-active { visibility: visible; transition: none; }
.fc-slot { position: absolute; opacity: 0; transform: translateY(18px) scale(.95); transition: opacity .25s var(--ease), transform .3s var(--ease); }
.is-active .fc-slot {
  opacity: 1;
  transform: none;
  transition: opacity .35s var(--ease) calc(var(--d) * 110ms + 120ms), transform .45s var(--spring) calc(var(--d) * 110ms + 120ms);
}
.slot-main { --d: 0; left: 0; top: 10px; width: 270px; }
.slot-chat { --d: 1; left: 300px; top: 0; width: 290px; }
.slot-note { --d: 2; left: 220px; top: 150px; }
.float-card {
  position: relative;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--on-color);
  background: rgba(255, 255, 255, .11);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .5);
  animation: float 6s ease-in-out infinite;
}
.slot-chat .float-card { animation-delay: -2s; }
.slot-note .float-card { animation-delay: -4s; }
.fc-main > small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.fc-main strong { display: block; margin: 2px 0 10px; font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.fc-main strong span { font-size: 15px; font-weight: 600; opacity: .8; }
.fc-main em { display: block; margin-top: 8px; font-size: 12px; font-style: normal; opacity: .85; }
.fc-main .meter { background: rgba(255, 255, 255, .16); }
.fc-legend { display: flex; gap: 14px; margin-top: 9px; font-size: 12px; opacity: .9; }
.fc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fc-doc { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.fc-doc strong.fc-line { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.fc-doc em { margin-top: 3px; }
.fc-badge { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; background: var(--tone); }
.fc-badge .i { width: 20px; height: 20px; }
.fc-action { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--tone-ink); background: var(--on-color); }
.fc-action .i { width: 14px; height: 14px; }
.fc-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-steps span { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: rgba(255, 255, 255, .14); }
.fc-steps .i { width: 15px; height: 15px; padding: 2px; border-radius: 50%; background: var(--tone); }
.fc-org { display: grid; justify-items: center; margin-top: 10px; }
.fc-branch { width: 150px; height: 14px; margin: 4px 0; border: 1.5px solid rgba(255, 255, 255, .35); border-bottom: 0; border-radius: 8px 8px 0 0; }
.fc-members { display: flex; gap: 34px; }
.fc-org .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.fc-boss .avatar { box-shadow: 0 0 0 2px var(--tone); }
.fc-chat { display: grid; }
.fc-chat .fc-row { display: flex; gap: 10px; align-items: flex-start; }
.fc-chat p { font-size: 13px; line-height: 1.45; }
.fc-chat .fc-q { margin-bottom: 10px; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: rgba(255, 255, 255, .92); color: var(--navy-900); font-weight: 600; justify-self: end; }
.fc-chat .ghost { visibility: hidden; }
.fc-note { display: flex; align-items: center; gap: 10px; }
.fc-note .fc-check { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--tone); }
.fc-note .fc-check .i { width: 18px; height: 18px; }
.fc-note strong { display: block; font-size: 13.5px; }
.fc-note small { font-size: 12px; opacity: .75; }

/* Puntos de la vitrina: permiten elegir el módulo con el ratón o el teclado */
.showcase-dots { display: flex; flex-wrap: wrap; gap: 8px; }
.showcase-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px 0 10px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 650;
  color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .25s var(--spring), background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.showcase-dot .i { width: 16px; height: 16px; }
.showcase-dot:hover { transform: translateY(-2px); color: var(--on-color); border-color: rgba(255, 255, 255, .3); }
.showcase-dot:active { transform: scale(.96); }
.showcase-dot:focus-visible { outline: 3px solid rgba(255, 255, 255, .7); outline-offset: 2px; }
.showcase-dot[aria-pressed="true"] { color: var(--on-color); background: var(--tone-ink); border-color: transparent; }

.login-card.shake { animation: shake .45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.login-foot { display: flex; align-items: center; gap: 12px; font-size: 12px; color: rgba(255, 255, 255, .6); }
.login-foot .brand-art { opacity: .92; }


.login-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: 36px 24px;
  background:
    radial-gradient(circle at 100% 0%, #e7eeff 0%, transparent 42%),
    radial-gradient(circle at 0% 100%, #e3f7f4 0%, transparent 38%),
    #fff;
}
.login-card { width: min(430px, 100%); display: grid; gap: 18px; animation: rise .7s var(--ease) both .2s; }
.login-dwc { justify-self: start; margin-bottom: 8px; }
.login-title { display: flex; align-items: center; gap: 14px; }
.login-title h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.login-title p { margin-top: 6px; color: var(--ink-3); font-size: 14.5px; }
.login-card .input { height: 48px; border-radius: 14px; font-size: 15px; }
.divider { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.demo {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.demo:hover { transform: translateY(-3px); border-color: var(--tone); box-shadow: 0 16px 30px -18px var(--tone); }
.demo:disabled { opacity: .6; transform: none; }
.demo b { font-size: 13.5px; font-weight: 750; }
.demo small { display: block; margin-top: -6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.demo .chip { height: 22px; padding: 0 8px; font-size: 10.5px; }
.login-note { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.login-note .i { width: 14px; height: 14px; }
.login-context { display: flex; align-items: center; gap: 10px; margin: -6px 0 0; padding: 11px 14px; border-radius: var(--r-md); background: var(--tone-soft); color: var(--tone-ink); font-size: 13px; font-weight: 650; animation: rise .35s var(--spring) both; }
.login-context .i { flex: none; width: 18px; height: 18px; }
.btn-google { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); gap: 12px; }
.btn-google img { flex: none; transition: transform .3s var(--spring); }
.btn-google:hover { border-color: var(--blue-200); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-google:hover img { transform: rotate(-12deg) scale(1.08); }
.btn-google:focus-visible { outline: 3px solid var(--blue-200); outline-offset: 2px; }
.btn-google.is-busy { pointer-events: none; opacity: .7; }
.login-password { display: grid; gap: 18px; }
.login-password[hidden] { display: none; }
.login-password:not([hidden]) { animation: rise .3s var(--spring) both; }
.login-mobile-brand { display: none; }


/* Módulos bajo el ingreso */
.login-modules { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.login-modules li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px 0 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  color: var(--tone-ink);
  background: var(--tone-soft);
  animation: rise .4s var(--spring) both;
  animation-delay: calc(var(--n, 0) * 60ms + 400ms);
}
.login-modules li:nth-child(2) { --n: 1; }
.login-modules li:nth-child(3) { --n: 2; }
.login-modules li:nth-child(4) { --n: 3; }
.login-modules li:nth-child(5) { --n: 4; }
.login-modules .i { width: 15px; height: 15px; }

/* Brillo que recorre el botón de Google al pasar el cursor */
.btn-google { position: relative; overflow: hidden; }
.btn-google::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .8), transparent);
  transform: translateX(-120%);
  pointer-events: none;
}
.btn-google:hover::after { animation: sweep .9s var(--ease); }

@media (max-width: 1720px) {
  .login-orbit { top: auto; bottom: 20%; right: 1%; scale: .72; }
}
@media (max-width: 1500px) {
  .login-orbit { display: none; }
}
@media (max-width: 1180px) {
  .slot-chat { left: 240px; width: 260px; }
  .slot-note { left: 150px; }
}
@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: auto; padding: 26px 22px 30px; gap: 22px; }
  .login-showcase, .login-orbit, .login-features, .login-foot { display: none; }
  .login-copy { gap: 12px; }
  .login-copy h1 { font-size: 30px; }
  .login-copy p { font-size: 14.5px; }
  .login-panel { padding: 28px 18px 36px; }
}
@media (max-width: 460px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo { grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px; }
  .demo small { margin-top: 0; grid-column: 2; }
  .demo b { grid-column: 2; grid-row: 1; }
  .demo .avatar { grid-row: span 2; }
  .demo .chip { grid-column: 3; grid-row: 1 / span 2; }
}

