/* F98.4-Z6-BT · Carrusel limpio, imagen completa y transición continua */
:root {
  --navy: #002f6c;
  --navy-deep: #001026;
  --navy-mid: #0a3d87;
  --blue: #2b7fc1;
  --red: #da291c;
  --red-bright: #e5342a;
  --ink: #14213d;
  --ink-2: #374151;
  --muted: #6b7280;
  --soft: #9aa3b2;
  --line: #dce2ea;
  --danger: #c0392b;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Archivo", var(--font);
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; min-height: 100%; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--navy-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 468px;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: var(--navy-deep);
}

/* HERO — la imagen ya incluye arte, tono y textos; no se agrega ningún filtro. */
.hero-carousel {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: #00162f;
}
.hero-scenes,
.hero-scene {
  position: absolute;
  inset: 0;
}
.hero-scenes {
  background: #00162f;
}
.hero-scene {
  z-index: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: visible;
  transform: translateZ(0);
  transition: opacity 1.35s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity;
}
.hero-scene.is-active {
  z-index: 1;
  opacity: 1;
}
.hero-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  user-select: none;
  transform: none;
  filter: none;
  backface-visibility: hidden;
}

/* Indicadores por encima de la franja informativa que ya viene impresa en cada arte. */
.hero-progress {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: clamp(92px, 12vh, 126px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(2, 17, 38, .32);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  box-shadow: 0 10px 26px rgba(0,0,0,.16);
  transform: translateX(-50%);
}
.hero-progress button {
  position: relative;
  width: 34px;
  height: 4px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  cursor: pointer;
  transition: width .32s ease, background .32s ease, transform .2s ease;
}
.hero-progress button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.68);
}
.hero-progress button.is-active {
  width: 58px;
  background: rgba(255,255,255,.30);
}
.hero-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: #ef2538;
}
.hero-progress button.is-active .hero-progress-fill {
  animation: heroProgress 3.9s linear forwards;
}
@keyframes heroProgress { to { width: 100%; } }

/* LOGIN PANEL */
.login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
  background: #fff;
}
.login-card {
  width: 100%;
  max-width: 392px;
  animation: panelIn .52s cubic-bezier(.22,1,.36,1) both;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-card.shake { animation: formShake .42s ease both; }
@keyframes formShake {
  0%,100% { transform: translateX(0); }
  18%,58% { transform: translateX(-6px); }
  38%,78% { transform: translateX(6px); }
}
.login-card h2 {
  margin: 0;
  color: var(--navy);
  font-family: var(--display);
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 800;
}
.login-subtitle {
  margin: 9px 0 30px;
  color: var(--muted);
  font-size: 14.5px;
}
.field { margin-bottom: 18px; }
.field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.ctrl { position: relative; }
.ctrl input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.ctrl input::placeholder { color: var(--soft); }
.ctrl input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(43,127,193,.14);
}
.ctrl.has-error input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(192,57,43,.10);
}
.ctrl input.with-trail { padding-right: 48px; }
.toggle-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: var(--soft);
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.toggle-eye:hover { color: var(--navy); background: rgba(0,47,108,.06); }
.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
}
.remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 25px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}
.remember input { display: none; }
.remember .box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, border-color .2s ease;
}
.remember input:checked + .box {
  background: var(--blue);
  border-color: var(--blue);
}
.remember input:checked + .box::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(.5px,-1px);
}
.btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn {
  height: 52px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, background .2s ease, color .2s ease;
}
.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--blue));
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 12px 28px rgba(43,127,193,.38);
}
.btn-primary:disabled { opacity: .78; cursor: wait; }
.btn-secondary {
  border: 2px solid var(--red);
  color: var(--red);
  background: transparent;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  color: #fff;
  background: var(--red);
  box-shadow: 0 12px 28px rgba(218,41,28,.26);
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.forgot { margin-top: 20px; text-align: center; }
.forgot a {
  color: var(--soft);
  font-size: 13px;
  text-decoration: none;
}
.forgot a:hover { color: var(--blue); text-decoration: underline; }

/* MODAL */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,16,38,.68);
  backdrop-filter: blur(4px);
}
.modal {
  width: 100%;
  max-width: 440px;
  padding: 28px;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0,0,0,.42);
}
.modal .m-kicker {
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.modal h2 { margin: 0 0 6px; color: var(--navy); font-size: 22px; }
.modal .m-sub { margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.group-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.group-opt:hover { border-color: var(--blue); background: rgba(43,127,193,.05); }
.group-opt .g-name { color: var(--navy); font-size: 15px; font-weight: 800; }
.group-opt .g-prog { margin-top: 2px; color: var(--muted); font-size: 12px; }
.group-opt .g-arrow { margin-left: auto; color: var(--soft); }
.modal .m-cancel {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

/* REDIRECT */
.redirect {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  background: linear-gradient(145deg, var(--navy-deep), var(--navy), #082a60, var(--navy-deep));
  background-size: 220% 220%;
  animation: redirectBg 7s ease infinite;
}
@keyframes redirectBg { 50% { background-position: 100% 50%; } }
.redirect-loader {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 22px;
}
.redirect-loader span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  animation: bounce 1s ease-in-out infinite;
}
.redirect-loader span:nth-child(2) { animation-delay: .14s; }
.redirect-loader span:nth-child(3) { animation-delay: .28s; }
@keyframes bounce { 0%,100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-8px); opacity: 1; } }
.redirect .r-title { font-size: 26px; font-weight: 800; }
.redirect .r-sub { margin-top: 6px; opacity: .74; font-size: 14px; }

@media (max-width: 1080px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) 430px; }
  .login-panel { padding: 44px 36px; }
  .hero-progress { bottom: clamp(84px, 10vh, 108px); }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: visible;
  }
  .hero-carousel {
    order: 1;
    min-height: clamp(330px, 58vw, 430px);
  }
  .login-panel {
    order: 2;
    min-height: auto;
    padding: 34px 24px 42px;
  }
  .login-card { max-width: 430px; }
  .hero-photo { object-position: center center; }
  .hero-progress {
    bottom: 62px;
    gap: 6px;
    padding: 7px 8px;
  }
  .hero-progress button { width: 24px; }
  .hero-progress button.is-active { width: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .hero-photo { transform: none !important; }
}
