/* =====================================================================
   PANTALLA DE INGRESO — estilos ÚNICOS para todos los bots
   (los usa app/vista_ingreso.php; también bot.solisel.com).

   Dos mitades: panel de la marca (oscuro, con movimiento) + tarjeta
   clara con el formulario. Se ajusta al ancho Y al alto de la pantalla.
   Colores: variables de :root de cada empresa (--noche, --lente, --iris…).
   Dibujo opcional al pie del panel: --ingreso-escena: url("…svg");
   ===================================================================== */
@property --angulo { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.pagina-ingreso { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--fondo); overflow-x: hidden; }

.ing {
  display: grid; grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
  min-height: 100vh; min-height: 100dvh;
}

/* ------------------------------------------------------------------
   Panel de la marca
   ------------------------------------------------------------------ */
.ing-marca {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: clamp(1rem, 3vh, 2rem);
  padding: clamp(24px, 5vh, 56px) clamp(24px, 4.5vw, 64px);
  color: #fff;
  background:
    radial-gradient(70% 60% at 80% 35%, color-mix(in srgb, var(--lente) 22%, transparent), transparent 70%),
    radial-gradient(60% 50% at 15% 100%, color-mix(in srgb, var(--iris) 30%, transparent), transparent 70%),
    linear-gradient(160deg, var(--noche) 0%, var(--noche-2) 100%);
}
.ing-marca > *:not(.ing-deco) { position: relative; z-index: 1; }

/* Decoración animada */
.ing-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ing-rejilla {
  position: absolute; inset: -60px;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 45%, #000 30%, transparent 85%);
  animation: ing-rejilla 18s linear infinite;
}
@keyframes ing-rejilla { to { transform: translate(44px, 44px); } }

/* Anillos y orbe: centrados a la derecha del panel */
.ing-anillo, .ing-barrido, .ing-orbe { position: absolute; left: 78%; top: 50%; translate: -50% -50%; border-radius: 50%; }
.ing-anillo { border: 1px solid rgba(255, 255, 255, .12); }
.ing-anillo.a1 { width: clamp(180px, 22vw, 300px); aspect-ratio: 1; }
.ing-anillo.a2 { width: clamp(300px, 36vw, 500px); aspect-ratio: 1; border-style: dashed; border-color: rgba(255, 255, 255, .1); animation: ing-girar 60s linear infinite; }
.ing-anillo.a3 {
  width: clamp(420px, 50vw, 700px); aspect-ratio: 1; border: 0;
  background: conic-gradient(from 200deg, transparent 0 70%, color-mix(in srgb, var(--lente) 45%, transparent) 78%, transparent 86%);
  mask: radial-gradient(circle, transparent calc(50% - 2px), #000 calc(50% - 1px), #000 50%, transparent 50.5%);
  animation: ing-girar 14s linear infinite;
}
.ing-barrido {   /* haz de radar suave */
  width: clamp(300px, 36vw, 500px); aspect-ratio: 1;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--lente) 22%, transparent), transparent 22%);
  mask: radial-gradient(circle, #000 0 49%, transparent 50%);
  animation: ing-girar 9s linear infinite;
}
@keyframes ing-girar { to { rotate: 360deg; } }
.ing-orbe {
  width: clamp(90px, 9vw, 130px); aspect-ratio: 1;
  --orbe-color: color-mix(in srgb, var(--iris) 65%, var(--lente));
  background: radial-gradient(circle at 32% 28%, #fff 0 4%, color-mix(in srgb, var(--orbe-color) 75%, #fff) 10%, var(--orbe-color) 38%, color-mix(in srgb, var(--orbe-color) 40%, var(--noche)) 78%);
  box-shadow: 0 0 60px color-mix(in srgb, var(--orbe-color) 55%, transparent), inset -14px -18px 30px rgba(0, 0, 0, .35);
  transform: translate(var(--orbe-x, 0), var(--orbe-y, 0));
  transition: transform 1s cubic-bezier(.2, .8, .2, 1);
  animation: ing-flotar 6s ease-in-out infinite;
}
@keyframes ing-flotar { 0%, 100% { margin-top: -8px; } 50% { margin-top: 8px; } }
.ing-orbe-brillo {
  position: absolute; inset: -30%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--iris) 30%, color-mix(in srgb, var(--lente) 20%, transparent)), transparent 65%);
  animation: ing-respirar 4s ease-in-out infinite;
}
@keyframes ing-respirar { 0%, 100% { opacity: .5; scale: .9; } 50% { opacity: 1; scale: 1.1; } }
.ing-chispa { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--lente); animation: ing-chispa 5s ease-in-out infinite; }
.ing-chispa.c1 { left: 64%; top: 22%; }
.ing-chispa.c2 { left: 90%; top: 64%; animation-delay: 1.7s; }
.ing-chispa.c3 { left: 72%; top: 78%; animation-delay: 3.3s; }
@keyframes ing-chispa { 0%, 100% { opacity: 0; translate: 0 0; } 40% { opacity: 1; } 80% { opacity: 0; translate: 0 -24px; } }
.ing-escena {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  background: var(--ingreso-escena, none) left bottom / auto 100% no-repeat;
  opacity: .35;
}

/* Contenido del panel */
.ing-marca-arriba { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ing-logo img { display: block; width: auto; height: auto; max-width: min(230px, 55vw); max-height: clamp(40px, 9vh, 72px); }
.ing-en-linea {
  margin: 0; display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px);
}
.ing-punto { width: 8px; height: 8px; border-radius: 50%; background: #3BD671; animation: ing-latido 2s infinite; }
@keyframes ing-latido { 0% { box-shadow: 0 0 0 0 rgba(59, 214, 113, .7); } 70%, 100% { box-shadow: 0 0 0 9px rgba(59, 214, 113, 0); } }
.ing-marca-centro { max-width: 30rem; }
.ing-etiqueta { margin: 0 0 .8rem; color: var(--lente); font-weight: 700; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; }
.ing-titular { margin: 0 0 1rem; color: #fff; font: 800 clamp(1.7rem, 1rem + 2.4vw, 2.9rem) / 1.12 var(--fuente-titulos); }
.ing-titular span {
  background: linear-gradient(90deg, var(--lente), var(--iris), var(--lente));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: ing-degradado 6s linear infinite;
}
@keyframes ing-degradado { to { background-position: 200% center; } }
.ing-subtitulo { margin: 0 0 1.6rem; max-width: 26rem; color: rgba(255, 255, 255, .85); font-size: clamp(.98rem, .9rem + .3vw, 1.12rem); line-height: 1.5; }
.ing-beneficios { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.ing-beneficios li { display: flex; align-items: center; gap: .9rem; color: rgba(255, 255, 255, .92); font-size: .98rem; }
.ing-icono {
  flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(255, 255, 255, .06); border: 1px solid color-mix(in srgb, var(--lente) 45%, transparent);
  transition: background .3s, scale .3s;
}
.ing-beneficios li:hover .ing-icono { background: color-mix(in srgb, var(--lente) 20%, transparent); scale: 1.06; }
.ing-icono svg { width: 19px; height: 19px; fill: none; stroke: var(--lente); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ing-lema { margin: 0; color: rgba(255, 255, 255, .7); font-size: .8rem; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; }

/* ------------------------------------------------------------------
   Lado del formulario
   ------------------------------------------------------------------ */
.ing-lado {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  padding: clamp(20px, 4vh, 48px) clamp(16px, 4vw, 56px);
  background:
    radial-gradient(60% 40% at 50% 0%, color-mix(in srgb, var(--lente) 7%, transparent), transparent 70%),
    var(--fondo);
}
.ing-tarjeta {
  position: relative; width: min(100%, 400px);
  padding: clamp(20px, 3.5vh, 30px) clamp(20px, 2.5vw, 30px);
  border-radius: 18px; background: var(--superficie);
  box-shadow: 0 24px 50px -24px rgba(0, 12, 36, .35), 0 4px 14px rgba(0, 12, 36, .06);
}
.ing-tarjeta::before {   /* borde con degradado que gira */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--angulo), var(--lente), var(--iris), var(--lente));
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  animation: ing-borde 6s linear infinite;
}
@keyframes ing-borde { to { --angulo: 360deg; } }
.ing-saludo { margin: 0 0 .15rem; color: var(--lente-texto); font-weight: 700; font-size: .85rem; }
.ing-tarjeta h1 { margin: 0; font-size: clamp(1.25rem, 1.1rem + .5vw, 1.45rem); }
.ing-ayuda-texto { margin: .2rem 0 1.1rem; color: var(--texto-suave); font-size: .9rem; }

.ing-etiqueta-campo { display: block; margin: 0 0 .35rem; font-size: .9rem; font-weight: 600; color: var(--texto); }
.ing-campo { position: relative; margin-bottom: .85rem; }
.ing-campo input {
  width: 100%; height: clamp(42px, 5.6vh, 46px); padding: 0 .9rem;
  font: inherit; font-size: .98rem; color: var(--texto);
  background: var(--fondo); border: 1px solid var(--borde); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.ing-campo input::placeholder { color: color-mix(in srgb, var(--texto-suave) 75%, transparent); }
.ing-campo input:hover { border-color: color-mix(in srgb, var(--lente) 45%, var(--borde)); }
.ing-campo input:focus {
  outline: none; background: var(--superficie); border-color: var(--lente);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lente) 22%, transparent);
}
.ing-campo-clave input { padding-right: 48px; }
.ing-ojo {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%;
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
}
.ing-ojo:hover { background: color-mix(in srgb, var(--lente) 12%, transparent); }
.ing-ojo svg { width: 20px; height: 20px; fill: none; stroke: var(--texto-suave); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ing-ojo.visible svg { stroke: var(--lente-texto); }
.ing-ojo.visible svg path { stroke-dasharray: 2 3; }
.ing-mayus { margin: -.5rem 0 .6rem; font-size: .82rem; font-weight: 600; color: var(--lente-texto); }

.ing-olvido { margin: -.45rem 0 .7rem; text-align: right; }
.ing-olvido summary { display: inline-block; cursor: pointer; list-style: none; font-size: .88rem; color: var(--texto); text-decoration: underline; text-underline-offset: 3px; }
.ing-olvido summary::-webkit-details-marker { display: none; }
.ing-olvido summary:hover { color: var(--lente-texto); }
.ing-olvido p {
  margin: .5rem 0 0; padding: .7rem .85rem; border-radius: 10px; text-align: left; font-size: .87rem;
  background: var(--lente-suave); animation: ing-subir .35s ease backwards;
}

.ing-opciones { display: grid; gap: .55rem; margin: 0 0 1rem; }
.ing-casilla { display: flex; align-items: center; gap: .65rem; cursor: pointer; font-size: .92rem; user-select: none; }
.ing-casilla small { color: var(--texto-suave); }
.ing-casilla input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ing-caja {
  position: relative; flex-shrink: 0; width: 20px; height: 20px; border-radius: 5px;
  border: 1.5px solid var(--borde); background: var(--superficie); transition: background .2s, border-color .2s;
}
.ing-caja::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; rotate: 45deg; scale: 0; transition: scale .2s cubic-bezier(.3, 1.6, .5, 1);
}
.ing-casilla input:checked + .ing-caja { background: var(--noche); border-color: var(--noche); }
.ing-casilla input:checked + .ing-caja::after { scale: 1; }
.ing-casilla input:focus-visible + .ing-caja { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lente) 35%, transparent); }

.ing-boton {
  position: relative; overflow: hidden; width: 100%; min-height: clamp(42px, 5.6vh, 46px);
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  border: 0; border-radius: 10px; cursor: pointer;
  font: 700 .98rem var(--fuente-texto); color: #fff; background: var(--noche);
  transition: background .3s, translate .2s, box-shadow .3s;
}
.ing-boton:hover { background: var(--noche-2); translate: 0 -1px; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--noche) 80%, transparent); }
.ing-boton:focus-visible { outline: 3px solid color-mix(in srgb, var(--lente) 50%, transparent); outline-offset: 2px; }
.ing-boton::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%);
  translate: -120% 0; animation: ing-destello 5s ease-in-out infinite 2s;
}
@keyframes ing-destello { 0%, 70% { translate: -120% 0; } 100% { translate: 120% 0; } }
.ing-flecha { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: translate .3s; }
.ing-boton:hover .ing-flecha { translate: 4px 0; }
.ing-girando { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: ing-girar .8s linear infinite; }
.ing-boton.cargando { cursor: progress; }
.ing-boton.cargando .ing-flecha { display: none; }
.ing-boton.cargando .ing-girando { display: block; }

.ing-nota { margin: 1rem 0 0; text-align: center; font-size: .87rem; color: var(--texto-suave); }
.ing-pie { margin: 0; text-align: center; font-size: .85rem; color: var(--texto-suave); }
.ing-tarjeta .aviso { margin-bottom: .9rem; }
.ing-sacudir { animation: ing-sacudir .5s ease; }
@keyframes ing-sacudir { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }

/* ------------------------------------------------------------------
   Entrada animada (la activa ingreso.js con la clase .ing-listo)
   ------------------------------------------------------------------ */
@keyframes ing-subir { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@keyframes ing-aparecer { from { opacity: 0; } to { opacity: 1; } }
.ing-listo .ing-marca-arriba,
.ing-listo .ing-marca-centro > *,
.ing-listo .ing-lema { animation: ing-subir .8s cubic-bezier(.2, .8, .2, 1) backwards; }
.ing-listo .ing-marca-centro > *:nth-child(2) { animation-delay: .1s; }
.ing-listo .ing-marca-centro > *:nth-child(3) { animation-delay: .2s; }
.ing-listo .ing-marca-centro > *:nth-child(4) { animation-delay: .3s; }
.ing-listo .ing-lema { animation-delay: .45s; }
.ing-listo .ing-beneficios li { animation: ing-subir .6s cubic-bezier(.2, .8, .2, 1) backwards; }
.ing-listo .ing-beneficios li:nth-child(1) { animation-delay: .4s; }
.ing-listo .ing-beneficios li:nth-child(2) { animation-delay: .5s; }
.ing-listo .ing-beneficios li:nth-child(3) { animation-delay: .6s; }
.ing-listo .ing-beneficios li:nth-child(4) { animation-delay: .7s; }
.ing-listo .ing-tarjeta { animation: ing-subir .9s cubic-bezier(.2, .8, .2, 1) backwards .15s; }
.ing-listo .ing-pie { animation: ing-aparecer 1s ease backwards .6s; }
.ing-listo .ing-deco { animation: ing-aparecer 1.4s ease backwards; }

/* ------------------------------------------------------------------
   Adaptación a pantallas
   ------------------------------------------------------------------ */
/* Portátil pequeño / tableta acostada: panel algo más angosto */
@media (max-width: 1100px) {
  .ing { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ing-anillo, .ing-barrido, .ing-orbe { left: 85%; }
}
/* Tableta de pie y celular: la marca arriba, la tarjeta encima de ella */
@media (max-width: 820px) {
  .ing { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ing-marca { padding: 22px 22px 70px; gap: 1rem; }
  .ing-anillo, .ing-barrido, .ing-orbe { left: 88%; top: 42%; }
  .ing-orbe { width: 70px; }
  .ing-marca-centro { max-width: 34rem; }
  .ing-titular { font-size: clamp(1.5rem, 1.1rem + 2vw, 2rem); margin-bottom: .5rem; }
  .ing-subtitulo { margin-bottom: 0; font-size: .95rem; }
  .ing-beneficios, .ing-lema, .ing-escena { display: none; }
  .ing-lado { justify-content: flex-start; margin-top: -54px; padding-top: 0; background: transparent; }
  .ing-tarjeta { width: min(100%, 440px); }
  .pagina-ingreso { background: var(--fondo); }
}
@media (max-width: 480px) {
  .ing-orbe { display: none; }
}
@media (max-width: 420px) {
  .ing-marca { padding: 18px 16px 64px; }
  .ing-logo img { max-height: 40px; max-width: 170px; }
  .ing-en-linea { font-size: .75rem; padding: .3rem .7rem; }
  .ing-etiqueta { margin-bottom: .4rem; font-size: .7rem; }
  .ing-subtitulo { display: none; }
  .ing-lado { padding: 0 12px 16px; }
  .ing-tarjeta { padding: 20px 18px; }
}
/* Celulares bajitos (ej. 360×640): solo lo esencial */
@media (max-width: 820px) and (max-height: 700px) {
  .ing-marca { padding-bottom: 60px; gap: .7rem; }
  .ing-subtitulo, .ing-saludo, .ing-ayuda-texto, .ing-nota { display: none; }
  .ing-titular { font-size: 1.4rem; }
  .ing-tarjeta h1 { margin-bottom: .8rem; }
  .ing-campo { margin-bottom: .7rem; }
  .ing-pie { font-size: .78rem; }
}
/* Pantallas bajitas en computador: se quita lo que sobra para que todo quepa */
@media (min-width: 821px) and (max-height: 720px) {
  .ing-subtitulo { margin-bottom: 1rem; }
  .ing-beneficios { gap: .55rem; }
  .ing-icono { width: 32px; height: 32px; }
  .ing-saludo { display: none; }
}
@media (min-width: 821px) and (max-height: 600px) {
  .ing-beneficios li:nth-child(n+3), .ing-lema { display: none; }
  .ing-ayuda-texto, .ing-nota { display: none; }
  .ing-tarjeta h1 { margin-bottom: .8rem; }
}
/* Celular acostado: dos columnas compactas */
@media (max-height: 520px) and (orientation: landscape) {
  .ing { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); grid-template-rows: none; }
  .ing-marca { padding: 16px 18px; }
  .ing-subtitulo, .ing-en-linea { display: none; }
  .ing-lado { margin-top: 0; padding: 10px 14px; justify-content: center; background: var(--fondo); }
  .ing-saludo, .ing-ayuda-texto, .ing-nota, .ing-pie { display: none; }
  .ing-tarjeta { padding: 12px 18px; }
  .ing-tarjeta h1 { margin-bottom: .4rem; font-size: 1.15rem; }
  .ing-etiqueta-campo { margin-bottom: .2rem; font-size: .82rem; }
  .ing-campo { margin-bottom: .45rem; }
  .ing-campo input, .ing-boton { height: 38px; min-height: 38px; }
  .ing-olvido { margin: -.3rem 0 .35rem; }
  .ing-opciones { grid-template-columns: 1fr 1fr; gap: .3rem .6rem; margin-bottom: .5rem; font-size: .85rem; }
  .ing-casilla { font-size: .82rem; }
  .ing-casilla small { display: none; }
  .ing-titular { font-size: 1.3rem; }
  .ing-beneficios, .ing-lema { display: none; }
}
/* Pantallas grandes */
@media (min-width: 1600px) {
  .ing-tarjeta { width: 420px; }
  .ing-marca-centro { max-width: 34rem; }
}
/* Quien pidió menos movimiento en su equipo */
@media (prefers-reduced-motion: reduce) {
  .pagina-ingreso *, .pagina-ingreso *::before, .pagina-ingreso *::after { animation: none !important; transition: none !important; }
}
