/* Zona de clientes de AIVI, con el mismo lenguaje que la portada de aivilab.com:
   fondo blanco con serpientes de puntos, barra flotante oscura, titular grande en DM Sans con la parte en verde,
   ventanas de aplicación con esquinas de 12px y botones de 8px.
   Sin estilos ni scripts en línea: la CSP solo permite 'self'. */
@font-face {
  font-family: "DM Sans";
  src: url("dm-sans-latin.6c1e961057d2.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  --bg: #FFFFFF;
  --ink: #0A0A0A;
  --muted: #56615C;
  --line: rgba(17, 22, 20, .1);
  --brand: #2F6B5C;
  --brand-deep: #23544A;
  --brand-soft: #E3EEE9;
  --graphite: #161616;
  --hair-d: rgba(255, 255, 255, .14);
  --error: #A3362B;
  --win-shadow: 0 0 0 1px rgba(17, 22, 20, .08), 0 2px 4px rgba(17, 22, 20, .06), 0 24px 60px -20px rgba(10, 30, 24, .45);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --f-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  position: relative; margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--f-sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, p, figure { margin: 0; }
a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Fondo: serpientes de puntos (fondo.js) */
.vortex { position: absolute; left: 0; top: 0; width: 100%; z-index: -1; pointer-events: none; display: block; }

/* Barra flotante oscura, como en la web */
.navbar {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); width: min(1160px, calc(100% - 40px)); z-index: 50;
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 20px; border-radius: 12px;
  background: rgba(22, 22, 22, .92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px var(--hair-d), 0 10px 8px rgba(0, 0, 0, .04), 0 4px 3px rgba(0, 0, 0, .1);
}
.navbar .home { margin-right: auto; display: block; color: #fff; }
.navbar .logo { height: 20px; width: auto; display: block; }
.navbar .links { display: flex; gap: 6px; min-width: 0; }
.navbar form { margin: 0; }
.ghost {
  display: inline-flex; align-items: center; gap: 7px; font: 500 14px/1 var(--f-sans); letter-spacing: .02em;
  color: rgba(255, 255, 255, .85); text-decoration: none; padding: 9px 15px; border-radius: 8px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--hair-d); transition: background .2s ease, color .2s ease;
}
a.ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ghost.quien { box-shadow: none; color: rgba(255, 255, 255, .7); overflow: hidden; text-overflow: ellipsis; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 15px/1.2 var(--f-sans);
  color: #fff; text-decoration: none; white-space: nowrap; cursor: pointer; padding: 10px 18px; border-radius: 8px; border: 0;
  background: var(--ink); transition: background .25s ease, color .25s ease, transform .35s var(--ease-spring);
}
.pill:hover { background: var(--brand); }
.pill:active { transform: scale(.97); }
.navbar .pill { background: #fff; color: var(--graphite); }
.navbar .pill:hover { background: var(--brand); color: #fff; }
.pill.ancho { width: 100%; padding-block: 14px; font-size: 16px; }

/* Contenido */
.contenido { flex: 1; padding-top: 128px; padding-bottom: clamp(56px, 8vw, 110px); }
.pie { display: flex; gap: 1.5rem; padding-bottom: 28px; font-size: 13px; color: var(--muted); }
.pie a { color: inherit; }

/* Titular como el de la portada: primera parte en negro, la que cierra en verde y más fina */
.titular { font-size: clamp(42px, 6.6vw, 96px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 500; }
.titular .lead { color: var(--ink); }
.titular .verde { color: var(--brand); font-weight: 300; }
.titular.pagina { font-size: clamp(36px, 5.2vw, 72px); margin: 0 0 clamp(28px, 4vw, 48px); max-width: 18ch; }

/* Acceso: titular a un lado y ventana al otro */
.portada { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 440px); gap: clamp(32px, 6vw, 96px); align-items: center; min-height: min(calc(100svh - 260px), 620px); }
.portada .titular { max-width: 11ch; }
.portada .titular .lead { display: block; }

/* Ventana de aplicación, la misma de la web */
.win { position: relative; background: #fff; border-radius: 12px; box-shadow: var(--win-shadow); overflow: hidden; min-width: 0; }
.win-bar { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 14px; background: #F7F7F7; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.win-title { font-weight: 500; color: #3A423E; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lights { display: flex; gap: 5px; flex: none; }
.lights i { width: 10px; height: 4px; border-radius: 999px; display: block; background: rgba(10, 10, 10, .12); }
.lights i:first-child { background: rgba(10, 10, 10, .28); }
.win-in { padding: clamp(22px, 3vw, 32px); }
.win-in form { margin-top: 20px; }
.win-in form + form { margin-top: 10px; }

.texto-suave { color: var(--muted); }
.nota { font-size: 13.5px; color: var(--muted); margin-top: 20px; }
.enlace { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* Campos */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.campo input {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 8px; border: 0; background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(10, 10, 10, .18); transition: box-shadow .2s ease;
}
.campo input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.con-error input { box-shadow: inset 0 0 0 1px var(--error); }
.error-campo, .error-form { color: var(--error); font-size: 14px; margin: 6px 0 0; }
.error-form { background: rgba(163, 54, 43, .07); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.error-form p { margin: 0; }

.pasos { padding-left: 1.2rem; margin: 0; color: var(--muted); font-size: 15px; }
.pasos li { margin-bottom: 6px; }
.qr { margin-top: 18px; text-align: center; }
.qr img { border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.qr figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.clave { font-size: 14px; letter-spacing: .05em; color: var(--ink); }

.avisos { list-style: none; padding: 0; margin: 0 0 20px; }
.aviso { padding: 12px 16px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep); margin-bottom: 8px; }
.aviso-error { background: rgba(163, 54, 43, .08); color: var(--error); }

/* Listas dentro de la ventana */
.volver { display: inline-block; margin-bottom: 18px; font-size: 14px; font-weight: 500; text-decoration: none; }
.descripcion { max-width: 60ch; margin: -18px 0 clamp(28px, 4vw, 44px); font-size: 17px; }
.filas { list-style: none; margin: 0; padding: 0; }
.filas > li + li { border-top: 1px solid var(--line); }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(18px, 3vw, 28px); text-decoration: none; color: var(--ink); }
a.fila { transition: background .2s ease; }
a.fila:hover { background: var(--brand-soft); }
.fila-texto { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fila-nombre { font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.fila-desc { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.flecha { color: var(--brand); font-size: 20px; transition: transform .35s var(--ease-spring); }
a.fila:hover .flecha { transform: translateX(4px); }
.tag { align-self: flex-start; display: inline-flex; font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; background: var(--brand-soft); color: var(--brand-deep); margin-bottom: 4px; }
.vacio { padding: 40px 24px; text-align: center; }
.vacio p + p { margin-top: 4px; }

@media (max-width: 860px) {
  .portada { grid-template-columns: 1fr; min-height: 0; gap: 32px; }
  .portada .titular { max-width: 14ch; }
}
@media (max-width: 760px) {
  .navbar { gap: 4px; padding: 5px 5px 5px 12px; width: calc(100% - 24px); top: 12px; }
  .navbar .logo { height: 16px; }
  .ghost { padding: 8px 9px; font-size: 12.5px; letter-spacing: 0; }
  .navbar .pill { padding: 8px 11px; font-size: 12.5px; }
  .contenido { padding-top: 104px; }
  .ghost.quien { max-width: 46vw; }
  .documento { flex-direction: column; align-items: stretch; }
  .documento .pill { width: 100%; }
}
@media (max-width: 380px) {
  .navbar .home { width: 20px; overflow: hidden; flex: none; }
  .ghost.quien { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pill, .flecha, a.fila { transition: none; }
}
