* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-body {
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
  background: #020617;
}

/* === FONDO VIVO: Ken Burns + atmósfera === */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  transform: translateZ(0);
  background: #020617 url("assets/bg-login.jpg") center center / cover no-repeat;
}

.bg-photo {
  position: absolute;
  inset: -8%;
  background: url("assets/bg-login.jpg") center center / cover no-repeat;
  transform-origin: 45% 50%;
  will-change: transform;
  animation: kenBurns 34s ease-in-out infinite alternate;
}

.bg-glow {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 60vw;
  height: 60vw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,176,82,.45), rgba(255,140,60,.16) 38%, transparent 62%);
  mix-blend-mode: screen;
  animation: sunBreath 7s ease-in-out infinite;
}

.bg-haze {
  position: absolute;
  inset: -10% -20%;
  background:
    radial-gradient(60% 40% at 30% 28%, rgba(255,230,200,.10), transparent 70%),
    radial-gradient(50% 36% at 75% 22%, rgba(210,225,255,.08), transparent 70%);
  mix-blend-mode: screen;
  animation: hazeDrift 46s linear infinite;
}

.bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2,6,23,.05), rgba(2,6,23,.01), rgba(2,6,23,.16)),
    linear-gradient(180deg, rgba(2,6,23,0), rgba(2,6,23,.22));
}

@keyframes kenBurns {
  0%   { transform: scale(1.06) translate(0, 0); }
  100% { transform: scale(1.17) translate(-2%, -1.2%); }
}

@keyframes sunBreath {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
}

@keyframes hazeDrift {
  0%   { transform: translateX(-4%); }
  100% { transform: translateX(4%); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-photo,
  .bg-glow,
  .bg-haze {
    animation: none;
  }
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 520px;
  align-items: center;
  gap: 56px;
  padding: 48px 72px;
  position: relative;
  z-index: 5;
}

.brand-area {
  align-self: start;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-logo-fj {
  width: 122px;
  height: 122px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 16px rgba(255,255,255,.75))
    drop-shadow(0 0 34px rgba(0,140,255,1))
    drop-shadow(0 18px 32px rgba(0,0,0,.9));
  animation: logoPulse 3.8s ease-in-out infinite;
}

.brand-divider {
  width: 2px;
  height: 94px;
  background: linear-gradient(180deg, transparent, #fff, #38bdf8, #fff, transparent);
  box-shadow: 0 0 18px rgba(255,255,255,.85), 0 0 34px rgba(56,189,248,1);
}

.brand-text h1 {
  margin: 0;
  font-size: 74px;
  line-height: .86;
  letter-spacing: .075em;
  font-weight: 950;
  font-style: italic;
  color: #fff;
  text-shadow:
    0 0 8px rgba(255,255,255,.95),
    0 0 22px rgba(96,165,250,1),
    0 0 48px rgba(37,99,235,.95),
    0 24px 42px rgba(0,0,0,.95);
  animation: titleGlow 4.5s ease-in-out infinite;
}

.brand-text p {
  margin: 14px 0 0;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 14px;
  font-weight: 850;
  color: #fff;
  text-shadow:
    0 0 10px rgba(255,255,255,.65),
    0 0 24px rgba(59,130,246,.9),
    0 10px 24px rgba(0,0,0,.95);
}

.login-card {
  width: 100%;
  min-height: 620px;
  padding: 50px 46px 40px;
  border-radius: 44px;
  position: relative;
  overflow: hidden;
  background: rgba(2,6,23,.06);
  border: 1px solid rgba(255,255,255,.68);
  box-shadow:
    0 44px 115px rgba(0,0,0,.42),
    0 0 24px rgba(255,255,255,.62),
    0 0 58px rgba(59,130,246,.86),
    inset 0 1px 0 rgba(255,255,255,.62),
    inset 0 -1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(5px) saturate(170%);
  -webkit-backdrop-filter: blur(5px) saturate(170%);
  animation: cardIn .75s ease both, floatCard 6s ease-in-out infinite;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 44px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.35), transparent 34%),
    radial-gradient(circle at 100% 50%, rgba(59,130,246,.30), transparent 28%),
    radial-gradient(circle at 0% 70%, rgba(255,255,255,.17), transparent 28%);
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 44px;
  padding: 2px;
  background: linear-gradient(135deg, #fff, #38bdf8, rgba(255,255,255,.25), #2563eb, rgba(255,255,255,.95));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: borderGlow 3.8s ease-in-out infinite;
}

.login-logo-wrap {
  width: 122px;
  height: 122px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  position: relative;
  background: rgba(2,6,23,.08);
  border: 1px solid rgba(255,255,255,.58);
  box-shadow:
    0 0 0 8px rgba(37,99,235,.08),
    0 0 36px rgba(59,130,246,.95),
    0 0 64px rgba(59,130,246,.55),
    inset 0 1px 0 rgba(255,255,255,.32);
}

.logo-orbit {
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(59,130,246,.95);
  box-shadow: 0 0 24px rgba(59,130,246,1), inset 0 0 20px rgba(59,130,246,.65);
  animation: orbitPulse 3.8s ease-in-out infinite;
}

.orbit-two {
  inset: -14px;
  opacity: .35;
  animation: orbitPulse 5s ease-in-out infinite reverse;
}

.logo-orbit::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #fff;
  top: 18px;
  left: 12px;
  box-shadow: 0 0 16px #fff, 0 0 30px #38bdf8, 0 0 50px #2563eb;
  animation: orbitMove 3.8s linear infinite;
}

.login-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.75)) drop-shadow(0 0 24px rgba(59,130,246,.85));
}

.login-card h2 {
  margin: 0;
  text-align: center;
  font-size: 44px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.03em;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,.7), 0 0 24px rgba(59,130,246,.55), 0 12px 24px rgba(0,0,0,.78);
}

.subtitle-wrap {
  position: relative;
  margin: 12px 0 38px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.subtitle {
  margin: 0;
  color: rgba(255,255,255,.94);
  font-size: 20px;
  text-shadow: 0 8px 18px rgba(0,0,0,.75);
}

.subtitle-light {
  position: absolute;
  width: 280px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff, #38bdf8, transparent);
  box-shadow: 0 0 16px rgba(255,255,255,.9), 0 0 34px rgba(56,189,248,1);
  animation: subtitleScan 3.4s ease-in-out infinite;
}

.row {
  margin-bottom: 24px;
}

.row label {
  display: block;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 850;
  font-size: 15px;
  text-shadow: 0 0 12px rgba(0,0,0,.75);
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 1;
  font-size: 18px;
  filter: drop-shadow(0 0 8px rgba(255,255,255,.55));
}

.input {
  width: 100%;
  height: 68px;
  padding: 0 78px 0 62px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.74);
  background: rgba(2,6,23,.07);
  color: #fff;
  font-size: 17px;
  outline: none;
  transition: .24s ease;
  box-shadow:
    0 0 16px rgba(255,255,255,.42),
    0 0 28px rgba(59,130,246,.45),
    inset 0 1px 0 rgba(255,255,255,.24);
}

.input::placeholder {
  color: rgba(255,255,255,.80);
}

.input:focus {
  border-color: #fff;
  background: rgba(2,6,23,.15);
  box-shadow:
    0 0 0 4px rgba(37,99,235,.24),
    0 0 22px rgba(255,255,255,.78),
    0 0 46px rgba(59,130,246,.9),
    inset 0 1px 0 rgba(255,255,255,.30);
}

.toggle-pass {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 76px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(2,6,23,.22);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 34px;
  font-size: 15px;
}

.remember-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.remember-wrap input {
  width: 22px;
  height: 22px;
  accent-color: #2563eb;
}

.meta a {
  color: #38bdf8;
  font-weight: 850;
  text-decoration: none;
  text-shadow: 0 0 10px rgba(56,189,248,.9), 0 0 24px rgba(37,99,235,.75);
}

.btn {
  width: 100%;
  height: 68px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-size: 21px;
  font-weight: 950;
  cursor: pointer;
  background: linear-gradient(135deg, #00c8ff, #2457ff, #8b5cf6, #ec4899);
  background-size: 240% 240%;
  box-shadow:
    0 18px 38px rgba(37,99,235,.75),
    0 0 26px rgba(255,255,255,.55),
    0 0 54px rgba(59,130,246,.82),
    0 0 70px rgba(236,72,153,.38),
    inset 0 1px 0 rgba(255,255,255,.58);
  transition: .22s ease;
  animation: btnGradient 5s ease infinite;
}

.btn span {
  margin-right: 10px;
}

.err {
  display: none;
  margin: 0 0 18px;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(239,68,68,.18);
  border: 1px solid rgba(248,113,113,.45);
  color: #fecaca;
  font-weight: 800;
}

.err:not(:empty) {
  display: block;
}

.note {
  margin-top: 16px;
  text-align: center;
  color: rgba(226,232,240,.75);
  font-size: 13px;
}

.secure-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 42px;
  color: rgba(255,255,255,.88);
}

.secure-line span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.58), transparent);
}

.fx,
.spark {
  position: fixed;
  pointer-events: none;
  z-index: 1;
}

.fx-top {
  width: 430px;
  height: 2px;
  left: 68px;
  top: 92px;
  background: linear-gradient(90deg, transparent, #fff, #38bdf8, transparent);
  box-shadow: 0 0 18px #fff, 0 0 36px #38bdf8, 0 0 60px #2563eb;
  animation: topScan 4.8s ease-in-out infinite;
}

.fx-card {
  width: 300px;
  height: 300px;
  right: 16%;
  bottom: 14%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(59,130,246,.26), transparent 66%);
  animation: pulseSoft 5s ease-in-out infinite;
}

.spark {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fb923c;
  box-shadow: 0 0 16px #fb923c, 0 0 28px #f97316;
  opacity: .8;
}

.spark-1 { left: 24%; bottom: 9%; animation: sparkMove 6s linear infinite; }
.spark-2 { left: 52%; bottom: 13%; animation: sparkMove 7s linear infinite 1s; }
.spark-3 { left: 70%; bottom: 18%; animation: sparkMove 5s linear infinite 2s; }
.spark-4 { left: 38%; bottom: 7%; animation: sparkMove 8s linear infinite 3s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes logoPulse {
  0%, 100% {
    filter: drop-shadow(0 0 16px rgba(255,255,255,.7)) drop-shadow(0 0 34px rgba(0,140,255,1)) drop-shadow(0 18px 32px rgba(0,0,0,.9));
  }
  50% {
    filter: drop-shadow(0 0 24px rgba(255,255,255,1)) drop-shadow(0 0 52px rgba(59,130,246,1)) drop-shadow(0 18px 32px rgba(0,0,0,.9));
  }
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(255,255,255,.95), 0 0 22px rgba(96,165,250,1), 0 0 48px rgba(37,99,235,.95), 0 24px 42px rgba(0,0,0,.95); }
  50% { text-shadow: 0 0 16px rgba(255,255,255,1), 0 0 38px rgba(96,165,250,1), 0 0 70px rgba(37,99,235,1), 0 24px 42px rgba(0,0,0,.95); }
}

@keyframes orbitPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(59,130,246,.85), inset 0 0 20px rgba(59,130,246,.65); }
  50% { box-shadow: 0 0 54px rgba(59,130,246,1), inset 0 0 30px rgba(59,130,246,.9); }
}

@keyframes orbitMove {
  from { transform: rotate(0deg) translateX(56px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(56px) rotate(-360deg); }
}

@keyframes subtitleScan {
  0%, 100% { opacity: .25; transform: translateX(-40px) scaleX(.5); }
  50% { opacity: 1; transform: translateX(40px) scaleX(1); }
}

@keyframes topScan {
  0%, 100% { opacity: .40; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(90px); }
}

@keyframes pulseSoft {
  0%, 100% { opacity: .45; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.14); }
}

@keyframes sparkMove {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  20% { opacity: .85; }
  100% { transform: translateY(-170px) translateX(75px); opacity: 0; }
}

@keyframes borderGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.45); }
}

@keyframes btnGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* TABLET */
@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 40px 24px;
    gap: 28px;
  }

  .brand-area {
    width: 100%;
    display: flex;
    justify-content: center;
    align-self: center;
  }

  .brand-lockup {
    justify-content: center;
  }

  .login-card {
    width: 100%;
    max-width: 560px;
    min-height: auto;
    margin: 0 auto;
  }
}

/* CELULAR */
@media (max-width: 768px) {
  .login-body {
    min-height: 100dvh;
    background: #020617;
  }

  .bg-veil {
    background: linear-gradient(rgba(2,6,23,.35), rgba(2,6,23,.55));
  }

  .login-page {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 18px;
  }

  .brand-area {
    display: none;
  }

  .login-card {
    width: 100%;
    max-width: 420px;
    min-height: auto;
    padding: 32px 24px;
    border-radius: 32px;
    background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
      0 0 40px rgba(59,130,246,.45),
      0 0 80px rgba(37,99,235,.25),
      inset 0 1px 0 rgba(255,255,255,.4);
  }

  .login-logo-wrap {
    width: 92px;
    height: 92px;
    margin-bottom: 14px;
  }

  .login-logo {
    width: 60px;
    height: 60px;
  }

  .login-card h2 {
    font-size: 34px;
  }

  .subtitle {
    font-size: 16px;
  }

  .subtitle-light {
    width: 180px;
  }

  .row {
    margin-bottom: 18px;
  }

  .input {
    height: 58px;
    font-size: 16px;
  }

  .btn {
    height: 58px;
    font-size: 18px;
  }

  .meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .toggle-pass {
    min-width: 64px;
    height: 34px;
    font-size: 12px;
  }

  .secure-line {
    margin-top: 24px;
  }

  .fx-top,
  .fx-card,
  .spark {
    display: none;
  }
}

/* IPHONE PEQUEÑO */
@media (max-width: 480px) {
  .login-page {
    padding: 14px;
  }

  .login-card {
    padding: 26px 18px;
    border-radius: 28px;
  }

  .login-card h2 {
    font-size: 30px;
  }

  .subtitle {
    font-size: 15px;
  }

  .input {
    height: 54px;
    padding-left: 54px;
    padding-right: 60px;
  }

  .input-icon {
    left: 18px;
  }

  .btn {
    height: 56px;
    font-size: 17px;
  }

  .remember-wrap,
  .meta a {
    font-size: 14px;
  }
}
