/* Portal de ingreso · Consultas Kommo · Reality (oscuro, centro de mando) */
@font-face {
  font-family: "Figtree";
  src: url("figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --carmesi: #e1232a;
  --rojo: #b51720;
  --rojo-claro: #ff5a5f;
  --negro-0: #0b0d10;
  --negro-1: #14171c;
  --negro-2: #1d2126;
  --negro-3: #262b32;
  --plata: #e6e8ec;
  --plata-2: #c7cbd2;
  --gris-texto: #9aa0a8;
  --gris-suave: #7d838c;
  --borde: rgba(230, 232, 236, .12);
  --borde-fuerte: rgba(230, 232, 236, .22);
  --foco: rgba(225, 35, 42, .38);
  --aviso-bg: rgba(40, 51, 46, .58);
  --aviso-borde: rgba(140, 184, 156, .3);
  --aviso-texto: #b9d6c4;
  --suave: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

@property --angulo {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--negro-0);
  color: var(--plata);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Fondo: constelación + malla + grano ---------- */
.fondo { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; background: var(--negro-0); }

#constelacion { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.malla { position: absolute; inset: 0; }
.mancha { position: absolute; border-radius: 50%; filter: blur(100px); will-change: transform; animation: deriva 30s var(--suave) infinite alternate; }
.m1 { width: 50vmax; height: 50vmax; left: -16vmax; top: -18vmax; background: radial-gradient(circle at 40% 40%, rgba(225, 35, 42, .16), rgba(225, 35, 42, 0) 68%); }
.m2 { width: 44vmax; height: 44vmax; right: -14vmax; bottom: -18vmax; background: radial-gradient(circle at 50% 50%, rgba(181, 23, 32, .14), rgba(181, 23, 32, 0) 68%); animation-duration: 36s; animation-delay: -9s; }
.m3 { width: 56vmax; height: 56vmax; right: -20vmax; top: -24vmax; background: radial-gradient(circle, rgba(230, 232, 236, .05), rgba(230, 232, 236, 0) 65%); animation-duration: 42s; animation-delay: -16s; }

@keyframes deriva {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(3vmax, 2.4vmax, 0) scale(1.08); }
  100% { transform: translate3d(-2.4vmax, 4vmax, 0) scale(.96); }
}

.grano {
  position: absolute; inset: -10%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
  mix-blend-mode: overlay;
}

/* ---------- Escena y tarjeta de vidrio ---------- */
.escena {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px calc(28px + env(safe-area-inset-bottom));
}

.tarjeta {
  position: relative;
  width: 100%;
  max-width: 424px;
  padding: 40px 38px 34px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(38, 43, 50, .68), rgba(14, 16, 20, .72));
  border: 1px solid var(--borde);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
          backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 1px 2px rgba(0, 0, 0, .3),
    0 24px 50px -20px rgba(0, 0, 0, .6),
    0 60px 110px -40px rgba(0, 0, 0, .7);
  animation: entrada 560ms var(--suave) both;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 340ms var(--suave), box-shadow 340ms var(--suave);
  will-change: transform;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tarjeta { background: rgba(17, 20, 24, .96); }
}
/* Borde de gradiente cónico animado, casi imperceptible */
.tarjeta::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angulo, 0deg), rgba(225, 35, 42, .55), rgba(230, 232, 236, 0) 22%, rgba(230, 232, 236, 0) 60%, rgba(230, 232, 236, .3) 76%, rgba(225, 35, 42, .55) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: .55;
  animation: girar-borde 18s linear infinite;
}
@keyframes girar-borde { to { --angulo: 360deg; } }
/* Filo carmesí sutil en el borde superior */
.tarjeta::after {
  content: "";
  position: absolute;
  top: -1px; left: 50%;
  width: 38%; height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(225, 35, 42, 0), var(--carmesi) 30%, var(--rojo-claro) 70%, rgba(225, 35, 42, 0));
}

@keyframes entrada {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.logo { display: block; width: 200px; height: auto; margin: 0 auto 26px; }

.encabezado { text-align: center; margin-bottom: 22px; }

.sello {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: rgba(230, 232, 236, .06);
  border: 1px solid var(--borde);
  color: var(--gris-texto);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.punto {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--carmesi);
  box-shadow: 0 0 0 3px rgba(225, 35, 42, .2);
  flex: none;
}

h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.022em;
  color: var(--plata);
}
.bajada { margin: 8px 0 0; font-size: 15px; color: var(--gris-texto); }

/* ---------- Aviso y error ---------- */
.aviso, .error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  animation: caida 420ms var(--suave) both;
}
.aviso svg, .error svg { flex: none; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.aviso { background: var(--aviso-bg); border: 1px solid var(--aviso-borde); color: var(--aviso-texto); }
.error { background: rgba(64, 20, 23, .55); border: 1px solid rgba(225, 65, 72, .35); color: #ffb3b7; }
@keyframes caida {
  0%   { opacity: 0; transform: translateY(-6px) scale(.98); }
  60%  { opacity: 1; transform: translateY(1px) scale(1); }
  100% { opacity: 1; transform: none; }
}
@keyframes sacudida {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.tarjeta.sacude { animation: entrada 560ms var(--suave) both, sacudida 460ms var(--suave); }

/* ---------- Campos ---------- */
form { display: grid; gap: 18px; }

.campo label {
  display: block;
  margin: 0 0 8px 2px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--plata-2);
}

.campo input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(230, 232, 236, .4); /* 3:1 contra el fondo (WCAG 1.4.11) */
  background: rgba(11, 13, 16, .55);
  color: var(--plata);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
  transition: border-color 200ms var(--suave), box-shadow 240ms var(--suave), background-color 200ms var(--suave);
  -webkit-appearance: none;
          appearance: none;
}
.campo input::placeholder { color: var(--gris-suave); }
.campo input:hover { border-color: rgba(230, 232, 236, .55); }
.campo input:focus {
  outline: none;
  border-color: var(--carmesi);
  background: rgba(11, 13, 16, .78);
  box-shadow: 0 0 0 4px var(--foco), inset 0 1px 2px rgba(0, 0, 0, .3);
}

.con-ojo { position: relative; }
.con-ojo input { padding-right: 54px; }

.ojo {
  position: absolute;
  top: 50%; right: 6px;
  width: 40px; height: 40px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--gris-texto);
  cursor: pointer;
  transition: background-color 180ms var(--suave), color 180ms var(--suave);
}
.ojo:hover { background: rgba(230, 232, 236, .08); color: var(--plata); }
.ojo:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--foco); color: var(--plata); }
.ojo svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: opacity 160ms var(--suave), transform 220ms var(--suave); }
.ojo svg:last-child { opacity: 0; transform: scale(.85); }
.ojo[aria-pressed="true"] svg:first-child { opacity: 0; transform: scale(.85); }
.ojo[aria-pressed="true"] svg:last-child { opacity: 1; transform: none; }

.capslock {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 0 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e8b04a;
}
.capslock[hidden] { display: none; }
.capslock svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Recordarme ---------- */
.recordar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  margin: 2px 0 4px;
  font-size: 14.5px;
  color: var(--plata-2);
  cursor: pointer;
  user-select: none;
}
.recordar input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.caja {
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  flex: none;
  border-radius: 6px;
  border: 1.5px solid var(--borde-fuerte);
  background: rgba(11, 13, 16, .5);
  transition: background-color 200ms var(--suave), border-color 200ms var(--suave), box-shadow 200ms var(--suave), transform 200ms var(--suave);
}
.caja svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset 260ms var(--suave) 40ms; }
.recordar:hover .caja { border-color: var(--plata-2); }
.recordar input:checked + .caja { background: linear-gradient(135deg, var(--carmesi), var(--rojo)); border-color: var(--rojo-claro); }
.recordar input:checked + .caja svg { stroke-dashoffset: 0; }
.recordar input:active + .caja { transform: scale(.92); }
.recordar input:focus-visible + .caja { box-shadow: 0 0 0 4px var(--foco); border-color: var(--carmesi); }

/* ---------- Botón principal ---------- */
.entrar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--carmesi) 0%, #cf1d25 55%, var(--rojo) 100%);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 1px 2px rgba(0, 0, 0, .35),
    0 16px 32px -14px rgba(181, 23, 32, .65);
  transition: transform 220ms var(--suave), box-shadow 260ms var(--suave), filter 220ms var(--suave);
}
.entrar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .35) 50%, rgba(255, 255, 255, 0) 60%);
  transform: translateX(-120%);
  transition: transform 650ms var(--suave);
}
.entrar:hover::before { transform: translateX(120%); }
.entrar:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 2px 4px rgba(0, 0, 0, .3),
    0 20px 40px -16px rgba(181, 23, 32, .75);
}
.entrar:active { transform: translateY(0); transition-duration: 80ms; }
.entrar:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--negro-1), 0 0 0 6px rgba(225, 35, 42, .55), 0 16px 32px -14px rgba(181, 23, 32, .65); }
.entrar:disabled { cursor: progress; }

.giro {
  display: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: girar 700ms linear infinite;
}
.entrar.cargando { transform: none; filter: saturate(.92); }
.entrar.cargando .giro { display: block; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Pie ---------- */
.pie {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--gris-suave);
  text-align: center;
  animation: entrada 620ms var(--suave) 150ms both;
}
.pie p { margin: 0; }
.pie-chico { margin-top: 4px !important; font-size: 11.5px; color: var(--gris-suave); }

/* ---------- Vitrina (solo escritorio) ---------- */
.disposicion { display: flex; flex-direction: column; align-items: center; width: 100%; }
.vitrina { display: none; }

@media (min-width: 1024px) {
  .disposicion {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(48px, 7vw, 120px);
    max-width: 1140px;
  }
  .vitrina {
    display: block;
    flex: 0 1 520px;
    animation: entrada 700ms var(--suave) 80ms both;
  }
  .vitrina-sello {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0 0 18px;
    font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--gris-texto);
  }
  .vitrina-titulo {
    margin: 0;
    font-size: clamp(36px, 3.4vw, 48px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--plata);
  }
  .vitrina-titulo em {
    font-style: normal;
    background: linear-gradient(95deg, var(--carmesi), var(--rojo-claro) 70%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
  }
  .vitrina-bajada { margin: 18px 0 0; max-width: 42ch; font-size: 17px; line-height: 1.55; color: var(--gris-texto); }

  /* Caja de preguntas de ejemplo con efecto de escritura */
  .ejemplos { margin: 32px 0 26px; }
  .ejemplos-etiqueta {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 10px;
    font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--gris-suave);
  }
  .punto-chico { width: 5px; height: 5px; border-radius: 50%; background: var(--carmesi); flex: none; }
  .ejemplos-caja {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(230, 232, 236, .04);
    border: 1px solid var(--borde);
    font-size: 16px;
    font-weight: 500;
    color: var(--plata-2);
  }
  .cursor-prompt { flex: none; color: var(--carmesi); font-weight: 700; }
  #ejemplos-texto { flex: 1 1 auto; }
  .cursor-parpadeo {
    display: inline-block;
    width: 2px; height: 18px;
    margin-left: 1px;
    background: var(--rojo-claro);
    animation: parpadeo 1s step-end infinite;
    vertical-align: -3px;
  }
  @keyframes parpadeo { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

  .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .chips li {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(230, 232, 236, .05);
    border: 1px solid var(--borde);
    color: var(--gris-texto);
    font-size: 13px; font-weight: 500;
  }
  .escena { padding-left: 32px; padding-right: 32px; }
  .tarjeta { flex: 0 0 424px; }
}

/* ---------- Móvil ---------- */
@media (max-width: 480px) {
  .escena { padding-top: 24px; justify-content: center; }
  .tarjeta { padding: 32px 22px 26px; border-radius: 22px; transform: none !important; }
  .logo { width: 176px; margin-bottom: 22px; }
  h1 { font-size: 24px; }
  .campo input { height: 48px; font-size: 16px; }
  .entrar { height: 50px; }
  .mancha { filter: blur(70px); }
}

@media (prefers-reduced-motion: reduce) {
  .mancha, .tarjeta, .tarjeta::before, .pie, .aviso, .error, .vitrina, .cursor-parpadeo { animation: none !important; }
  .tarjeta { transform: none !important; }
  .entrar, .entrar:hover, .entrar::before { transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}

/* Alto contraste de Windows: el box-shadow del foco desaparece, se usa el contorno del sistema */
@media (forced-colors: active) {
  .campo input:focus, .ojo:focus-visible, .entrar:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}
