:root {
  --bg: #05070d;
  --panel: #0b101b;
  --line: rgba(148, 163, 184, .2);
  --text: #f8fafc;
  --muted: #a3acbb;
  --violet: #8b6cf6;
  --blue: #4f8df7;
  --green: #22c55e;
  --gutter: 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(59, 80, 160, .16), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 400 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Barra superior */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 21, .75);
}

.brand img { width: 152px; }

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #5b3fd0;
  font-size: 15px;
  font-weight: 600;
}

.links {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
}

.links a:hover { color: #93b8ff; }

.links-open {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.links-open:hover { color: #93b8ff; }
.links-open:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.links .links-cta {
  padding: 5px 14px;
  border: 1px solid #3b6fd8;
  border-radius: 999px;
  color: #8fb6ff;
}

.links .links-cta:hover { background: rgba(59, 111, 216, .15); color: #fff; }

/* Contenido */
.page {
  display: grid;
  gap: 16px;
  container-type: inline-size;
  padding: 32px var(--gutter) 40px;
}

.hero { min-width: 0; padding-bottom: 12px; text-align: center; }

.eyebrow {
  color: #b4bcc9;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin-top: 10px;
  font-size: clamp(28px, 4.1cqi, 46px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.h1-accent {
  background: linear-gradient(90deg, #38bdf8, #6d8bff 55%, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(16px, .6vw + 14px, 23px);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(636px, 100%);
  min-height: 60px;
  margin-top: 26px;
  padding: 10px 20px;
  border: 1px solid rgba(52, 211, 153, .6);
  border-radius: 999px;
  background: linear-gradient(90deg, #0b5f4c, #0f7a60 50%, #0b5f4c);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  font-size: clamp(15px, .4vw + 14px, 21px);
  font-weight: 500;
  box-shadow: 0 0 28px rgba(16, 185, 129, .18);
  transition: border-color .15s, box-shadow .15s;
}

.cta .icon { color: #a7f3d0; font-size: 32px; stroke-width: 1.6; }
.cta:focus-visible { outline: 2px solid #6ee7b7; outline-offset: 3px; }
.cta:hover:enabled { border-color: #6ee7b7; box-shadow: 0 0 34px rgba(16, 185, 129, .34); }
.cta:disabled { cursor: default; opacity: .75; }

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

/* Progreso */
.progress { padding: 20px; }

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-head h2 { min-width: 0; font-size: clamp(17px, .4vw + 16px, 21px); font-weight: 500; }
.progress-head strong { font-size: clamp(20px, .5vw + 18px, 25px); font-weight: 700; }

.bar {
  height: 22px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #222836;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a56f3, #4f8df7);
}

.steps {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.step { display: flex; align-items: center; gap: 16px; min-width: 0; }

.dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 4px solid #3a404c;
  border-radius: 50%;
}

.dot .icon { display: none; }
.is-active .dot { border-color: var(--violet); }
.is-done .dot { border: 0; background: var(--green); color: #fff; font-size: 22px; }
.is-done .dot .icon { display: block; }

/* Agentes */
.agents { display: grid; gap: 16px; min-width: 0; }

.agent {
  --glow: rgba(99, 102, 241, .28);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(260px 190px at 100% 0, var(--glow), transparent 75%),
    var(--panel);
}

.agent-content { --glow: rgba(180, 120, 50, .38); }
.agent-mail { --glow: rgba(40, 110, 170, .38); }
.agent-chat { --glow: rgba(60, 80, 190, .42); }
.agent-phone { --glow: rgba(30, 110, 80, .36); }

.agent-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #2a2f3a;
  color: #7b8494;
  font-size: 30px;
  transition: background-color .4s, color .4s;
}

.agent-icon .icon { stroke-width: 1.6; }
.agent.is-on .agent-icon { color: #fff; }
.agent-content.is-on .agent-icon { background: #43309a; }
.agent-mail.is-on .agent-icon { background: #1f4a9c; }
.agent-chat.is-on .agent-icon { background: #4a35a8; }
.agent-phone.is-on .agent-icon { background: #17593f; }

.agent h3 { margin-top: 12px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.agent p { margin-top: 12px; color: var(--muted); font-size: 15.500px; line-height: 1.5; }

.agent footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.see {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  font-size: 13px;
  font-weight: 500;
}

.see:hover { border-color: rgba(148, 163, 184, .6); }
button.see { color: inherit; font-family: inherit; cursor: pointer; }
button.see:disabled { cursor: default; }
button.see:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Al llegar a 100 %, la tarjeta de Contenidos parpadea para invitar al clic */
.agent.is-clickable { cursor: pointer; }

.agent.is-attention {
  border-color: #a78bfa;
  animation: attention 1.1s ease-in-out infinite;
}

.agent.is-attention .see { border-color: #fff; }

@keyframes attention {
  50% { border-color: rgba(167, 139, 250, .25); box-shadow: 0 0 0 3px rgba(167, 139, 250, .55), 0 0 26px rgba(167, 139, 250, .55); }
}

/* Modal */
.modal {
  width: min(460px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
}

.modal::backdrop { background: rgba(2, 4, 10, .72); }
.modal .agent-icon { width: 44px; height: 44px; background: #43309a; color: #fff; font-size: 24px; }
.modal h2 { margin-top: 12px; font-size: 19px; font-weight: 600; }
.modal p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Ícono al lado del título: el formulario y Enviar deben caber sin scroll en un notebook */
.modal.modal-mail { padding: 16px 22px; }
.modal.modal-mail .agent-icon { float: left; width: 36px; height: 36px; margin-right: 12px; border-radius: 8px; background: #1f4a9c; font-size: 20px; }
.modal.modal-mail h2 { margin-top: 0; font-size: 16px; line-height: 1.3; }
.modal.modal-mail .mail-done { clear: both; padding-top: 10px; }
.modal.modal-mail .modal-actions { margin-top: 12px; }

.mail-form { display: grid; clear: both; gap: 8px; padding-top: 10px; }
.mail-form[hidden], .modal-link[hidden] { display: none; }
.mail-form label { display: grid; gap: 3px; color: var(--muted); font-size: 13px; }

.mail-form input, .mail-form textarea {
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05080f;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* evita el zoom automático en teléfonos */
}

.mail-form textarea { resize: vertical; }
.modal .mail-done strong { color: var(--text); overflow-wrap: anywhere; }
.mail-form input:focus, .mail-form textarea:focus { border-color: var(--blue); outline: 1px solid var(--blue); }
.mail-form input[readonly] { border-style: dashed; color: var(--muted); outline: 0; }

@media (min-width: 760px) {
  .mail-form input, .mail-form textarea { font-size: 14px; }
}

/* Modales de ejemplo: 10 % de margen de la pantalla por cada lado */
.modal.modal-large { width: 80vw; max-width: none; height: 80vh; max-height: none; }
.modal.modal-large[open] { display: flex; flex-direction: column; }
.modal.modal-large h2 { flex: none; margin-top: 0; font-size: clamp(15px, 1.4vw, 19px); }

.doc-text {
  flex: 1;
  min-height: 0;
  margin: 12px 0 0;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05080f;
  color: #dbe2ec;
  font: 14px/1.55 Inter, system-ui, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.doc-code { font: 13px/1.55 Consolas, Menlo, monospace; }
.modal.modal-large .modal-actions { flex: none; margin-top: 12px; }

.modal.modal-chat .agent-icon { background: #4a35a8; }

.code-sample {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05080f;
  color: #93c5fd;
  font: 12.5px/1.5 Consolas, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.modal .chat-error { color: #fca5a5; }
.chat-error[hidden] { display: none; }
.modal-link:disabled { cursor: default; opacity: .7; }

.modal.modal-phone .agent-icon { background: #17593f; }
.modal .call-number { margin-top: 8px; color: var(--text); font-size: 22px; font-weight: 600; }
.modal .call-label { margin-top: 12px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }

.modal .call-code {
  margin: 2px 0 12px;
  color: #4ade80;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-close, .modal-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}

.modal-close { background: transparent; color: inherit; cursor: pointer; }
.modal-close:hover { border-color: rgba(148, 163, 184, .6); }
.modal-link { border-color: rgba(52, 211, 153, .6); background: #0f7a60; color: #fff; cursor: pointer; }
.modal-link:hover { border-color: #6ee7b7; background: #128a6d; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.status.is-ready { border-color: rgba(34, 197, 94, .35); background: rgba(22, 101, 52, .4); color: #dcfce7; }
.status.is-ready .icon { color: #4ade80; font-size: 15px; }
.status.is-working { border-color: rgba(96, 165, 250, .45); background: #1d3f8a; color: #e0ecff; }
.status.is-off { border-color: rgba(148, 163, 184, .4); background: rgba(148, 163, 184, .12); color: #e5e7eb; }

.ring, .spinner { width: 18px; height: 18px; border-radius: 50%; }
.ring { border: 2px solid #d1d5db; }

.spinner {
  border: 2px solid rgba(147, 197, 253, .3);
  border-top-color: #93c5fd;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .cta, .agent-icon { transition: none; }
}

/* Planes */
.plans {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: 20px;
  background:
    linear-gradient(115deg, rgba(49, 39, 120, .32), transparent 42%, rgba(30, 58, 120, .28)),
    var(--panel);
}

.plans-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #2a3042;
  font-size: 34px;
}

.plans-icon .icon { stroke-width: 1.6; }
.plans-text { min-width: 0; }
.plans-text h2 { font-size: clamp(20px, .5vw + 18px, 25px); font-weight: 600; letter-spacing: -.01em; }
.plans-text p { margin-top: 6px; color: var(--muted); font-size: 16px; }

.plans-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 10px 16px;
  border: 2px solid #3b6fd8;
  border-radius: 999px;
  color: #8fb6ff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.plans-link .icon { font-size: 19px; }
.plans-link:hover { background: rgba(59, 111, 216, .15); color: #fff; }

/* Tablet */
@media (min-width: 560px) {
  :root { --gutter: 24px; }
}

@media (min-width: 760px) {
  .topbar { padding-top: 4px; padding-bottom: 4px; }
  .brand img { width: 136px; }
  .avatar { width: 30px; height: 30px; font-size: 12px; }
  .links { order: 0; width: auto; margin: 0 4px 0 auto; padding: 0; border: 0; font-size: 13px; }
  .links .links-cta { padding: 3px 12px; }
}

@media (min-width: 808px) {
  .page { gap: 10px; padding-top: 12px; padding-bottom: 12px; }
}

/* Escritorio: 15 % de margen a cada lado. En pantallas menores no cabría el contenido. */
@media (min-width: 1100px) {
  :root { --gutter: 15%; }
  .brand { display: block; padding: 0 16px 0 0; border-right: 1px solid var(--line); }
}

/* Las columnas dependen del ancho del contenido, no del de la pantalla */
@container (min-width: 500px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (min-width: 550px) {
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Versión compacta: todo debe caber en la pantalla de un notebook sin hacer scroll */
@container (min-width: 760px) {
  .hero { padding-bottom: 2px; }
  .eyebrow { font-size: 11px; }
  h1 { margin-top: 4px; font-size: clamp(24px, 3.2cqi, 34px); }
  .lead { margin-top: 2px; font-size: 14px; }
  .cta { width: min(460px, 100%); min-height: 36px; margin-top: 10px; padding: 4px 16px; font-size: 14px; }
  .cta .icon { font-size: 20px; }
  .panel { border-radius: 12px; }
  .progress { padding: 10px 16px 12px; }
  .progress-head h2 { font-size: 14px; }
  .progress-head strong { font-size: 16px; }
  .bar { height: 10px; margin-top: 6px; }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 10px; font-size: 12px; line-height: 1.35; }
  .step { gap: 8px; padding-left: 10px; }
  .step:first-child { padding-left: 0; }
  .step + .step { border-left: 1px solid var(--line); }
  .dot { width: 24px; height: 24px; border-width: 3px; }
  .is-done .dot { font-size: 15px; }
  .agents { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .agent { padding: 10px; border-radius: 12px; }
  .agent-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 17px; }
  .agent h3 { margin-top: 6px; font-size: 14px; }
  .agent p { margin-top: 3px; font-size: 12px; line-height: 1.35; }
  .agent footer { flex-wrap: nowrap; gap: 6px; padding-top: 8px; }
  .see { gap: 4px; padding: 3px 8px; font-size: 11px; }
  .status { gap: 4px; padding: 4px 7px; font-size: 10px; letter-spacing: 0; }
  .status.is-ready .icon { font-size: 12px; }
  .ring, .spinner { width: 12px; height: 12px; }
  .plans { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 14px; padding: 8px 14px; }
  .plans-icon { width: 38px; height: 38px; border-radius: 8px; font-size: 21px; }
  .plans-text h2 { font-size: 15px; }
  .plans-text p { margin-top: 0; font-size: 12px; }
  .plans-link { width: auto; min-height: 32px; padding: 4px 14px; border-width: 1px; font-size: 12px; }
  .plans-link .icon { font-size: 15px; }
}
