/* ==========================================================================
   SIGMA · Login (referencia visual para el portal)
   Requiere: tokens/sigma-brand.css (y splash/sigma-splash.css en la versión dinámica)
   Layout: dos columnas en escritorio. A la izquierda la marca grande y qué es
   Sigma; a la derecha la tarjeta de ingreso, que es el punto donde converge
   el flujo del fondo. En pantallas angostas, marca arriba y tarjeta abajo.
   ========================================================================== */
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { background: var(--sigma-night); color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--sigma-font);
  color: var(--sigma-star);
  background: var(--sigma-scene);
  background-color: var(--sigma-night);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

.page {
  position: relative;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-inline: clamp(16px, 4.5vw, 64px);
  padding-block: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-bottom));
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.secure { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--sigma-mist); }
.secure svg { width: 14px; height: 14px; display: block; }

.stage {
  width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: center;
  gap: clamp(32px, 6vw, 112px);
  padding-block: 24px;
}

/* ---------- Marca ---------- */
.hero { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.lockup { display: flex; align-items: center; gap: clamp(16px, 2vw, 24px); }
.lockup [data-sigma-logo] { width: clamp(64px, 7vw, 88px); height: auto; aspect-ratio: 1; display: block; flex: none; filter: drop-shadow(0 18px 36px rgba(1, 6, 14, .55)); }
.lockup .names { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lockup [data-sigma-word] { width: clamp(190px, 25vw, 330px); height: auto; display: block; }
.lockup [data-sigma-tagline] {
  margin: 0; font-family: var(--sigma-font-display); font-weight: 460; line-height: 1.2;
  font-size: clamp(17px, 1.9vw, 23px); letter-spacing: .005em; color: var(--sigma-frost); white-space: nowrap;
}
.pitch { margin: 0; max-width: 46ch; font-size: 16px; line-height: 1.6; color: var(--sigma-mist); text-wrap: pretty; }
.pitch b { color: var(--sigma-star); font-weight: 600; }

/* Recorrido de un proveedor: proceso real, por eso es una secuencia */
.journey-wrap { position: relative; max-width: 560px; }
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.journey::before {
  content: ""; position: absolute; left: 7px; right: calc(25% - 7px); top: 7px; height: 1px;
  background: linear-gradient(90deg, rgba(124, 192, 255, .5), rgba(232, 73, 44, .55));
}
.journey li { position: relative; display: flex; flex-direction: column; gap: 10px; padding-right: 10px; font-size: 13px; line-height: 1.35; color: var(--sigma-mist); }
.journey li::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%; position: relative; z-index: 1;
  background: var(--sigma-night); border: 1.5px solid var(--sigma-ice); box-shadow: 0 0 0 4px rgba(6, 20, 39, .9);
}
.journey li:last-child::before { border-color: var(--sigma-node); background: radial-gradient(circle at 38% 34%, var(--sigma-node-hi), var(--sigma-node) 55%, var(--sigma-node-deep)); }
.journey b { display: block; color: var(--sigma-star); font-weight: 600; font-size: 13.5px; }
.journey-wrap .spark {
  position: absolute; top: 3px; left: 3px; width: 9px; height: 9px; border-radius: 50%; z-index: 2;
  background: #fff; box-shadow: 0 0 12px 3px rgba(124, 192, 255, .9);
  offset-path: none; animation: journey 5.2s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes journey {
  0% { transform: translateX(0); opacity: 0; }
  6% { opacity: 1; }
  80% { transform: translateX(var(--run, 400px)); opacity: 1; background: #FFD2C2; box-shadow: 0 0 14px 4px rgba(232, 73, 44, .9); }
  92%, 100% { transform: translateX(var(--run, 400px)); opacity: 0; }
}

/* ---------- Tarjeta ---------- */
.card {
  position: relative;
  width: 100%;
  padding: 32px 30px 26px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--sigma-glass-hi), var(--sigma-glass));
  border: 1px solid var(--sigma-hairline);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 40px 120px -30px rgba(1, 6, 14, .8), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--sweep), transparent 0deg, transparent 250deg, rgba(124, 192, 255, 0) 268deg, rgba(178, 220, 255, .95) 316deg, rgba(232, 73, 44, .75) 336deg, transparent 352deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
}
.card.is-in::before { animation: sweep-in 2.2s var(--sigma-ease-inout) 1 both, sweep-idle 10s linear 2.6s infinite; }
.card.is-pulse::before { animation: sweep-in 1.6s var(--sigma-ease-inout) 1 both, sweep-idle 10s linear 1.8s infinite; }
@keyframes sweep-in { 0% { --sweep: -40deg; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { --sweep: 320deg; opacity: 0; } }
@keyframes sweep-idle { 0% { --sweep: 0deg; opacity: .4; } 100% { --sweep: 360deg; opacity: .4; } }

.card h2 { margin: 0; font-family: var(--sigma-font-display); font-weight: 560; font-size: 26px; line-height: 1.15; letter-spacing: -.005em; }
.card .sub { margin: 8px 0 22px; color: var(--sigma-mist); font-size: 14.5px; line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--sigma-mist); }
.input {
  width: 100%; height: 46px; padding: 0 14px;
  border-radius: 11px; border: 1px solid rgba(150, 196, 240, .2);
  background: rgba(2, 10, 21, .5); color: var(--sigma-star);
  font: 400 15px var(--sigma-font); outline: none;
  transition: border-color 200ms, box-shadow 260ms, background 200ms;
}
.input::placeholder { color: rgba(147, 169, 194, .62); }
.input:hover { border-color: rgba(150, 196, 240, .36); }
.input:focus { border-color: var(--sigma-ice); background: rgba(2, 10, 21, .72); box-shadow: 0 0 0 3px rgba(124, 192, 255, .2), 0 0 24px -4px rgba(124, 192, 255, .45); }
.input[aria-invalid="true"] { border-color: #FF9B7A; }
.pw { position: relative; }
.pw .input { padding-right: 84px; }
.peek { position: absolute; right: 6px; top: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--sigma-mist); font: 500 13px var(--sigma-font); cursor: pointer; }
.peek:hover { color: var(--sigma-star); background: rgba(150, 196, 240, .08); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 20px; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--sigma-mist); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--sigma-ice); margin: 0; }
.row a { color: var(--sigma-ice); text-decoration: none; }
.row a:hover { text-decoration: underline; text-underline-offset: 3px; }

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  width: 100%; height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 12px; cursor: pointer;
  color: var(--sigma-blue-ink); font: 600 15px var(--sigma-font);
  background: linear-gradient(180deg, var(--sigma-blue-hi) 0%, var(--sigma-blue) 55%, var(--sigma-blue-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 12px 30px -12px rgba(23, 102, 185, .95);
  transition: transform 120ms var(--sigma-ease-out), box-shadow 220ms, filter 220ms;
}
.btn::after {
  content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn:hover { filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 14px 36px -12px rgba(42, 125, 211, 1); }
.btn:hover::after { animation: btn-sheen 900ms var(--sigma-ease-out); }
@keyframes btn-sheen { to { transform: translateX(120%); } }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[aria-busy="true"] { pointer-events: none; }
.btn .ld { width: 26px; height: 26px; display: none; color: #fff; }
.btn .ld svg { width: 100%; height: 100%; display: block; }
.btn[aria-busy="true"] .ld { display: block; }

:focus-visible { outline: 2px solid var(--sigma-focus); outline-offset: 3px; border-radius: 8px; }
.input:focus-visible { outline: none; }

.msg { min-height: 20px; margin: 14px 0 0; font-size: 13.5px; color: var(--sigma-mist); text-align: center; }
.msg.err { color: var(--sigma-node-text); }
.legal { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(150, 196, 240, .12); font-size: 12px; line-height: 1.5; color: var(--sigma-mist); text-align: center; }
.sigma-login-legacy { display: flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; max-width: 100%; min-height: 40px; margin: 5px auto -5px; padding: 5px 6px; color: var(--sigma-mist); font-size: 12.5px; font-weight: 500; line-height: 1.5; text-decoration: none; transition: color 160ms; }
.sigma-login-legacy svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sigma-login-legacy:hover, .sigma-login-legacy:focus-visible { color: var(--sigma-ice); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pie con la firma de Sur Compliance ---------- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 12px; color: var(--sigma-mist); }
.credit { display: inline-flex; align-items: center; gap: 10px; line-height: 20px; white-space: nowrap; opacity: .92; }
.credit img { height: 20px; width: auto; display: block; }
.foot small { font-size: 12px; }

/* Botón de la demo para repetir la escena */
.replay {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(150, 196, 240, .22);
  background: rgba(6, 20, 39, .5); color: var(--sigma-mist); font: 500 13px var(--sigma-font); cursor: pointer;
}
.replay:hover { color: var(--sigma-star); border-color: rgba(150, 196, 240, .45); }

@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 28px; padding-block: 12px 20px; }
  .hero { align-items: center; text-align: center; gap: 16px; }
  .lockup { gap: 14px; }
  .lockup [data-sigma-logo] { width: 56px; }
  .lockup [data-sigma-word] { width: 170px; }
  .lockup [data-sigma-tagline] { font-size: 16px; }
  .pitch { font-size: 14.5px; }
  .journey-wrap { display: none; }
  .card { max-width: 440px; }
  .foot { justify-content: center; text-align: center; }
}
@media (max-width: 480px) {
  .card { padding: 26px 20px 22px; border-radius: 18px; }
  .sigma-login-legacy { min-height: 44px; }
  .lockup { flex-direction: row; text-align: left; }
  .pitch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card.is-in::before, .card.is-pulse::before { animation: none; }
  .btn:hover::after { animation: none; }
  .journey-wrap .spark { animation: none; opacity: 0; }
}
