/* Step-by-step questionnaire for Nuevos ingresos (pattern: shadcn "questionnaire"). */
.cbp-q {
  --q-navy: #161B4D;
  --q-blue: #28328F;
  --q-red: #AD2424;
  --q-sky: #CFE6F8;
  --q-ink: #161616;
  --q-muted: #5b6070;
  --q-line: #dfe1e8;
  --q-bg: #ffffff;
  --q-soft: #f5f7fb;
  max-width: 720px;
  margin: 0 auto;
  font-family: "Geologica", sans-serif;
  color: var(--q-ink);
}
.cbp-q *, .cbp-q *::before, .cbp-q *::after { box-sizing: border-box; }
.cbp-q__form { display: flex; flex-direction: column; gap: 24px; margin: 0; }
.cbp-q__form[hidden] { display: none; }

/* Progress */
.cbp-q__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cbp-q__progress { flex: 1; height: 6px; border-radius: 999px; background: var(--q-line); overflow: hidden; }
.cbp-q__progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--q-blue); transition: width .35s ease; }
.cbp-q__count { font-size: 13px; font-weight: 500; color: var(--q-muted); white-space: nowrap; }

/* Step */
.cbp-q__step { border: 0; margin: 0; padding: 0; min-width: 0; display: none; flex-direction: column; gap: 16px; }
.cbp-q__step.is-active { display: flex; animation: cbp-q-in .3s ease both; }
.cbp-q__step.is-back { animation-name: cbp-q-in-back; }
@keyframes cbp-q-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cbp-q-in-back { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cbp-q__step.is-active { animation: none; } .cbp-q__progress span { transition: none; } }

.cbp-q__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cbp-q__title { float: none; width: auto; padding: 0; margin: 0; font-size: 24px; line-height: 1.25; font-weight: 600; color: var(--q-navy); display: flex; gap: 10px; }
.cbp-q__num { color: var(--q-blue); font-size: 15px; line-height: 1; padding-top: 7px; white-space: nowrap; }
.cbp-q__num::after { content: " →"; }
.cbp-q__desc { margin: -6px 0 0; font-size: 15px; color: var(--q-muted); }
.cbp-q__badge { flex: none; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--q-sky); color: var(--q-blue); white-space: nowrap; }

/* Text fields */
.cbp-q__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.cbp-q__field { display: flex; flex-direction: column; gap: 6px; }
.cbp-q__field label { font-size: 14px; font-weight: 600; color: var(--q-ink); margin: 0; }
.cbp-q__field label .cbp-q__req { color: var(--q-red); }
.cbp-q .cbp-q__field input {
  width: 100%; height: 48px; margin: 0; padding: 0 14px; font: inherit; font-size: 16px; color: var(--q-ink);
  background: var(--q-bg); border: 1.5px solid var(--q-line); border-radius: 10px; box-shadow: none; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cbp-q .cbp-q__field input:focus { border-color: var(--q-blue); box-shadow: 0 0 0 3px rgba(40, 50, 143, .15); }
.cbp-q .cbp-q__field input[aria-invalid="true"] { border-color: var(--q-red); }

/* Choice cards */
.cbp-q__choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cbp-q__choices--wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cbp-q__choice {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 0; padding: 10px 14px;
  border: 1.5px solid var(--q-line); border-radius: 10px; background: var(--q-bg); cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s; user-select: none;
}
.cbp-q__choice:hover { border-color: #b9bdd0; background: var(--q-soft); }
.cbp-q__choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.cbp-q__key {
  flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--q-line); font: 600 12px/1 "Geologica", sans-serif; color: var(--q-muted); background: var(--q-soft);
}
.cbp-q__text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 500; line-height: 1.3; }
.cbp-q__text small { font-size: 12.5px; font-weight: 400; color: var(--q-muted); }
.cbp-q__mark { flex: none; width: 20px; height: 20px; border: 1.5px solid #b9bdd0; border-radius: 50%; display: grid; place-items: center; transition: all .15s; }
.cbp-q__choice[data-type="checkbox"] .cbp-q__mark { border-radius: 5px; }
.cbp-q__mark::after { content: ""; width: 10px; height: 10px; border-radius: inherit; background: #fff; transform: scale(0); transition: transform .15s; }
.cbp-q__choice[data-type="checkbox"] .cbp-q__mark::after {
  width: 11px; height: 6px; border-radius: 0; background: none; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); margin-top: -3px;
}
.cbp-q__choice:has(input:checked) { border-color: var(--q-blue); background: #eef1fb; box-shadow: 0 0 0 1px var(--q-blue) inset; }
.cbp-q__choice:has(input:checked) .cbp-q__key { background: var(--q-blue); border-color: var(--q-blue); color: #fff; }
.cbp-q__choice:has(input:checked) .cbp-q__mark { background: var(--q-blue); border-color: var(--q-blue); }
.cbp-q__choice:has(input:checked) .cbp-q__mark::after { transform: scale(1); }
.cbp-q__choice[data-type="checkbox"]:has(input:checked) .cbp-q__mark::after { transform: rotate(-45deg) scale(1); }
.cbp-q__choice:has(input:focus-visible) { outline: 2px solid var(--q-blue); outline-offset: 2px; }

/* Errors & actions */
.cbp-q__error { margin: 0; min-height: 0; font-size: 14px; font-weight: 500; color: var(--q-red); }
.cbp-q__error:empty { display: none; }
.cbp-q__actions { display: flex; align-items: center; gap: 12px; padding-top: 8px; border-top: 1px solid var(--q-line); }
.cbp-q__actions .cbp-q__spacer { flex: 1; }
.cbp-q__hint { font-size: 13px; color: var(--q-muted); }
.cbp-q__hint strong { font-weight: 600; color: var(--q-ink); }
.cbp-q .cbp-q__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; margin: 0; padding: 0 22px;
  font: 600 15px/1 "Geologica", sans-serif; letter-spacing: 0; text-transform: none; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--q-navy); background: var(--q-navy); color: #fff; transition: background-color .15s, opacity .15s;
}
.cbp-q .cbp-q__btn:hover { background: var(--q-blue); border-color: var(--q-blue); color: #fff; }
.cbp-q .cbp-q__btn--ghost { background: transparent; color: var(--q-navy); }
.cbp-q .cbp-q__btn--ghost:hover { background: var(--q-soft); color: var(--q-navy); border-color: var(--q-navy); }
.cbp-q .cbp-q__btn[disabled] { opacity: .55; cursor: progress; }
.cbp-q .cbp-q__btn[hidden] { display: none; }

/* Done card */
.cbp-q__done { border: 1.5px solid var(--q-line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px; animation: cbp-q-in .3s ease both; }
.cbp-q__done[hidden] { display: none; }
.cbp-q__done h3 { margin: 0; font-size: 24px; color: var(--q-navy); }
.cbp-q__done p { margin: 0; color: var(--q-muted); font-size: 15px; }
.cbp-q__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cbp-q__chips span { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--q-soft); border: 1px solid var(--q-line); }
.cbp-q__done-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #e7f6ea; color: #1f7a35; font-size: 22px; }
.cbp-q__done.is-error .cbp-q__done-icon { background: #fbe9e9; color: var(--q-red); }

@media (max-width: 767px) {
  .cbp-q__grid { grid-template-columns: minmax(0, 1fr); }
  .cbp-q__title { font-size: 20px; }
  .cbp-q__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cbp-q__choices--wide { grid-template-columns: minmax(0, 1fr); }
  .cbp-q__choice { padding: 10px 12px; gap: 10px; }
  .cbp-q__key { display: none; }
  .cbp-q__hint { display: none; }
  .cbp-q__actions .cbp-q__btn { flex: 1; }
  .cbp-q__actions .cbp-q__spacer { display: none; }
  .cbp-q__done { padding: 20px; }
}
