:root {
  color-scheme: dark;
  --bg-image: url("imagenes/fondo-joker.jpeg");
  --green: #37ff69;
  --green-deep: #18d652;
  --purple: #bf33ff;
  --panel: rgba(38, 39, 47, 0.76);
  --panel-border: rgba(255, 255, 255, 0.16);
  --text: #f8f8fb;
  --muted: rgba(248, 248, 251, 0.62);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: #050507;
  color: var(--text);
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

.background,
.background::before,
.background::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background {
  z-index: -2;
  background: #050507;
}

.background::before {
  content: "";
  z-index: -2;
  background-image: var(--bg-image);
  background-position: center;
  background-size: cover;
  filter: saturate(1.08) contrast(1.04);
  opacity: 0.92;
  transform: none;
}

.is-bg-black .background::before {
  opacity: 0;
}

.background::after {
  content: "";
  z-index: -1;
  background:
    radial-gradient(circle at 50% 42%, rgba(115, 42, 150, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.16) 44%, rgba(0, 0, 0, 0.62) 100%);
}

.page-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  overflow: hidden;
}

.system-title {
  margin: 6px 0 18px;
  color: rgba(248, 248, 251, 0.46);
  text-align: center;
  font-size: 1rem;
  line-height: 1.35;
}

.access-panel {
  width: 100%;
  min-width: 0;
  align-self: center;
}

.steps {
  position: relative;
  z-index: 2;
  width: min(100%, 392px);
  min-height: 104px;
  margin: 0 auto -28px;
  display: grid;
  grid-template-columns: auto minmax(12px, 1fr) auto minmax(12px, 1fr) auto;
  align-items: center;
}

.step-badge {
  position: relative;
  z-index: 2;
  width: clamp(80px, 24vw, 94px);
  height: clamp(80px, 24vw, 94px);
  margin: 0 auto;
  border: 2px solid var(--purple);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 26%, rgba(120, 22, 165, 0.34), #050507 64%);
  box-shadow: 0 0 18px rgba(191, 51, 255, 0.72), 0 0 34px rgba(191, 51, 255, 0.32);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  text-transform: uppercase;
}

.step-badge.is-current {
  border-color: var(--green);
  background:
    radial-gradient(circle at 50% 18%, rgba(55, 255, 105, 0.28), transparent 33%),
    radial-gradient(circle at 50% 35%, rgba(120, 22, 165, 0.48), #050507 67%);
  box-shadow:
    0 0 0 4px rgba(55, 255, 105, 0.1),
    0 0 22px rgba(55, 255, 105, 0.38),
    0 0 38px rgba(191, 51, 255, 0.58);
}

.step-badge span,
.step-badge small {
  color: #e6a6ff;
  font-size: clamp(0.54rem, 1.7vw, 0.66rem);
  font-weight: 800;
  line-height: 1;
}

.step-badge.is-current span,
.step-badge.is-current small {
  color: #9dffb6;
}

.step-badge strong {
  margin-top: 4px;
  color: #d64aff;
  font-size: clamp(1.2rem, 5.5vw, 1.55rem);
  line-height: 1;
}

.step-badge.is-current strong {
  color: var(--green);
}

.step-connector {
  position: relative;
  z-index: 1;
  height: 2px;
  margin: 0 -3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(191, 51, 255, 0.88), rgba(255, 255, 255, 0.7), rgba(191, 51, 255, 0.88));
  box-shadow: 0 0 12px rgba(191, 51, 255, 0.68);
}

.step-connector::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  width: 9px;
  height: 9px;
  border-top: 2px solid rgba(255, 255, 255, 0.88);
  border-right: 2px solid rgba(255, 255, 255, 0.88);
  transform: translateY(-50%) rotate(45deg);
  filter: drop-shadow(0 0 6px rgba(191, 51, 255, 0.9));
}

.panel-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 64px 20px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.07), transparent 38%),
    var(--panel);
  box-shadow:
    0 0 0 1px rgba(191, 51, 255, 0.2),
    -12px 0 46px rgba(191, 51, 255, 0.34),
    0 22px 64px rgba(191, 51, 255, 0.38),
    0 26px 74px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.panel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(191, 51, 255, 0.18), transparent 34%, rgba(255, 255, 255, 0.05));
  opacity: 0.82;
  pointer-events: none;
}

.brand,
.verified,
.panel-card h1,
.access-form,
.secure-line,
.account-link {
  position: relative;
  z-index: 1;
}

.brand {
  margin: 0;
  text-align: center;
  font-size: clamp(2.2rem, 11vw, 3rem);
  font-weight: 900;
  line-height: 1;
}

.verified {
  margin: 24px 0 18px;
  color: var(--green);
  text-align: center;
  font-size: clamp(0.95rem, 4.2vw, 1.05rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 22px;
  text-align: center;
  font-size: clamp(2rem, 9vw, 2.45rem);
  line-height: 1.05;
  text-wrap: balance;
}

.access-form {
  display: grid;
  gap: 14px;
}

.cta-button {
  width: 100%;
  max-width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  color: #06110a;
  cursor: pointer;
  font-size: clamp(1rem, 5.2vw, 1.28rem);
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(55, 255, 105, 0.24);
  white-space: normal;
  animation: ctaPulse 1.9s ease-in-out infinite;
  will-change: transform, box-shadow;
}

.cta-button:active {
  transform: scale(0.985);
  animation-play-state: paused;
}

@keyframes ctaPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 30px rgba(55, 255, 105, 0.24);
  }

  50% {
    transform: scale(1.035);
    box-shadow: 0 16px 42px rgba(55, 255, 105, 0.36);
  }
}

.secure-line {
  margin: 18px 0 26px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.secure-line span {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 10px;
  margin-right: 9px;
  border: 2px solid currentColor;
  border-radius: 2px;
  vertical-align: -1px;
}

.secure-line span::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -9px;
  width: 6px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.account-link {
  display: block;
  width: max-content;
  max-width: 100%;
  padding: 8px 4px;
  margin: 0 auto;
  color: rgba(248, 248, 251, 0.7);
  font-size: 1rem;
  text-align: center;
  text-underline-offset: 3px;
}

.footer {
  width: 100%;
  margin-top: 22px;
  color: rgba(248, 248, 251, 0.42);
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.footer p {
  margin: 4px 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.footer button {
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(74svh, 640px);
  padding: 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(22, 22, 28, 0.96);
  box-shadow: 0 0 42px rgba(191, 51, 255, 0.34);
  overflow: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal h2 {
  margin: 0 38px 14px 0;
  font-size: 1.4rem;
}

.modal-content p {
  margin: 0 0 12px;
  color: rgba(248, 248, 251, 0.76);
  font-size: 0.98rem;
  line-height: 1.55;
}

.modal-content strong {
  color: var(--text);
}

.chat-shell[hidden] {
  display: none;
}

.chat-shell {
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 2147483647;
  width: min(380px, calc(100vw - 28px));
  height: min(660px, calc(100svh - 32px));
}

.chat-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 28px rgba(191, 51, 255, 0.22);
  display: block;
}

.chat-close {
  position: absolute;
  top: -12px;
  right: -8px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(8, 8, 12, 0.92);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.45);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cta-button {
    animation: none;
  }
}

@media (max-width: 380px) {
  .page-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .steps {
    min-height: 96px;
    margin-bottom: -25px;
  }

  .panel-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .secure-line {
    font-size: 0.9rem;
  }
}

@media (max-width: 520px) {
  .chat-shell {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: min(620px, calc(100svh - 16px));
  }

  .chat-frame {
    border-radius: 14px;
  }

  .chat-close {
    top: 8px;
    right: 8px;
  }
}

@media (min-width: 720px) {
  .page-shell {
    max-width: 640px;
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .panel-card {
    padding: 68px 40px 34px;
  }
}
