/*
 * Alta sola de Nukli Chat. Misma marca que la landing (nukliapp.com/es/chatbot,
 * nukli-lp: AdsChatPage.vue y AdsChatSignup.vue): rombo de Nukli, tipografía del
 * sistema, azul #2c7cff, botón con degradado, campos grises sin borde y tarjetas
 * blancas muy redondeadas sobre un fondo claro con un halo azul. Sin build.
 * El panel (panel.css) usa estas mismas variables.
 */
:root {
  --blue: #2c7cff;
  --blue-press: #1f6fff;
  --blue-soft: rgba(44, 124, 255, .1);
  --grad: linear-gradient(135deg, #1f6fff, #5aa9ff);
  --btn-grad: linear-gradient(180deg, #5b95f3 0%, #3a74e0 100%);
  --btn-grad-hover: linear-gradient(180deg, #6aa0f6 0%, #437de6 100%);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 0 0 1px rgba(255, 255, 255, .14), 0 0 0 1px #3166cf, 0 12px 26px -12px rgba(49, 102, 207, .75);
  --ink: #1d1d1f;
  --gray: #6e6e73;
  --gray-2: #86868b;
  --alt: #f5f5f7;
  --card: #fff;
  --line: rgba(0, 0, 0, .08);
  --green: #1f8a3c;
  --green-soft: rgba(52, 199, 89, .14);
  --amber: #9a6700;
  --amber-soft: rgba(255, 176, 32, .16);
  --red: #cd2b31;
  --red-soft: rgba(229, 72, 77, .1);
  --radius: 28px;
  --radius-s: 14px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: #fff;
  background-image:
    radial-gradient(60% 420px at 50% 0, rgba(44, 124, 255, .16), transparent 70%),
    radial-gradient(40% 320px at 88% 120px, rgba(90, 169, 255, .12), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
[hidden] { display: none !important; }

/* ── Cabecera ── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 860px; margin: 0 auto; padding: 16px 20px 8px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.brand b { font-size: 1.35rem; font-weight: 700; letter-spacing: -.04em; }
.step { display: flex; align-items: center; gap: 12px; flex: 1; max-width: 300px; font-size: .8rem; font-weight: 600; color: var(--blue); }
.step span { flex: none; padding: 5px 10px; border-radius: 999px; background: var(--blue-soft); white-space: nowrap; }
.step i { flex: 1; height: 4px; border-radius: 4px; background: rgba(44, 124, 255, .12); overflow: hidden; }
.step i b { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--grad); transition: width .35s ease; }

/* ── Tarjetas y texto ── */
.wrap { max-width: 860px; margin: 0 auto; padding: 8px 20px 72px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 36px; margin-top: 18px;
  box-shadow: 0 0 0 1px var(--line), 0 30px 70px -40px rgba(44, 124, 255, .45);
}
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; padding: 32px 28px; }
.card.center { text-align: center; max-width: 480px; margin-left: auto; margin-right: auto; }
h1 { font-size: 1.75rem; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; margin: 0 0 10px; }
h2 { font-size: 1.15rem; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.lead { color: var(--gray); margin: 0 0 22px; max-width: 62ch; line-height: 1.45; }
.muted { color: var(--gray); }
.fine { color: var(--gray-2); font-size: .86rem; line-height: 1.45; margin: 14px 0 0; }
.fine.ok { color: var(--green); font-weight: 600; }
.legal { margin: 12px 4px 0; font-size: .78rem; line-height: 1.4; color: var(--gray-2); text-align: center; }
.legal a { color: inherit; text-decoration: underline; }

/* ── Formulario (como la ventana de la landing) ── */
.field { position: relative; display: block; margin: 0 0 9px; }
.field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field input {
  width: 100%; height: 50px; padding: 0 16px; border: 0; border-radius: var(--radius-s); background: var(--alt); color: var(--ink);
  font: inherit; font-size: 16px; outline: none; box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow .15s ease, background .15s ease; -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: var(--gray-2); }
.field input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--blue); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--gray); margin: 12px 2px 14px; }
.check input { flex: none; margin-top: 3px; width: 18px; height: 18px; accent-color: var(--blue); }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  font: inherit; font-size: 1rem; font-weight: 600; border-radius: var(--radius-s); border: 0;
  background: var(--alt); color: var(--ink); cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--btn-grad); color: #fff; box-shadow: var(--btn-shadow); }
.btn.primary:hover:not([disabled]) { background: var(--btn-grad-hover); }
.btn.block { width: 100%; min-height: 52px; font-size: 1.04rem; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .88rem; border-radius: 10px; }
.btn[disabled] { opacity: .6; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; cursor: pointer; margin-top: 18px; }

.plans + .error { margin-top: 12px; }
/* Tienda ya activa (409): entrar en el panel o escribirnos. */
.active-box { background: var(--blue-soft); border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; font-size: .92rem; line-height: 1.4; }
.active-box b { display: block; color: var(--ink); margin-bottom: 2px; }
.active-box p { margin: 0 0 10px; color: var(--gray); }
.active-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.active-actions .btn { min-height: 40px; padding: 0 16px; font-size: .95rem; }
.active-actions .btn:not(.primary) { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.active-box .active-msg { margin: 10px 0 0; color: var(--ink); font-weight: 600; }
.error { color: var(--red); background: var(--red-soft); padding: 10px 14px; border-radius: 12px; font-size: .92rem; line-height: 1.35; margin: 0 0 12px; }

/* ── Carga ── */
.spinner {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 14px;
  border: 3px solid var(--alt); border-top-color: var(--blue); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; border-radius: 3px; background: rgba(44, 124, 255, .12); overflow: hidden; margin: 4px 0 18px; }
.progress span { display: block; height: 100%; width: 35%; background: var(--grad); border-radius: 3px; animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.reading { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--gray-2); }
.reading li { display: flex; align-items: center; gap: 10px; }
.reading li::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12);
}
.reading li.current { color: var(--ink); font-weight: 600; }
.reading li.current::before { box-shadow: none; border: 2px solid rgba(44, 124, 255, .2); border-top-color: var(--blue); animation: spin .9s linear infinite; }
.reading li.done { color: var(--gray); }
.reading li.done::before {
  box-shadow: none; background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ── Vista previa: la tienda detrás y el chat abierto, a toda la ventana ── */
body.previewing { overflow: hidden; background: #fff; }
body.previewing .top, body.previewing .wrap { display: none; }
.preview { position: fixed; inset: 0; display: flex; flex-direction: column; background: #fff; }
.preview-bar {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top)); background: #fff; box-shadow: 0 1px 0 var(--line), 0 8px 24px -16px rgba(0, 0, 0, .25);
  position: relative; z-index: 2;
}
.preview-bar img { flex: none; width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.preview-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.preview-text b { font-size: .98rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-text span { font-size: .82rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-bar .btn { flex: none; min-height: 42px; }
.preview-bar .short { display: none; }
.preview-stage { position: relative; flex: 1; min-height: 0; background: var(--alt); }
.preview-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.preview-wait { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gray); background: var(--alt); }
.preview-wait p { margin: 0; }

/* ── Planes ── */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan { background: var(--alt); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.plan.featured { background: #fff; box-shadow: inset 0 0 0 2px var(--blue), 0 20px 40px -28px rgba(44, 124, 255, .7); }
.plan-name { font-weight: 700; letter-spacing: -.02em; }
.plan-price { font-size: 2rem; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; }
.plan-price small { font-size: .9rem; font-weight: 500; letter-spacing: -.01em; color: var(--gray); }
.plan-conv { color: var(--gray); font-size: .9rem; line-height: 1.35; flex: 1; margin-bottom: 10px; }
.plan .btn { background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.plan .btn.primary { background: var(--btn-grad); box-shadow: var(--btn-shadow); }
/* Plan gratis: la primera opción, encima de los de pago. */
.free {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px;
  padding: 18px 20px; border-radius: 20px; background: var(--blue-soft);
}
.free h2 { margin: 0 0 4px; }
.free p { margin: 0; font-size: .95rem; }
.free .btn { flex: none; }

/* ── Instalación ── */
.ok-badge { width: 44px; height: 44px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--alt); margin: 0 0 22px; }
.status-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--gray-2); }
.status-text { flex: 1; min-width: 0; }
.status-text b { display: block; letter-spacing: -.02em; }
.status-text p { margin: 2px 0 0; font-size: .9rem; line-height: 1.4; color: var(--gray); }
.status .btn { flex: none; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.status[data-tone="ok"] { background: var(--green-soft); }
.status[data-tone="ok"] .status-dot { background: var(--green); }
.status[data-tone="ok"] .status-text b { color: var(--green); }
.status[data-tone="warn"] { background: var(--amber-soft); }
.status[data-tone="warn"] .status-dot { background: #e6a100; }

.module { margin: 0 0 18px; }
.module > .btn { margin: 6px 0 2px; }
.howto { margin: 14px 0 0; padding-left: 22px; }
.howto li { margin: 0 0 8px; line-height: 1.45; overflow-wrap: anywhere; }
.howto code, .key code, .snippet pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.howto code { background: var(--alt); border-radius: 6px; padding: 1px 6px; font-size: .84rem; overflow-wrap: anywhere; word-break: break-word; }
.keys { display: grid; gap: 8px; margin: 14px 0 4px; }
.key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key > span { width: 128px; font-size: .9rem; font-weight: 600; line-height: 1.2; }
.key > span small { display: block; font-weight: 400; color: var(--gray-2); }
.key code { flex: 1; min-width: 0; padding: 9px 12px; background: var(--alt); border-radius: 10px; font-size: .82rem; overflow-wrap: anywhere; }

.fold { margin: 0 0 12px; border-radius: 18px; background: var(--alt); padding: 0 16px; }
.fold > summary {
  list-style: none; cursor: pointer; padding: 14px 26px 14px 0; font-weight: 600; letter-spacing: -.02em; position: relative;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--gray-2); border-bottom: 2px solid var(--gray-2); transform: rotate(45deg); transition: transform .2s ease;
}
.fold[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.fold[open] { padding-bottom: 16px; }
.fold .muted { margin: 0 0 12px; font-size: .92rem; }
.fold .plan { background: #fff; }
.snippet { position: relative; }
.snippet pre {
  margin: 0; padding: 14px 92px 14px 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-radius: 12px;
  font-size: .8rem; line-height: 1.55; white-space: pre-wrap; word-break: break-all;
}
.snippet .btn { position: absolute; top: 8px; right: 8px; }
/* «Envíame estas instrucciones»: arriba, antes de los pasos (en el móvil se ve sin bajar). */
.mailme { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.mailme .btn { flex: none; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.mailme .fine { margin: 0; }
.open-theme { margin: 14px 0 0; }
/* Las pestañas saltan de línea en vez de cortarse: en el móvil «Otra web» quedaba fuera. */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button {
  border: 0; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: inherit; font-size: .9rem; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.next { margin: 26px 0 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.next .muted { margin: 0 0 14px; }
.upgrade { margin-bottom: 0; }

@media (max-width: 640px) {
  .top { padding: 12px 16px 4px; gap: 10px; }
  .brand b { font-size: 1.15rem; }
  .brand img { width: 30px; height: 30px; }
  .step { max-width: 170px; gap: 8px; }
  .wrap { padding: 4px 12px 56px; }
  .card { padding: 24px 18px; border-radius: 24px; }
  .card.narrow { padding: 24px 18px; }
  h1 { font-size: 1.5rem; }
  .plans { grid-template-columns: 1fr; }
  .free { flex-direction: column; align-items: stretch; }
  .status { flex-wrap: wrap; }
  .status .btn { width: 100%; min-height: 42px; }
  .mailme { flex-direction: column; align-items: stretch; gap: 8px; }
  .mailme .btn, .module > .btn, .next .btn, .open-theme { width: 100%; }
  .key > span { width: 100%; }
  .key > span small { display: inline; }
  .preview-bar { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .preview-bar .long { display: none; }
  .preview-bar .short { display: inline; }
  .preview-text span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .progress span, .spinner, .reading li.current::before { animation-duration: 3s; }
  .btn, .step i b { transition: none; }
}

/* ── Marco de la vista previa sin réplica (signup-preview.html) ── */
body.plain-preview { display: flex; align-items: flex-start; justify-content: flex-start; padding: 8vh 6vw; }
.plain-card { max-width: 440px; }
.plain-card img { border-radius: 12px; box-shadow: 0 0 0 1px var(--line); margin-bottom: 14px; }
.plain-card h1 { font-size: 1.6rem; }
