/* =========================================================
   ITELSA — Lobby central de accesos
   HTML + CSS separado
   ========================================================= */

:root {
  --navy-950: #04162d;
  --navy-900: #071d3b;
  --navy-800: #0a2d57;
  --blue: #1f7cff;
  --cyan: #14bdd0;
  --teal: #16a8a4;
  --orange: #ff8a1f;
  --red: #ff5050;
  --green: #47c983;
  --indigo: #3447a4;

  --ink: #081c36;
  --muted: #54708c;
  --line: rgba(27, 86, 138, .18);
  --panel: rgba(255,255,255,.82);
  --shadow: 0 16px 50px rgba(8, 34, 68, .10);
}

* {
  box-sizing: border-box;
}

/* Desktop por defecto: sin scroll, todo entra en la pantalla */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 48% 45%, rgba(84, 188, 255, .10), transparent 26rem),
    linear-gradient(180deg, #f8fbff 0%, #f2f7fc 100%);
}

a {
  color: inherit;
}

.page-shell {
  height: 100vh;
  overflow: hidden;
}

/* ---------- HEADER ---------- */

.lobby-logo {
  position: absolute;
  top: 14px;
  left: 24px;
  width: clamp(150px, 15vw, 220px);
  height: auto;
  object-fit: contain;
  z-index: 20;
}

/* ---------- MAIN ---------- */

.lobby {
  height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px 20px;
  isolation: isolate;
  overflow: hidden;
}

.lobby::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -6;
  background:
    radial-gradient(circle at 50% 50%, rgba(65, 168, 228, .09), transparent 32%),
    radial-gradient(circle at 50% 76%, rgba(36, 184, 208, .06), transparent 21%);
}

.ambient-logo {
  position: absolute;
  left: -40px;
  top: 45%;
  width: 530px;
  height: 530px;
  transform: translateY(-50%);
  background: url("itelsa-icon.png") center / contain no-repeat;
  opacity: .035;
  filter: grayscale(1);
  z-index: -5;
}

.ambient-wordmark {
  position: absolute;
  right: -36px;
  top: 41%;
  transform: translateY(-50%);
  font-size: clamp(130px, 17vw, 320px);
  font-weight: 800;
  letter-spacing: .05em;
  color: #0a3157;
  opacity: .025;
  pointer-events: none;
  z-index: -5;
}

/* ---------- RADIAL ACCESS MAP ---------- */

.access-map {
  --map-w: min(980px, 86vw);
  --map-h: min(690px, calc(100vh - 160px));

  position: relative;
  width: var(--map-w);
  height: max(580px, var(--map-h));
  margin: auto;
  margin-top: 10px;
}

.orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 530px;
  height: 530px;
  transform: translate(-50%, -48%);
  border: 1.5px dashed rgba(53, 100, 154, .28);
  border-radius: 50%;
  animation: orbitSpin 50s linear infinite;
}

@keyframes orbitSpin {
  from { transform: translate(-50%, -48%) rotate(0deg); }
  to   { transform: translate(-50%, -48%) rotate(360deg); }
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(20, 189, 208, .6);
}

.orbit::before {
  top: 22%;
  left: 4.6%;
}

.orbit::after {
  bottom: 15%;
  right: 7%;
}

/* ---------- PORTALS ---------- */

.portal {
  --accent: var(--blue);

  position: absolute;
  width: 154px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  z-index: 10;
  transition:
    transform .25s ease,
    filter .25s ease;
}

.portal::after {
  content: "";
  position: absolute;
  top: 57px;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  filter: blur(13px);
  transition: width .25s ease, height .25s ease;
  z-index: -1;
}

.portal:hover {
  transform: translateY(-7px) scale(1.035);
  filter: saturate(1.12);
}

.portal:hover::after {
  width: 130px;
  height: 36px;
}

.portal-ring {
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 25%, #fff)) border-box;
  border: 2px solid transparent;
  box-shadow:
    0 13px 30px rgba(6, 31, 63, .11),
    0 0 0 5px rgba(255,255,255,.65),
    0 0 28px color-mix(in srgb, var(--accent) 15%, transparent);
  overflow: hidden;
}

.portal-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  border: 1px solid rgba(9, 47, 85, .06);
}

.portal-ring img {
  width: 91px;
  max-height: 67px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.portal-name {
  text-align: center;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -.02em;
  color: #0a203c;
  text-shadow: 0 1px 0 white;
}

.portal--smart {
  --accent: #368dff;
  left: 22%;
  top: 4%;
}

.portal--sas {
  --accent: #14a7b2;
  right: 22%;
  top: 4%;
}

.portal--payflow {
  --accent: #7b3fe4;
  right: -12%;
  top: 20%;
}

.portal--xubio {
  --accent: #e0389b;
  left: -12%;
  top: 20%;
}

.portal-connector--xubio {
  width: 150px;
  left: 10%;
  top: 17%;
  transform: rotate(-28deg);
  transform-origin: right center;
}

.portal-connector {
  position: absolute;
  height: 2px;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(27, 86, 138, .45) 0 6px,
    transparent 6px 12px
  );
  background-size: 12px 100%;
  z-index: 1;
  pointer-events: none;
  animation: connectorFlow 0.8s linear infinite;
}

@keyframes connectorFlow {
  from { background-position: 0 0; }
  to   { background-position: 12px 0; }
}

.portal-connector--payflow {
  width: 150px;
  right: 10%;
  top: 17%;
  transform: rotate(28deg);
  transform-origin: left center;
}

.portal--matriz {
  --accent: #ff941d;
  left: 10%;
  top: 41%;
}

.portal--relevamiento {
  --accent: #ff5c5c;
  right: 10%;
  top: 41%;
}

.portal--engineering {
  --accent: #42c57b;
  left: 18%;
  bottom: 1%;
}

.portal--despachos {
  --accent: #34489d;
  right: 18%;
  bottom: 1%;
}

/* ---------- CENTRAL HUB ---------- */

.hub {
  position: absolute;
  left: 50%;
  top: 51%;
  transform: translate(-50%, -50%);
  width: 390px;
  text-align: center;
  z-index: 4;
}

.hub-kicker {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .045em;
  color: #117798;
}

.hub-subtitle {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  color: #508aa4;
}

.hub-stage {
  position: relative;
  height: 315px;
  margin-top: 6px;
}

.hub-halo {
  position: absolute;
  left: 50%;
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.hub-halo--1 {
  top: 12px;
  width: 165px;
  height: 32px;
  border: 1px solid rgba(22, 184, 208, .28);
  box-shadow: 0 0 25px rgba(23, 188, 213, .14);
}

.hub-halo--2 {
  top: 23px;
  width: 108px;
  height: 17px;
  border: 1px solid rgba(33, 126, 255, .23);
}

.hub-core {
  position: absolute;
  left: 50%;
  top: 45px;
  transform: translateX(-50%);
  width: 154px;
  height: 154px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background:
    radial-gradient(circle at 40% 34%, rgba(255,255,255,.98), rgba(219,247,252,.88) 42%, rgba(153,222,237,.52) 100%);
  border: 1px solid rgba(27, 168, 198, .34);
  box-shadow:
    0 0 0 10px rgba(239, 253, 255, .45),
    0 0 45px rgba(25, 184, 214, .28),
    inset 0 0 28px rgba(255,255,255,.98);
  animation: hubFloat 4.2s ease-in-out infinite;
  z-index: 3;
}

.hub-ping {
  position: absolute;
  left: 50%;
  top: 45px;
  width: 154px;
  height: 154px;
  transform: translate(-50%, 0) scale(1);
  border-radius: 50%;
  border: 1.5px solid rgba(30, 180, 214, .55);
  z-index: 2;
  pointer-events: none;
  animation: hubPing 3.6s ease-out infinite;
}

.hub-ping--2 {
  animation-delay: 1.2s;
}

.hub-ping--3 {
  animation-delay: 2.4s;
}

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

.hub-core::before {
  content: "";
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 1px solid rgba(49, 176, 220, .14);
}

.hub-core img {
  width: 74px;
  height: 68px;
  object-fit: contain;
}

.hub-core span {
  color: #08213f;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: .19em;
  padding-left: .19em;
}

.hub-panel {
  position: absolute;
  width: 94px;
  height: 54px;
  border: 1px solid rgba(32, 175, 214, .42);
  background:
    linear-gradient(135deg, rgba(255,255,255,.75), rgba(224,247,252,.55));
  border-radius: 8px;
  box-shadow:
    0 9px 23px rgba(15, 86, 120, .05),
    inset 0 1px 0 rgba(255,255,255,.8);
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  padding: 9px 10px;
  transform-style: preserve-3d;
}

.hub-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 1px;
  top: 50%;
  background: rgba(19, 187, 211, .46);
}

.hub-panel .panel-icon {
  grid-row: 1 / 3;
  font-size: 21px;
  color: #1883a5;
}

.hub-panel i {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 117, 153, .58), rgba(31, 117, 153, .13));
}

.hub-panel i:nth-of-type(2) {
  width: 70%;
}

.hub-panel--tl {
  left: 22px;
  top: 34px;
  transform: perspective(320px) rotateY(12deg) rotate(-3deg);
}

.hub-panel--tl::after,
.hub-panel--ml::after,
.hub-panel--bl::after {
  right: -15px;
}

.hub-panel--tr {
  right: 22px;
  top: 34px;
  transform: perspective(320px) rotateY(-12deg) rotate(3deg);
}

.hub-panel--tr::after,
.hub-panel--mr::after,
.hub-panel--br::after {
  left: -15px;
}

.hub-panel--ml {
  left: 10px;
  top: 102px;
  transform: perspective(320px) rotateY(12deg);
}

.hub-panel--mr {
  right: 10px;
  top: 102px;
  transform: perspective(320px) rotateY(-12deg);
}

.hub-panel--bl {
  left: 22px;
  top: 170px;
  transform: perspective(320px) rotateY(12deg) rotate(3deg);
}

.hub-panel--br {
  right: 22px;
  top: 170px;
  transform: perspective(320px) rotateY(-12deg) rotate(-3deg);
}

.hub-base {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 245px;
  height: 64px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(48, 217, 239, .48) 0 8%, transparent 9%),
    radial-gradient(ellipse at center, transparent 0 33%, rgba(36, 188, 224, .40) 34% 36%, transparent 37%),
    linear-gradient(180deg, #eaf7fb, #9fb9d1 42%, #607b99 46%, #d3edf7 76%, #7f9ab6 80%);
  box-shadow:
    0 24px 35px rgba(13, 60, 101, .20),
    0 0 35px rgba(36, 201, 231, .21);
}

.hub-base::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 11px;
  width: 176px;
  height: 35px;
  transform: translateX(-50%);
  border: 1px solid rgba(41, 222, 235, .72);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(33, 211, 233, .46);
}

.hub-base span {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 2px;
  height: 47px;
  transform: translateX(-50%);
  background: linear-gradient(transparent, rgba(56, 223, 240, .85));
  box-shadow: 0 0 16px rgba(38, 221, 239, .85);
}

.hub-copy {
  margin: -2px 0 0;
  font-size: 12px;
  color: #3f7390;
  font-weight: 600;
  letter-spacing: .015em;
}

@keyframes hubFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* ---------- ACCESSIBILITY ---------- */

.portal:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(31, 124, 255, .35);
  outline-offset: 7px;
  border-radius: 18px;
}

/* ---------- RESPONSIVE ---------- */
/* A partir de 900px de ancho (tablet e menores): se habilita scroll normal */

@media (max-width: 900px) {
  html,
  body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .page-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .lobby {
    height: auto;
    min-height: 100vh;
    padding-top: 70px;
    overflow: visible;
  }

  .lobby-logo {
    width: 160px;
    top: 14px;
    left: 18px;
  }

  .ambient-wordmark {
    display: none;
  }

  .ambient-logo {
    opacity: .025;
  }

  .access-map {
    width: min(700px, 96vw);
    height: 760px;
  }

  .orbit {
    width: 470px;
    height: 470px;
  }

  .portal--smart { left: 8%; top: 4%; }
  .portal--sas { right: 8%; top: 4%; }
  .portal--payflow { right: -14%; top: 20%; }
  .portal-connector--payflow { display: none; }
  .portal--xubio { left: -14%; top: 20%; }
  .portal-connector--xubio { display: none; }
  .portal--matriz { left: 1%; top: 41%; }
  .portal--relevamiento { right: 1%; top: 41%; }
  .portal--engineering { left: 7%; bottom: 2%; }
  .portal--despachos { right: 7%; bottom: 2%; }
}

/* Celular: layout apilado en grilla, con scroll */

@media (max-width: 680px) {
  .lobby-logo {
    width: 150px;
    top: 12px;
    left: 16px;
  }

  .lobby {
    min-height: 100vh;
    display: block;
    padding: 70px 16px 44px;
  }

  .access-map {
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 10px;
  }

  .orbit {
    display: none;
  }

  .hub {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    margin-bottom: 6px;
  }

  .hub-stage {
    transform: scale(.88);
    transform-origin: center top;
    height: 290px;
    margin-bottom: -34px;
  }

  .portal {
    position: relative;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto;
  }

  .portal-ring {
    width: 104px;
    height: 104px;
  }

  .portal-ring img {
    width: 80px;
  }

  .portal--smart { grid-column: 1; grid-row: 2; }
  .portal--sas { grid-column: 2; grid-row: 2; }
  .portal--payflow { grid-column: 1 / -1; grid-row: 3; justify-self: center; }
  .portal--xubio { grid-column: 1 / -1; grid-row: 4; justify-self: center; }
  .portal--matriz { grid-column: 1; grid-row: 5; }
  .portal--relevamiento { grid-column: 2; grid-row: 5; }
  .portal--engineering { grid-column: 1; grid-row: 6; }
  .portal--despachos { grid-column: 2; grid-row: 6; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}