:root {
  --ink: #1d1a33;
  --muted: #6b6880;
  --brand: #4b2ebf;        /* logo + main title only */
  --accent: #4338ca;       /* interactive: buttons, slider, bubbles, links (indigo) */
  --accent-dark: #362ba3;
  --pale-blue: #c7d2fe;    /* barras: azul pálido */
  --pale-purple: #e9d5ff;  /* barras: morado pálido */
  --pale-purple-mid: #d8b4fe;  /* Q2: desglose de la parte facturada */
  --pale-purple-2: #f3e8ff;
  --thumb: #818cf8;        /* controles: índigo medio, visible sin gritar */
  --good: #17805c;
  --bg: #f5f4fb;
  --card: #ffffff;
  --line: #e4e1f0;
  --err: #c0392b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
.wrap { max-width: 540px; margin: 0 auto; padding: 24px 16px 48px; }
.hero {
  background: #efeafb; border: 1px solid var(--line); border-radius: 20px; text-align: center;
  padding: 28px 22px 24px; margin-bottom: 18px;
}
.hero .logo { display: block; height: 38px; width: auto; margin: 0 auto 14px; }
.hero h1 { color: var(--brand); font-size: 25px; line-height: 1.25; margin: 10px 0 8px; }
.hero .sub { color: var(--muted); margin: 0 auto; max-width: 440px; }
.brand { font-weight: 800; color: var(--brand); font-size: 26px; letter-spacing: -.5px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; margin-top: 22px; box-shadow: 0 6px 24px rgba(23,33,51,.05);
}
.field { display: block; margin-bottom: 30px; }
.field > span { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
input[type="tel"], input[type="text"] {
  width: 100%; padding: 14px 14px; font-size: 17px; border: 1.5px solid var(--line);
  border-radius: 12px; outline: none; background: #fff; color: var(--ink);
}
input[type="tel"]:focus, input[type="text"]:focus { border-color: var(--accent); }
select {
  width: 100%; padding: 14px 14px; font-size: 17px; border: 1.5px solid var(--line);
  border-radius: 12px; outline: none; background: #fff; color: var(--ink); appearance: none;
}
select:focus { border-color: var(--accent); }
.slider-full {
  display: block; width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none;
  height: 16px; border-radius: 999px; background: var(--line); outline: none; margin: 6px 0 16px;
}
.slider-full::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--thumb); cursor: pointer; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(23,33,51,.25);
}
.slider-full::-moz-range-thumb {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); cursor: pointer;
  border: 4px solid #fff; box-shadow: 0 2px 8px rgba(23,33,51,.35);
}
.split-bar {
  display: flex; width: 100%; height: 88px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
}
.seg {
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff;
  overflow: hidden; padding: 0 6px; text-align: center; transition: width .14s ease;
}
.seg b { font-size: 24px; font-weight: 800; line-height: 1.1; }
.seg em { font-style: normal; font-size: 11px; font-weight: 600; line-height: 1.2;
          opacity: .9; margin-top: 3px; overflow-wrap: anywhere; }
.seg.narrow { padding: 0 3px; }
.seg.narrow b { font-size: 17px; }
.seg.narrow em { font-size: 10.5px; }
.seg-clin { background: var(--pale-blue); color: var(--ink); }
.seg-priv { background: var(--pale-purple); color: var(--ink); }
.seg-emp  { background: var(--pale-purple-mid); color: var(--ink); }
.seg-pac  { background: var(--pale-purple-2); color: var(--ink); }
.bubbles { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0 0; }
.bubble { flex: 1 1 0; max-width: 58px; }
.bubble input { position: absolute; opacity: 0; width: 0; height: 0; }
.bubble span {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font-size: 18px; font-weight: 700; cursor: pointer; transition: all .12s ease;
}
.bubble input:checked + span {
  background: var(--pale-blue); color: var(--ink); border-color: var(--thumb);
  box-shadow: 0 2px 6px rgba(129,140,248,.35);
}
.bubble input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.id-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.id-row input { flex: 1; }
.id-row .status { font-size: 20px; width: 24px; text-align: center; }
.id-row .status.ok { color: var(--good); }
.id-row .status.bad { color: var(--err); }
.id-err { color: var(--err); font-size: 13px; margin: -2px 0 8px 2px; min-height: 0; }
.hint { color: var(--muted); font-size: 13px; display: block; margin-top: 8px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 6px 0 18px; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.submit {
  width: 100%; padding: 16px; font-size: 18px; font-weight: 700; color: #fff;
  background: var(--accent); border: none; border-radius: 12px; cursor: pointer;
}
.submit:hover { background: var(--accent-dark); }
.submit:disabled { opacity: .6; cursor: default; }
.err { color: var(--err); font-size: 14px; display: block; margin-top: 10px; }
.legal { color: var(--muted); font-size: 12.5px; margin: 16px 0 0; text-align: center; }
.legal a, .foot a { color: var(--accent); }
.done { text-align: center; }
.done .check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--good); color: #fff;
  font-size: 34px; line-height: 64px; margin: 0 auto 10px;
}
.hidden { display: none; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }
/* Second question keeps its own colour on the handle too. */
#empresa::-webkit-slider-thumb { background: #a855f7; }
#empresa::-moz-range-thumb { background: #a855f7; }
