:root {
  --navy: #1e2a78;
  --navy-dark: #141d57;
  --cyan: #0096d6;
  --ink: #1c2233;
  --muted: #566078;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --line: #d9e0ee;
  --tint: #e9f1fb;
  --ok: #0e7a4e;
  --ok-tint: #e3f5ec;
  --warn-tint: #fff5dc;
  --radius: 14px;
  --bs-body-font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-primary: var(--navy);
  --bs-primary-rgb: 30, 42, 120;
  --bs-link-color: var(--navy);
  --bs-link-hover-color: var(--navy-dark);
}
body { font-size: 1.0625rem; line-height: 1.55; }
h1, h2, h3, .display-font { font-family: "Bricolage Grotesque", "Figtree", system-ui, sans-serif; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* Botões */
.btn { font-weight: 600; border-radius: 10px; padding: .7rem 1.25rem; }
.btn-primary {
  --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy);
  --bs-btn-hover-bg: var(--navy-dark); --bs-btn-hover-border-color: var(--navy-dark);
  --bs-btn-active-bg: var(--navy-dark); --bs-btn-active-border-color: var(--navy-dark);
  --bs-btn-disabled-bg: #8b93c4; --bs-btn-disabled-border-color: #8b93c4;
  --bs-btn-focus-shadow-rgb: 0, 150, 214;
}
.btn-outline-primary {
  --bs-btn-color: var(--navy); --bs-btn-border-color: var(--navy);
  --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy);
  --bs-btn-active-bg: var(--navy-dark); --bs-btn-active-border-color: var(--navy-dark);
}

/* Cabeçalho */
.site-header { background: var(--navy); color: #fff; padding: 1.5rem 0 4.5rem; }
.site-header h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; margin: 0 0 .35rem; }
.site-header p { margin: 0; color: #d3d9f5; max-width: 60ch; }
.site-header .bar { display: inline-block; width: 44px; height: 5px; border-radius: 3px; background: var(--cyan); margin-bottom: .9rem; }
main { margin-top: -3rem; padding-bottom: 3rem; }

/* Cartões base */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20, 29, 87, .07); }
.panel-body { padding: 1.5rem; }
@media (min-width: 768px) { .panel-body { padding: 2rem 2.25rem; } }

/* Indicador de etapas */
.stepper { list-style: none; display: flex; gap: .5rem; margin: 0; padding: 0; }
.stepper li { flex: 1; }
.stepper button {
  width: 100%; text-align: left; background: none; border: 0; padding: 0;
  color: var(--muted); font-weight: 600; font-size: .95rem;
}
.stepper .track { display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: .5rem; }
.stepper .is-done .track { background: var(--cyan); }
.stepper .is-current .track { background: var(--navy); }
.stepper .is-current button { color: var(--navy); }
.stepper .is-done button { color: var(--ink); }
.stepper button:disabled { cursor: default; }
.stepper .label { display: none; }
@media (min-width: 768px) { .stepper .label { display: block; } }
.step-count { color: var(--muted); font-size: .95rem; }
@media (min-width: 768px) { .step-count { display: none; } }

/* Títulos de etapa e perguntas */
.step-title { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 700; margin-bottom: .25rem; }
.step-lead { color: var(--muted); margin-bottom: 1.75rem; }
.q { margin-bottom: 1.75rem; }
.q-label { display: flex; align-items: center; gap: .15rem; font-weight: 600; font-size: 1.05rem; margin-bottom: .5rem; }
.q-label label, .q-label legend { margin: 0; font-size: inherit; font-weight: 600; width: auto; float: none; }
.q-hint { color: var(--muted); font-size: .95rem; margin: -.25rem 0 .6rem; }
.form-control, .form-select { border-radius: 10px; border-color: #b9c3da; padding: .7rem .9rem; font-size: 1.05rem; }
.form-control:focus, .form-select:focus { border-color: var(--cyan); box-shadow: 0 0 0 .2rem rgba(0, 150, 214, .25); }
.input-narrow { max-width: 200px; }
.invalid-feedback { font-size: .95rem; }
.field-error { color: #b02a37; font-size: .95rem; margin-top: .4rem; display: none; }
.field-error.show { display: block; }
.field-error::before { font-family: "bootstrap-icons"; content: "\f333"; margin-right: .35rem; }

/* Botão de ajuda (?) */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--navy); font-size: 1.1rem; flex: none;
}
.info-btn:hover { background: var(--tint); }
.info-btn[aria-expanded="true"] { background: var(--tint); color: var(--navy-dark); }
.popover { --bs-popover-max-width: 320px; --bs-popover-border-color: var(--navy); --bs-popover-header-bg: var(--navy); --bs-popover-header-color: #fff; font-size: .98rem; box-shadow: 0 10px 28px rgba(20, 29, 87, .25); }
.popover-header { font-family: "Figtree", sans-serif; font-weight: 700; font-size: 1rem; }

/* Opções em cartão (radio) */
.choices { display: grid; gap: .75rem; }
.choices.cols-2 { grid-template-columns: 1fr; }
.choices.cols-3 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .choices.cols-2 { grid-template-columns: 1fr 1fr; }
  .choices.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.choice { position: relative; display: block; cursor: pointer; margin: 0; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.choice .box {
  display: flex; gap: .85rem; align-items: flex-start; height: 100%;
  padding: 1rem 1.1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .15s, background-color .15s;
}
.choice:hover .box { border-color: #9fb0d8; }
.choice .dot {
  flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  border: 2px solid #8fa0c8; background: #fff; display: grid; place-items: center;
}
.choice input:checked + .box { border-color: var(--navy); background: var(--tint); }
.choice input:checked + .box .dot { border-color: var(--navy); background: var(--navy); box-shadow: inset 0 0 0 4px #fff; }
.choice input:focus-visible + .box { outline: 3px solid var(--cyan); outline-offset: 2px; }
.choice .t { font-weight: 600; display: block; line-height: 1.3; }
.choice .d { display: block; color: var(--muted); font-size: .93rem; margin-top: .15rem; line-height: 1.4; }

/* Avisos */
.notice { display: flex; gap: .75rem; padding: .9rem 1rem; border-radius: 12px; margin-top: 1rem; font-size: 1rem; }
.notice i { font-size: 1.2rem; flex: none; margin-top: .1rem; }
.notice.info { background: var(--tint); }
.notice.warn { background: var(--warn-tint); }
.notice.stop { background: #fde8ea; }
.notice.good { background: var(--ok-tint); }

/* Dependentes */
.dep-card { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem 1.1rem; margin-bottom: 1rem; background: #fbfcfe; }
.dep-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.dep-head strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.1rem; }
.btn-link-danger { color: #b02a37; font-weight: 600; text-decoration: none; background: none; border: 0; padding: .4rem .5rem; border-radius: 8px; }
.btn-link-danger:hover { background: #fde8ea; }
.dep-grid { display: grid; gap: .9rem; }
@media (min-width: 768px) { .dep-grid { grid-template-columns: 1.4fr 1fr; } }
.dep-note { color: var(--muted); font-size: .93rem; margin-top: .3rem; }

/* Rodapé de navegação */
.nav-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.nav-actions .spacer { flex: 1; }

/* Resumo lateral */
.summary { position: sticky; top: 1rem; }
.summary h2 { font-size: 1.2rem; margin-bottom: .25rem; }
.summary dl { margin: 1rem 0 0; }
.summary dt { color: var(--muted); font-weight: 500; font-size: .9rem; }
.summary dd { margin: 0 0 .8rem; font-weight: 600; }
.summary dd.empty { color: #97a0b5; font-weight: 400; }
.summary .lives { display: flex; align-items: baseline; gap: .5rem; padding: .8rem 1rem; background: var(--tint); border-radius: 12px; }
.summary .lives .n { font-family: "Bricolage Grotesque", sans-serif; font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1; }

/* Resultado */
.result-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.chips li { background: var(--tint); border-radius: 999px; padding: .3rem .85rem; font-size: .95rem; font-weight: 500; }
.plan { position: relative; height: 100%; padding: 1.5rem; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; }
.plan-best { border-color: var(--ok); box-shadow: 0 8px 24px rgba(14, 122, 78, .14); }
.plan-flag { position: absolute; top: -14px; left: 1.25rem; background: var(--ok); color: #fff; font-weight: 700; font-size: .9rem; padding: .25rem .8rem; border-radius: 999px; }
.plan h3 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .1rem; }
.plan .room { color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.plan .amount { font-family: "Bricolage Grotesque", sans-serif; font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 700; color: var(--navy); line-height: 1.1; }
.plan .per { color: var(--muted); }
.plan .tags { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.plan .tag { display: inline-flex; align-items: center; gap: .25rem; background: var(--ok-tint); color: #0b5e3c; font-weight: 600; border-radius: 999px; padding: .1rem .3rem .1rem .75rem; font-size: .93rem; }
.plan details { margin-top: auto; border-top: 1px solid var(--line); padding-top: .8rem; }
.plan summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: .3rem 0; }
.plan table { width: 100%; font-size: .95rem; margin-top: .6rem; }
.plan td { padding: .3rem 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.plan td:last-child { text-align: right; font-weight: 600; white-space: nowrap; padding-left: .75rem; }
.plan .sub { display: block; color: var(--muted); font-size: .86rem; }
.plan tfoot td { border-bottom: 0; border-top: 2px solid var(--line); font-weight: 700; padding-top: .5rem; }
.plan .ans { font-size: .9rem; color: var(--muted); margin: .9rem 0 0; display: flex; align-items: center; }
.cover-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem .75rem; }
@media (min-width: 768px) { .cover-list { grid-template-columns: 1fr 1fr; } }
.cover-list li { display: flex; align-items: center; gap: .15rem; }
.cover-list .bi-check-circle-fill { color: var(--ok); margin-right: .45rem; }
.accordion { --bs-accordion-btn-focus-box-shadow: 0 0 0 .2rem rgba(0, 150, 214, .25); --bs-accordion-active-bg: var(--tint); --bs-accordion-active-color: var(--navy-dark); }
.doc-group h4 { font-size: 1.05rem; font-family: "Figtree", sans-serif; font-weight: 700; margin: 1rem 0 .35rem; }
.doc-group:first-child h4 { margin-top: 0; }
.doc-group ul { margin: 0; padding-left: 1.2rem; }
.fine-print { color: var(--muted); font-size: .9rem; }

/* Impressão */
@media print {
  .site-header, .summary, .stepper-wrap, .no-print, .info-btn, .popover { display: none !important; }
  main { margin-top: 0; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 0; }
  .plan details { display: block; }
  .plan details > summary { display: none; }
  .plan { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Contador de dependentes */
.counter { display: inline-flex; align-items: stretch; gap: .5rem; }
.counter .form-control { width: 90px; text-align: center; font-weight: 700; font-size: 1.25rem; -moz-appearance: textfield; }
.counter .form-control::-webkit-outer-spin-button, .counter .form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.counter .btn { width: 52px; padding: 0; font-size: 1.2rem; }
.counter-text { color: var(--muted); margin-top: .6rem; }
.rules { width: 100%; font-size: .97rem; }
.rules th { color: var(--muted); font-weight: 600; padding: .35rem .5rem .35rem 0; border-bottom: 2px solid var(--line); }
.rules td { padding: .45rem .5rem .45rem 0; border-bottom: 1px dashed var(--line); }
