:root {
  --forest: #0a2620;
  --forest2: #0f3a2e;
  --forest3: #145040;
  --neon: #3cff6e;
  --lime: #a4c93c;
  --green: #3fb76a;
  --teal: #13a0a0;
  --mint: #7fe3c8;
  --ink: #16221e;
  --ink-soft: #56675f;
  --line: #e2ebe7;
  --soft: #f3f9f5;
  --btn: #3cff6e;
  --btn-ink: #062016;

  --fondo: var(--forest);
  --card: #ffffff;
  --elev: rgba(255, 255, 255, 0.05);
  --texto: #eaf5f0;
  --suave: #a9c7bb;
  --oro: var(--neon);
  --oro-texto: var(--btn-ink);
  --borde: rgba(60, 255, 110, 0.18);
  --danger: #ff7a6b;
  --radio: 22px;

  --head: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--forest);
  color: var(--texto);
  font-family: var(--body);
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 50% at 80% 0%, rgba(19, 160, 160, 0.32), transparent 60%),
    radial-gradient(ellipse 70% 45% at 0% 100%, rgba(164, 201, 60, 0.22), transparent 60%),
    var(--forest);
  background-attachment: fixed;
}

button,
input,
textarea,
a {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.boot {
  text-align: center;
  color: var(--suave);
  padding: 40vh 24px;
  font-size: 16px;
}

.shell {
  width: min(520px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 14px 20px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- Cabecera ---------- */

.banner {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  align-self: center;
  margin: 0 auto 14px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(10, 38, 32, 0.82);
  border: 1px solid rgba(60, 255, 110, 0.35);
  box-shadow: 0 0 18px rgba(60, 255, 110, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #cfe9de;
  text-align: center;
}

.banner b {
  color: var(--neon);
  font-weight: 800;
}

.wordmark {
  display: block;
  width: 260px;
  max-width: 72vw;
  aspect-ratio: 34 / 9;
  height: auto;
  margin: 2px auto 22px;
  object-fit: cover;
  object-position: center;
}

.kicker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  font-family: var(--head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--neon);
  margin-bottom: 12px;
}

.kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

h1,
.h1 {
  font-family: var(--head);
  font-weight: 800;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  color: #fff;
  text-align: center;
  text-wrap: balance;
}

.neonw {
  color: var(--neon);
  text-shadow: 0 0 18px rgba(60, 255, 110, 0.55);
}

.lead {
  margin: 0 0 26px;
  color: #cfe9de;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}

.micro {
  margin: 16px 0 0;
  text-align: center;
  color: var(--suave);
  font-size: 14px;
}

/* ---------- Botones ---------- */

.btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 100px;
  padding: 17px 26px;
  background: var(--btn);
  color: var(--btn-ink);
  font-family: var(--head);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgba(60, 255, 110, 0.5), 0 14px 34px -14px rgba(60, 255, 110, 0.7);
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.25s ease;
  animation: pulso 2.8s infinite;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: brillo 3.6s ease-in-out infinite;
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
  transform: none;
}

.btn[disabled]::after {
  display: none;
}

@keyframes pulso {
  0% {
    box-shadow: 0 0 0 0 rgba(60, 255, 110, 0.45), 0 14px 34px -14px rgba(60, 255, 110, 0.7);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(60, 255, 110, 0), 0 14px 34px -14px rgba(60, 255, 110, 0.7);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(60, 255, 110, 0), 0 14px 34px -14px rgba(60, 255, 110, 0.7);
  }
}

@keyframes brillo {
  0%,
  60% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.btn-ghost {
  background: transparent;
  color: var(--texto);
  border: 1px solid var(--borde);
  animation: none;
  box-shadow: none;
}

.btn-lock {
  background: var(--forest2);
  color: var(--neon);
}

/* ---------- Progreso ---------- */

.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s;
}

.icon-btn:hover {
  border-color: var(--neon);
  background: rgba(60, 255, 110, 0.1);
}

.icon-btn[hidden] {
  visibility: hidden;
}

.progress-wrap {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--lime), var(--neon));
  box-shadow: 0 0 12px rgba(60, 255, 110, 0.6);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.progress-label {
  text-align: center;
  font-family: var(--head);
  font-size: 13px;
  font-weight: 700;
  color: var(--mint);
  margin: 10px 0 4px;
}

.bloque-micro {
  margin: 0 0 14px;
  text-align: center;
  color: var(--suave);
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- Tarjeta blanca (pregunta y formulario) ---------- */

.q-card,
.card-datos,
.gate {
  --texto: var(--ink);
  --suave: var(--ink-soft);
  --borde: var(--line);
  --danger: #c0392b;
  position: relative;
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 24px 20px 20px;
  box-shadow:
    0 0 0 1px rgba(60, 255, 110, 0.4),
    0 0 60px -10px rgba(60, 255, 110, 0.4),
    0 40px 90px -30px rgba(0, 0, 0, 0.7);
}

.q-text {
  font-family: var(--head);
  font-size: 21px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  color: var(--ink);
}

.opts {
  display: grid;
  gap: 10px;
}

.opts .btn {
  margin-top: 8px;
}

.opt {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 15px 52px 15px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  min-height: 56px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.opt::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  border: 2px solid #c9d8d1;
  background: #fff;
  transition: all 0.15s;
}

.opt:hover {
  border-color: var(--green);
}

.opt.is-on {
  border-color: var(--green);
  background: #eafff0;
  box-shadow: 0 0 0 1px var(--green), 0 6px 18px -8px rgba(60, 255, 110, 0.7);
  font-weight: 500;
}

.opt.is-on::after {
  border-color: var(--neon);
  background: var(--neon)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23062016' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 14px no-repeat;
  box-shadow: 0 0 10px rgba(60, 255, 110, 0.7);
}

.texto-q {
  display: grid;
  gap: 14px;
}

.area-txt {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}

.area-txt:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  background: #fff;
}

/* ---------- Formulario de datos ---------- */

.card-datos {
  margin-top: 4px;
  padding: 26px 22px 20px;
}

.card-datos .tag {
  display: table;
  margin: 0 auto 14px;
  font-family: var(--head);
  font-weight: 800;
  font-size: 12px;
  color: var(--btn-ink);
  background: var(--neon);
  border-radius: 100px;
  padding: 6px 14px;
  box-shadow: 0 0 18px rgba(60, 255, 110, 0.5);
}

.card-datos h1 {
  color: var(--ink);
  font-size: clamp(26px, 7vw, 32px);
  margin-bottom: 8px;
}

.card-datos .lead {
  color: var(--ink-soft);
  margin-bottom: 20px;
  font-size: 15px;
}

.field {
  margin-bottom: 10px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.field input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(60, 255, 110, 0.18);
}

.rgpd {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--suave);
  font-size: 13px;
  line-height: 1.45;
  margin: 12px 0 16px;
}

.rgpd input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.rgpd a {
  color: var(--green);
}

.aviso {
  text-align: center;
  color: var(--suave);
  font-size: 13px;
  line-height: 1.45;
  margin: 12px 0 0;
}

.aviso + .kicker {
  margin-top: 22px;
}

.err {
  color: var(--danger);
  font-size: 14px;
  margin: 0 0 10px;
  text-align: center;
}

/* ---------- Calculando ---------- */

.calc {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 12vh;
}

.spinner {
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--neon);
  box-shadow: 0 0 24px rgba(60, 255, 110, 0.25);
  animation: spin 0.9s linear infinite;
}

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

/* ---------- Resultado ---------- */

.gauge-wrap {
  display: grid;
  place-items: center;
  margin: 8px auto 24px;
  position: relative;
  width: 210px;
  height: 210px;
}

.gauge-wrap svg {
  width: 210px;
  height: 210px;
  transform: rotate(-90deg);
}

.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gauge-n {
  font-family: var(--head);
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.gauge-tag {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--neon);
}

.h-result {
  text-align: center;
  font-size: clamp(24px, 6vw, 30px);
  color: #fff;
}

.brecha {
  text-align: center;
  color: var(--suave);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 24px;
}

.pilar-snap {
  display: grid;
  gap: 12px;
  margin: 8px 0 22px;
}

.pilar-card {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
}

.pilar-card.is-weak {
  border-color: rgba(60, 255, 110, 0.6);
  background: rgba(60, 255, 110, 0.07);
  box-shadow: 0 0 24px -6px rgba(60, 255, 110, 0.35);
}

.pilar-card h3 {
  margin: 4px 0 6px;
  font-family: var(--head);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  color: #fff;
}

.pilar-card p {
  margin: 0;
  color: var(--suave);
  font-size: 14px;
  line-height: 1.45;
}

.areas {
  position: relative;
  margin: 8px 0 22px;
}

.areas.is-gated {
  min-height: 560px;
  max-height: 640px;
  overflow: hidden;
}

.area {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
}

.area.is-weak {
  border-color: rgba(60, 255, 110, 0.6);
}

.area-copy h3 {
  margin: 0 0 6px;
  font-family: var(--head);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 800;
}

.area-copy p {
  margin: 0;
  color: var(--suave);
  font-size: 14px;
  line-height: 1.5;
}

.area-k {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 800;
  margin-bottom: 4px;
}

.mini-g {
  width: 72px;
  height: 72px;
  position: relative;
}

.mini-g svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.mini-n {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
}

.is-blur {
  filter: blur(9px);
  transform: scale(0.98);
  pointer-events: none;
  user-select: none;
}

.gate {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 22px 18px 18px;
}

.gate-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--green);
  display: grid;
  place-items: center;
}

.gate h2 {
  margin: 0 0 8px;
  text-align: center;
  font-family: var(--head);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--ink);
  width: 100%;
  overflow-wrap: break-word;
}

.gate .hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
  margin: 0 0 18px;
}

.margen {
  padding: 18px;
  border-radius: var(--radio);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 8px 0 22px;
}

.margen .kicker {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.margen h3 {
  margin: 0 0 8px;
  font-family: var(--head);
  font-size: 18px;
}

.margen p {
  margin: 0;
  color: var(--suave);
  font-size: 15px;
  line-height: 1.55;
}

.permalink {
  margin: 6px 0 28px;
  text-align: center;
}

.permalink p {
  color: var(--suave);
  font-size: 14px;
  margin: 0 0 8px;
}

.link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 8px 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.link-row code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--suave);
}

.link-row button {
  border: 0;
  background: transparent;
  color: var(--neon);
  font-size: 13px;
  font-weight: 700;
  padding: 8px;
}

.pdf {
  text-align: center;
  padding: 26px 20px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(60, 255, 110, 0.25);
  margin: 10px 0 22px;
}

.pdf .lock-box {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 14px;
  border: 1px solid rgba(60, 255, 110, 0.35);
  color: var(--neon);
  display: grid;
  place-items: center;
}

.pdf h2 {
  font-family: var(--head);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 10px;
  color: #fff;
}

.pdf .sub {
  font-size: 17px;
  margin: 0 0 12px;
}

.pdf .cuerpo {
  color: var(--suave);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 20px;
}

.cta-note {
  text-align: center;
  color: var(--suave);
  font-size: 14px;
  margin: 12px 0 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  max-width: 90vw;
  padding: 12px 18px;
  border-radius: 100px;
  background: var(--forest2);
  border: 1px solid rgba(60, 255, 110, 0.4);
  color: #fff;
  font-family: var(--head);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.reset {
  display: block;
  margin: 24px auto 0;
  border: 0;
  background: transparent;
  color: var(--suave);
  font-size: 14px;
  text-decoration: underline;
}

/* ---------- Portada ---------- */

.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 4vh;
}

.home-hero .btn {
  margin-top: 4px;
}

.marq {
  margin: 28px -20px 0;
  overflow: hidden;
  background: var(--forest2);
  color: #cfe9de;
  border-top: 1px solid rgba(60, 255, 110, 0.15);
  border-bottom: 1px solid rgba(60, 255, 110, 0.15);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marq .track {
  display: flex;
  gap: 2rem;
  width: max-content;
  padding: 0.85rem 0;
  animation: marq 38s linear infinite;
  font-family: var(--head);
  font-weight: 700;
  font-size: 14px;
}

.marq .track span {
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  white-space: nowrap;
}

.marq .track span::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
}

@keyframes marq {
  to {
    transform: translateX(-50%);
  }
}

@media (min-width: 700px) {
  .q-card {
    padding: 30px 28px 26px;
  }

  .q-text {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .progress-bar,
  .opt,
  .btn,
  .btn::after,
  .marq .track {
    animation: none;
    transition: none;
  }
}
