/* Briefing de Marca COINSSALUD — design tokens + componentes.
   Paleta provisional: se reemplaza aquí cuando se apruebe el logo. */

:root {
  --navy: #0D1B3D;
  --green: #22A35A;
  --teal: #0097A7;
  --gray: #6B7280;
  --bg: #F7F9FC;
  --white: #FFFFFF;

  --ink: #0D1B3D;
  --ink-2: #47506A;
  --line: #E3E8F0;
  --line-strong: #CBD5E3;
  --error: #C0392B;
  --error-bg: #FDF0EE;
  --ok-bg: #E9F7EF;

  --sans: 'Manrope', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(13, 27, 61, .04), 0 8px 24px rgba(13, 27, 61, .06);
  --shadow-lg: 0 24px 60px rgba(13, 27, 61, .14);
  --ring: 0 0 0 3px rgba(0, 151, 167, .28);
  --maxw: 760px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 800; }
p { margin: 0; }
button { font-family: inherit; font-size: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Landing ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #0D1B3D 0%, #12285A 60%, #0F3D53 100%);
  color: #fff; padding: 78px 0 86px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(680px 340px at 82% 8%, rgba(34, 163, 90, .26), transparent 70%),
    radial-gradient(520px 300px at 4% 96%, rgba(0, 151, 167, .24), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #6FE0A2; display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 30px; height: 3px; border-radius: 2px; background: var(--green); }
.hero h1 { font-size: clamp(32px, 6vw, 52px); margin-bottom: 20px; }
.hero .lede { font-size: clamp(17px, 2.2vw, 19px); color: #C6D3EA; max-width: 60ch; }

.facts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.fact {
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px; padding: 9px 18px; font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; gap: 9px;
}
.fact b { color: #6FE0A2; font-weight: 800; }

.privacy-note {
  margin-top: 30px; padding: 16px 20px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  font-size: 14.5px; color: #C6D3EA; max-width: 62ch;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  appearance: none; border: 0; border-radius: var(--r-sm); cursor: pointer;
  font-weight: 700; padding: 15px 30px; font-size: 16.5px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.btn-primary { background: var(--green); color: #06331A; box-shadow: 0 8px 22px rgba(34, 163, 90, .32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(34, 163, 90, .4); }
.btn-lg { padding: 18px 40px; font-size: 18px; margin-top: 34px; }
.btn-ghost { background: var(--white); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--gray); transform: translateY(-1px); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 15px 18px; }
.btn-quiet:hover { color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Progress ────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(247, 249, 252, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 16px; padding: 14px 22px; max-width: var(--maxw); margin: 0 auto; }
.brand { font-weight: 800; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--green); }
.track { flex: 1; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.track-fill {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--green));
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
.pct { font-size: 13.5px; font-weight: 700; color: var(--ink-2); min-width: 36px; text-align: right; }
.saved {
  font-size: 12.5px; font-weight: 700; color: var(--green); opacity: 0;
  transition: opacity .3s; white-space: nowrap;
}
.saved.on { opacity: 1; }

/* ── Section ─────────────────────────────────────────────── */
main { padding: 46px 0 100px; }
.step-meta { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }
.sec-title { font-size: clamp(26px, 4.4vw, 34px); margin-bottom: 12px; }
.sec-desc { color: var(--ink-2); margin-bottom: 40px; font-size: 17px; }

.section { animation: rise .45s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Question card ───────────────────────────────────────── */
.q {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; margin-bottom: 20px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.q:focus-within { border-color: var(--teal); box-shadow: var(--shadow), 0 0 0 4px rgba(0, 151, 167, .1); }
.q.invalid { border-color: var(--error); background: var(--error-bg); }
.q-label { font-weight: 700; font-size: 17.5px; margin-bottom: 6px; display: block; letter-spacing: -.01em; }
.q-code { color: var(--gray); font-weight: 700; font-size: 13px; margin-right: 8px; }
.req { color: var(--error); margin-left: 4px; }
.q-help { color: var(--gray); font-size: 14.5px; margin-bottom: 16px; }
.q-body { margin-top: 16px; }
.err { color: var(--error); font-size: 14.5px; font-weight: 600; margin-top: 12px; display: none; }
.q.invalid .err { display: block; }

/* ── Inputs ──────────────────────────────────────────────── */
input[type=text], input[type=date], textarea, .other-in {
  width: 100%; padding: 14px 16px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); font: inherit; color: var(--ink); background: var(--white);
  transition: border-color .16s, box-shadow .16s;
}
input[type=text]:focus, input[type=date]:focus, textarea:focus, .other-in:focus {
  outline: 0; border-color: var(--teal); box-shadow: var(--ring);
}
textarea { min-height: 128px; resize: vertical; line-height: 1.6; }
.repeat-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.repeat-row input { flex: 1; }
.people-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 10px; }
@media (max-width: 560px) { .people-row { grid-template-columns: 1fr; } }
.mini {
  border: 1px solid var(--line-strong); background: var(--white); color: var(--ink-2);
  border-radius: 8px; width: 42px; height: 42px; cursor: pointer; font-size: 17px;
  display: grid; place-items: center; flex-shrink: 0; transition: .16s;
}
.mini:hover { border-color: var(--teal); color: var(--teal); }
.mini:focus-visible { outline: 0; box-shadow: var(--ring); }
.add-more { margin-top: 4px; background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-2);
  border-radius: var(--r-sm); padding: 11px 18px; cursor: pointer; font-weight: 600; transition: .16s; }
.add-more:hover { border-color: var(--teal); color: var(--teal); }

/* ── Choice (radio / checkbox) ───────────────────────────── */
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 13px; padding: 15px 17px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer;
  background: var(--white); transition: border-color .16s, background .16s, transform .12s;
}
.choice:hover { border-color: var(--teal); transform: translateY(-1px); }
.choice input { margin: 3px 0 0; width: 19px; height: 19px; accent-color: var(--green); flex-shrink: 0; cursor: pointer; }
.choice.on { border-color: var(--green); background: var(--ok-bg); }
.choice:focus-within { box-shadow: var(--ring); }
.choice.disabled { opacity: .45; cursor: not-allowed; }
.choice-txt { flex: 1; }
.count-note { font-size: 13.5px; color: var(--gray); margin-top: 10px; font-weight: 600; }

/* ── Scale ───────────────────────────────────────────────── */
.scale-ends { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--gray); margin-bottom: 12px; font-weight: 600; }
.scale-ends span:last-child { text-align: right; }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.scale button {
  aspect-ratio: 1; border: 1px solid var(--line-strong); background: var(--white);
  border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--ink-2);
  transition: .16s; font-size: 15px;
}
.scale button:hover { border-color: var(--teal); color: var(--teal); }
.scale button:focus-visible { outline: 0; box-shadow: var(--ring); }
.scale button.on { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.06); }
@media (max-width: 560px) { .scale { grid-template-columns: repeat(5, 1fr); } }

/* ── Ranking ─────────────────────────────────────────────── */
.rank { display: grid; gap: 9px; }
.rank-item {
  display: flex; align-items: center; gap: 13px; padding: 13px 15px; background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: grab;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.rank-item:hover { border-color: var(--teal); }
.rank-item.dragging { opacity: .45; }
.rank-item.over { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34, 163, 90, .16); }
.rank-n {
  width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.rank-txt { flex: 1; font-weight: 600; }
.rank-btns { display: flex; gap: 6px; }
.rank-btns .mini { width: 34px; height: 34px; font-size: 14px; }

/* ── Files ───────────────────────────────────────────────── */
.drop {
  border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 34px 22px;
  text-align: center; cursor: pointer; transition: .16s; background: #FCFDFF;
}
.drop:hover, .drop.over { border-color: var(--teal); background: #F2FBFC; }
.drop strong { display: block; font-size: 16.5px; margin-bottom: 5px; }
.drop span { color: var(--gray); font-size: 14.5px; }
.files { margin-top: 14px; display: grid; gap: 9px; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px;
}
.file-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-row .sz { color: var(--gray); font-size: 13.5px; }

/* ── Colors (Q34) ────────────────────────────────────────── */
.color-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.color-row input[type=color] {
  width: 52px; height: 46px; padding: 3px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: var(--white); cursor: pointer; flex-shrink: 0;
}

/* ── Nav ─────────────────────────────────────────────────── */
.nav { display: flex; gap: 12px; align-items: center; margin-top: 34px; }
.nav .spacer { flex: 1; }

/* ── Review ──────────────────────────────────────────────── */
.rev-sec { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow); }
.rev-head { display: flex; align-items: center; gap: 14px; padding: 18px 24px; background: #FBFCFE; border-bottom: 1px solid var(--line); }
.rev-head h3 { flex: 1; font-size: 18px; }
.rev-body { padding: 8px 24px 20px; }
.rev-q { padding: 15px 0; border-bottom: 1px solid var(--line); }
.rev-q:last-child { border-bottom: 0; }
.rev-q .k { font-size: 14.5px; color: var(--gray); font-weight: 600; margin-bottom: 5px; }
.rev-q .v { font-weight: 600; white-space: pre-wrap; }
.rev-q .v.empty { color: var(--gray); font-weight: 400; font-style: italic; }
.rev-q.missing .k { color: var(--error); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 3px; }
.chip { background: var(--ok-bg); border: 1px solid #B6E4C8; color: #14683A; border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 600; }
.warn {
  background: var(--error-bg); border: 1px solid #F3C8C1; color: #8E2A1D;
  border-radius: var(--r-sm); padding: 16px 20px; margin-bottom: 22px; font-weight: 600;
}
.consent { display: flex; gap: 13px; align-items: flex-start; padding: 17px; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r-sm); margin-bottom: 12px; cursor: pointer; }
.consent input { margin: 3px 0 0; width: 19px; height: 19px; accent-color: var(--green); flex-shrink: 0; }

/* ── Done ────────────────────────────────────────────────── */
.done { text-align: center; padding: 70px 0; animation: rise .5s cubic-bezier(.22,1,.36,1) both; }
.done .tick {
  width: 82px; height: 82px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; margin: 0 auto 28px; font-size: 42px;
  box-shadow: 0 14px 36px rgba(34, 163, 90, .34); animation: pop .55s cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done h2 { font-size: clamp(26px, 5vw, 36px); margin-bottom: 14px; }
.done p { color: var(--ink-2); max-width: 52ch; margin: 0 auto; }

footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--gray); font-size: 14px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
