:root {
  --cobalt: #17388A;
  --cobalt-deep: #0F275F;
  --cobalt-soft: #EAF0FC;
  --ink: #141B33;
  --muted: #5D6684;
  --line: #D9DFEC;
  --paper: #F5F7FB;
  --white: #FFFFFF;
  --sticker: #FFC52E;
  --sticker-edge: #E5A800;
  --warn: #A33A12;
  --font: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 24px 160px; }

/* ---------- Cabecera ---------- */
.top {
  background: var(--cobalt);
  color: var(--white);
  padding-top: env(safe-area-inset-top, 0px);
  position: sticky; top: 0; z-index: 5;
}
.topin {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 12px; }
.brandsub { font-weight: 400; font-size: 14px; opacity: .75; letter-spacing: 0; }

.track { display: flex; gap: 22px; }
.tseg { display: flex; align-items: center; gap: 8px; opacity: .55; }
.tseg.active, .tseg.complete { opacity: 1; }
.tlabel { font-size: 14px; font-weight: 500; }
.tseg.active .tlabel { font-weight: 700; }
.tdots { display: flex; gap: 4px; }
.tdot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7); }
.tdot.done { background: var(--sticker); border-color: var(--sticker); }
.tdot.now { border-color: var(--sticker); box-shadow: 0 0 0 2px rgba(255,197,46,.35); }

/* ---------- Tipografía y bloques comunes ---------- */
h1 {
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 14px;
  max-width: 22ch;
}
h1:focus { outline: none; }
h2 { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 10px; }
.lead a { color: var(--cobalt); font-weight: 600; }
.lead { font-size: 20px; line-height: 1.5; max-width: 60ch; margin: 0 0 24px; }
.sub { color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.hint { color: var(--muted); font-size: 15px; max-width: 62ch; }
.kicker { color: var(--cobalt); font-weight: 600; margin: 0 0 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.btn {
  font: inherit; font-weight: 600; font-size: 16px;
  border-radius: 999px; padding: 12px 22px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn.primary { background: var(--cobalt); color: var(--white); }
.btn.primary:hover { background: var(--cobalt-deep); }
.btn.primary:disabled { background: #B9C3DB; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--cobalt); border-color: var(--cobalt); }
.btn.ghost:hover { background: var(--cobalt-soft); }
.linkbtn { font: inherit; font-size: 14px; background: none; border: 0; padding: 0; color: var(--cobalt); text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sticker-edge); outline-offset: 3px; }

/* ---------- Bienvenida ---------- */
.welcome { max-width: 760px; }
.funnel { list-style: none; padding: 0; margin: 8px 0 20px; display: grid; gap: 10px; }
.funnel li {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
}
.funnel b { font-size: 18px; }
.funnel span { color: var(--cobalt); font-weight: 600; font-variant-numeric: tabular-nums; }
.nameform { margin-top: 28px; }
.nameform label { display: block; font-weight: 600; margin-bottom: 8px; }
.nameform input {
  font: inherit; font-size: 18px; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--line);
  min-width: 0; flex: 1 1 280px; background: var(--white); color: var(--ink);
}
.nameform input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px var(--cobalt-soft); }
.error { color: var(--warn); font-size: 15px; margin: 8px 0 0; }
.resume { margin-top: 28px; padding: 18px 20px; border-radius: 12px; background: var(--cobalt-soft); }
.resume p { margin: 0 0 12px; }

/* ---------- Intro de bloque ---------- */
.intro { max-width: 760px; padding-top: 24px; }
.chain {
  font-size: clamp(22px, 3.4vw, 34px); font-weight: 700; color: var(--cobalt);
  letter-spacing: -0.02em; margin: 8px 0 18px; font-variant-numeric: tabular-nums;
}

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 12px; }
.grid-values { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-long { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.grid.few.grid-long { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.grid.few.grid-values { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card {
  position: relative; text-align: left; font: inherit; color: var(--ink);
  background: var(--white); border: 2px solid var(--line); border-radius: 14px;
  padding: 16px 44px 16px 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .12s, background-color .12s, opacity .12s;
}
.card:hover { border-color: #9FB0D6; }
.card.on { border-color: var(--cobalt); background: var(--cobalt-soft); }
.card.muted { opacity: .45; }
.card.muted:hover { opacity: .7; }
.vname { font-weight: 700; font-size: 17px; }
.vdesc { color: var(--muted); font-size: 15px; line-height: 1.4; }
.stext { font-size: 16px; line-height: 1.45; }

/* La pegatina de votación: el gesto del taller trasladado a la pantalla */
.sticker {
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px dashed #B9C3DB;
}
.card.on .sticker {
  border: 0; background: var(--sticker);
  box-shadow: inset 0 -2px 0 var(--sticker-edge);
  transform: rotate(-8deg);
  animation: stick .18s ease-out;
}
.card.on .sticker::after {
  content: ""; position: absolute; left: 7px; top: 4px; width: 6px; height: 11px;
  border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
@keyframes stick { from { transform: scale(1.5) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }

/* ---------- Barra inferior ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--white); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(20, 27, 51, .08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.barin { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; }
.count { flex: 1; min-width: 0; }
.countline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 16px; }
.countline b { font-size: 22px; font-variant-numeric: tabular-nums; }
.status { font-size: 14px; color: var(--muted); margin-top: 2px; }
.status.warn { color: var(--warn); font-weight: 600; }
.slots { display: inline-flex; gap: 6px; }
.slot { width: 18px; height: 18px; border-radius: 50%; border: 2px dashed #B9C3DB; }
.slot.filled { border: 0; background: var(--sticker); box-shadow: inset 0 -2px 0 var(--sticker-edge); }
.fill { display: inline-block; width: 180px; max-width: 40vw; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fill span { display: block; height: 100%; background: var(--sticker); border-radius: 99px; transition: width .15s; }

/* ---------- Resultado ---------- */
.result { max-width: 900px; }
.rgrid { display: grid; gap: 16px; margin: 8px 0 28px; }
.rblock { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.rblock ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rblock li { display: flex; gap: 12px; align-items: flex-start; }
.sticker.sm {
  position: static; flex: 0 0 14px; width: 14px; height: 14px; margin-top: 5px;
  border: 0; background: var(--sticker); box-shadow: inset 0 -2px 0 var(--sticker-edge);
}
.tlabel2 { display: block; font-weight: 600; margin-bottom: 8px; }
textarea {
  width: 100%; font: 15px/1.5 var(--font); color: var(--ink);
  border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--white); resize: vertical;
}
.actions { margin: 14px 0 6px; }
.result .row:last-child { margin-top: 24px; }

/* ---------- Móvil ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 28px 16px 170px; }
  .topin { padding: 12px 16px; gap: 10px; }
  .brandsub { display: none; }
  .track { gap: 12px; width: 100%; justify-content: space-between; }
  .tlabel { font-size: 13px; }
  .grid-values, .grid-long, .grid.few.grid-long, .grid.few.grid-values { grid-template-columns: 1fr; }
  .barin { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .count { order: -1; flex-basis: 100%; }
  .barin .btn { flex: 1; }
  .funnel li { flex-direction: column; gap: 2px; }
  .lead { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Propuesta propia y bloque opcional ---------- */
.extra { margin-top: 28px; max-width: 760px; }
.extra label { display: block; font-weight: 600; margin-bottom: 8px; }
.extra textarea { font-size: 16px; }
.own { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); }
.funnel em { font-style: normal; font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 6px; }
.intro .linkbtn { margin-left: 8px; }
