/* Mr Prot · Encuesta pública · mobile first, una columna */

.skip { position: absolute; left: -9999px; top: 8px; background: var(--panel); color: var(--fg); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

.wrap { max-width: 560px; margin-inline: auto; padding: 16px 16px calc(112px + env(safe-area-inset-bottom)); outline: none; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-row { max-width: 560px; margin-inline: auto; padding: 10px 16px 8px; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.brand { font-size: 1.15rem; flex: none; }
.block-name { flex: 1 1 auto; min-width: 0; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.counter { flex: none; white-space: nowrap; font-size: .875rem; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--line); }
.progress-fill { height: 100%; width: 0; background: var(--rainbow); background-size: 560px 100%; transition: width .25s ease; }

/* ---------- Pantalla ---------- */
.screen { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
@media (max-width: 380px) { .card { padding: 16px; } }

.q-head { display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 80px; }
.q-context { margin: 0; color: var(--muted); font-size: .95rem; }
.q-title { margin: 0; font-size: 1.35rem; line-height: 1.25; font-weight: 700; letter-spacing: -.005em; outline: none; }
.q-help { margin: 0; color: var(--muted); font-size: .95rem; }
.q-optional { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--tint); border-radius: 999px; padding: 2px 10px; width: fit-content; }
.q-highlight { border-left: 4px solid var(--pink); padding-left: 12px; }

.error { margin: 0; color: var(--danger); font-weight: 700; font-size: .95rem; display: flex; gap: 8px; align-items: flex-start; }
.error:empty { display: none; }
.error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; font-size: .8rem; margin-top: 1px; }

/* ---------- Opciones (single / multi / rank) ---------- */
.options { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; border: 0; }
.opt {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--panel); color: var(--fg); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; font: inherit; font-size: 1rem; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .12s ease, background-color .12s ease;
}
.opt:hover { border-color: var(--line-strong); }
.opt[aria-pressed="true"], .opt[aria-checked="true"] { border-color: var(--purple); background: var(--tint); }
.opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.opt-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt-label { font-weight: 500; }
.opt-sub { font-size: .85rem; font-weight: 700; color: var(--purple-ink); }

/* indicador a la izquierda */
.mark { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line-strong); color: var(--muted); font-weight: 700; font-size: 1.1rem; line-height: 1; }
.mark.square { border-radius: 8px; }
.opt[aria-checked="true"] .mark, .opt[aria-pressed="true"] .mark { background: var(--purple); border-color: var(--purple); color: var(--on-mark); }
.mark svg { width: 16px; height: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--on-mark); }

/* ranking: insignia numerada + check */
.rank-badge { flex: none; min-width: 44px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: var(--purple); color: var(--on-mark); font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }
.rank-plus { flex: none; width: 44px; height: 32px; display: grid; place-items: center; border-radius: 999px; border: 2px dashed var(--line-strong); color: var(--muted); font-size: 1.3rem; font-weight: 700; }
.rank-check { flex: none; width: 24px; height: 24px; color: var(--green-ink); }
.rank-status { margin: 0; font-size: .9rem; color: var(--muted); font-weight: 500; }

/* escala 1–5 */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale .opt { justify-content: center; min-height: 56px; font-size: 1.2rem; font-weight: 700; padding: 0; }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--muted); font-weight: 500; margin-top: 6px; }

/* campos de texto */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.input, .textarea, .select {
  width: 100%; font: inherit; font-size: 16px; /* 16px evita el zoom de iOS */
  color: var(--fg); background: var(--panel); border: 2px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 48px;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.4; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--purple); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 25%, transparent); }
.charcount { align-self: flex-end; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.other-field { margin-top: 4px; }

/* dinero (Van Westendorp) */
.money { display: flex; align-items: center; gap: 10px; }
.money .input { font-size: 1.6rem; font-weight: 700; max-width: 180px; text-align: right; font-variant-numeric: tabular-nums; }
.money-unit { font-size: 1.6rem; font-weight: 700; }

/* slider de precio */
.price-display { text-align: center; padding: 8px 0 4px; }
.price-value { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 3.4rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--fg); }
.price-value.empty { color: var(--line-strong); }
.price-hint { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.slider-row { display: flex; align-items: center; gap: 10px; }
.step-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--panel); color: var(--fg); font-size: 1.5rem; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.step-btn:hover { border-color: var(--purple); }
.range { flex: 1 1 auto; min-width: 0; -webkit-appearance: none; appearance: none; height: 44px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: var(--rainbow); }
.range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--rainbow); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--panel); border: 3px solid var(--purple); box-shadow: var(--shadow); }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--panel); border: 3px solid var(--purple); }
.range.untouched::-webkit-slider-thumb { border-color: var(--line-strong); }
.range.untouched::-moz-range-thumb { border-color: var(--line-strong); }
.range-ends { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-weight: 700; margin-top: -4px; }
.specials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.specials .opt { justify-content: center; text-align: center; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* consentimientos */
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.consent input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--purple); }
.consent span { font-size: .95rem; }
.fineprint { margin: 0; font-size: .85rem; color: var(--muted); }
.fineprint a, .q-help a, .intro a { color: var(--purple-ink); font-weight: 700; }

.phone { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }

/* ---------- Barra inferior ---------- */
.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.navbar-row { max-width: 560px; margin-inline: auto; padding: 12px 16px; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

.btn { min-height: 52px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 1rem; padding: 0 20px; cursor: pointer; border: 2px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-ink); }
.btn-primary[aria-disabled="true"] { background: var(--line-strong); color: var(--fg); cursor: not-allowed; }
.btn-secondary { background: var(--panel); color: var(--fg); border-color: var(--line-strong); }
.btn-secondary:disabled { opacity: .4; cursor: default; }
.btn-ghost { background: transparent; color: var(--purple-ink); border: 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.btn-block { width: 100%; }

/* ---------- Intro / final ---------- */
.intro { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.intro h1 { margin: 0; font-size: clamp(2rem, 9vw, 2.8rem); }
.intro .lead { margin: 0; font-size: 1.1rem; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--tint); font-weight: 700; font-size: .9rem; }
.chip svg { width: 16px; height: 16px; }
.privacy-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: .95rem; }
.privacy-box p { margin: 0; }
.resume-box { background: var(--tint); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.resume-box p { margin: 0; }
.intro-logo { height: 40px; width: auto; align-self: flex-start; }

.done { text-align: center; align-items: center; padding-top: 24px; }
.done h1 { margin: 0; font-size: clamp(2.2rem, 10vw, 3rem); }
.done-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.done-icon svg { width: 40px; height: 40px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--pink); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 640px) {
  .wrap { padding-top: 28px; }
  .q-title { font-size: 1.5rem; }
}

.q-body { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.q-error-wrap { margin-top: 12px; }
.wordmark-sm { font-size: 1.4rem; align-self: flex-start; }
.wordmark-lg { font-size: 2rem; }

/* páginas legales */
.legal { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.legal h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); margin: 0 0 8px; }
.legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.legal p, .legal li { font-size: 1rem; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
.legal .fill { background: #fff1e0; color: #8a4300; font-weight: 700; padding: 0 4px; border-radius: 4px; }
.legal .draft { background: var(--tint); border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 500; }
.legal a { color: var(--purple-ink); font-weight: 700; }
