body { min-height: 100vh; }
.q-card { border-left: 4px solid #198754; }
.q-option { cursor: pointer; border: 1px solid #dee2e6; border-radius: .5rem; padding: .65rem .9rem; display: block; margin-bottom: .5rem; background: #fff; transition: background .1s, border-color .1s; }
.q-option:hover { background: #f1f8f4; border-color: #198754; }
.q-option input { margin-right: .6rem; }
.q-option:has(input:checked) { background: #e7f4ec; border-color: #198754; font-weight: 500; }
.score-circle { width: 150px; height: 150px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; margin: 0 auto; }
.score-circle .n { font-size: 2.8rem; font-weight: 700; line-height: 1; }
.dom-bar { height: 1.1rem; position: relative; }
.dom-cut { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #212529; }
.link-box { font-family: monospace; word-break: break-all; }
.q-invalid { outline: 2px solid #dc3545; border-radius: .5rem; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
  a[href]:after { content: none !important; }
  .progress, .progress-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .score-circle, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
form.js .q-step { display: none; }
form.js .q-step.active { display: block; }
form:not(.js) .q-nav-step { display: none; }

/* ===================== Dashboard ===================== */
.dash {
  --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --surface: #fcfcfb; --hair: rgba(11,11,11,.10);
  --s1: #2a78d6; --s2: #eb6834;               /* categorias do gráfico (azul / laranja) */
  --brand: #146c43; --brand2: #198754;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
}
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.dash-title { font-size: 1.75rem; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.dash-sub { color: var(--ink2); margin: .15rem 0 0; }
.dash-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.dash-filters label { display: block; font-size: .75rem; color: var(--ink2); margin-bottom: .2rem; }
.dash-filters select { min-width: 12rem; max-width: 22rem; }
.dash-app { display: flex; align-items: center; gap: .6rem; margin: -.4rem 0 1rem; }

.dash-card, .dash-tile {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(11,11,11,.04), 0 6px 20px rgba(11,11,11,.03);
}
.dash-card { padding: 1.25rem 1.4rem; }
.card-title-d { font-size: 1rem; font-weight: 650; margin: 0; }
.card-sub { color: var(--ink2); font-size: .84rem; margin: .15rem 0 .9rem; }
.dash-canvas { position: relative; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--ink2); margin-bottom: .4rem; }
.dash-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; }
.k-s1 { background: var(--s1); } .k-s2 { background: var(--s2); }

/* Indicador principal */
.dash-hero {
  border-radius: 16px; padding: 1.5rem 1.6rem; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #1d8f5a 0%, var(--brand) 55%, #0f4d31 100%);
  box-shadow: 0 8px 26px rgba(20,108,67,.25);
}
.hero-label { font-size: .85rem; letter-spacing: .02em; opacity: .9; }
.hero-value { font-size: 4rem; line-height: 1.05; font-weight: 650; letter-spacing: -.02em; margin: .35rem 0 .5rem; }
.hero-value span { font-size: 1.05rem; font-weight: 400; opacity: .8; margin-left: .5rem; letter-spacing: 0; }
.hero-empty { opacity: .6; }
.hero-badge { display: inline-block; background: #fff; color: var(--c); border-radius: 999px; padding: .2rem .8rem; font-weight: 650; font-size: .88rem; }
.hero-scale { margin-top: 1.4rem; }
.hero-track { position: relative; display: flex; height: 10px; border-radius: 999px; overflow: visible; gap: 2px; }
.hero-track span { height: 100%; opacity: .55; }
.hero-track span:first-child { border-radius: 999px 0 0 999px; } .hero-track span:last-of-type { border-radius: 0 999px 999px 0; }
.hero-track i { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.hero-ticks { display: flex; justify-content: space-between; font-size: .72rem; opacity: .8; margin-top: .35rem; }
.hero-foot { margin-top: .8rem; font-size: .85rem; opacity: .92; }

/* Cartões de indicador */
.dash-tile { padding: 1.1rem 1.25rem; height: 100%; }
.tile-label { font-size: .8rem; color: var(--ink2); }
.tile-value { font-size: 2.3rem; line-height: 1.15; font-weight: 650; letter-spacing: -.01em; margin: .15rem 0; }
.tile-value small { font-size: .95rem; font-weight: 400; color: var(--ink2); letter-spacing: 0; }
.tile-note { font-size: .8rem; color: var(--muted); }
.mini-meter { height: 6px; background: #e7edf6; border-radius: 999px; overflow: hidden; margin-top: .55rem; }
.mini-meter span { display: block; height: 100%; background: var(--s1); border-radius: 999px; }
td .mini-meter { margin-top: 0; }

/* Leituras */
.dash-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.dash-insights > div { background: #eef6f1; border: 1px solid rgba(20,108,67,.14); border-radius: 12px; padding: .7rem .95rem; display: flex; flex-direction: column; gap: .1rem; }
.dash-insights strong { font-size: .82rem; color: var(--brand); font-weight: 650; }
.dash-insights span { font-size: .9rem; color: var(--ink); }

.dash-details { margin-top: .6rem; font-size: .82rem; }
.dash-details summary { cursor: pointer; color: var(--ink2); }
.dash-details table { margin-top: .5rem; }
.dash-table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); font-weight: 600; border-bottom-color: var(--grid); }
.dash-table td, .dash-table th { padding-top: .7rem; padding-bottom: .7rem; }

@media (max-width: 575.98px) {
  .hero-value { font-size: 3.2rem; } .tile-value { font-size: 1.9rem; }
  .dash-filters select { min-width: 9.5rem; }
}
@media print {
  .dash-hero { background: var(--brand) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dash-card, .dash-tile { break-inside: avoid; }
}

/* ===================== Tema moderno (saúde e bem-estar) ===================== */
:root {
  --bs-success: #0f7a55; --bs-success-rgb: 15,122,85;
  --bs-link-color: #0f7a55; --bs-link-hover-color: #0a5c40;
  --bs-body-font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: #1d2a26; --bs-secondary-color: #5d6b66;
  --bs-border-color: #e3e9e6; --bs-border-radius: .65rem;
  --t-brand: #0f7a55; --t-brand-dark: #0a5c40; --t-brand-soft: #e8f5ef;
  --t-bg: #f3f7f5; --t-line: #e3e9e6;
  --t-shadow: 0 1px 2px rgba(16,40,30,.05), 0 10px 30px -12px rgba(16,40,30,.14);
}
body.app-body {
  background:
    radial-gradient(900px 420px at 100% -80px, rgba(15,122,85,.10), transparent 70%),
    radial-gradient(700px 360px at -10% 0, rgba(42,120,214,.06), transparent 70%),
    var(--t-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { letter-spacing: -.012em; font-weight: 650; }
.page-main { padding-top: .25rem; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.82); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--t-line); padding: .6rem 0; margin-bottom: 1.75rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--bs-body-color); }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; font-weight: 750; font-size: .95rem; letter-spacing: -.02em;
  background: linear-gradient(135deg, #17a673 0%, #0f7a55 55%, #0a5c40 100%); box-shadow: 0 4px 12px -2px rgba(15,122,85,.45); }
.brand-mark.sm { width: 22px; height: 22px; border-radius: 7px; font-size: .62rem; margin-right: .4rem; vertical-align: -6px; box-shadow: none; }
.brand-mark.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 1.25rem; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.08rem; letter-spacing: -.01em; }
.brand-text small { font-size: .7rem; color: var(--bs-secondary-color); }
.topbar .nav-link { color: #4a5a54; font-weight: 550; font-size: .92rem; padding: .45rem .85rem; border-radius: 999px; transition: background .15s, color .15s; }
.topbar .nav-link:hover { background: var(--t-brand-soft); color: var(--t-brand-dark); }
.topbar .nav-link.active { background: var(--t-brand-soft); color: var(--t-brand-dark); box-shadow: inset 0 0 0 1px rgba(15,122,85,.18); }
.topbar .navbar-nav { gap: .15rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--t-brand-soft); color: var(--t-brand-dark);
  font-weight: 700; font-size: .8rem; box-shadow: inset 0 0 0 1px rgba(15,122,85,.2); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; max-width: 14rem; }
.user-meta strong { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: .72rem; color: var(--bs-secondary-color); }
.btn-ghost { border: 1px solid var(--t-line); background: #fff; color: #42524c; border-radius: 999px; padding: .3rem .9rem; font-weight: 550; }
.btn-ghost:hover { background: #f3f7f5; border-color: #cfd9d4; color: #1d2a26; }
body.is-public .topbar { background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; margin-bottom: 1rem; }

/* Cartões, tabelas, formulários */
.card { border: 1px solid var(--t-line); border-radius: 18px; background: #fff; }
.card.shadow-sm { box-shadow: var(--t-shadow) !important; }
.card-body.p-4 { padding: 1.6rem !important; }
.table { --bs-table-hover-bg: #f6faf8; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6a7973; font-weight: 650; background: #f8fbf9; border-bottom: 1px solid var(--t-line); padding: .8rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .8rem 1rem; border-color: #eef2f0; }
.card > .table-responsive, .card > .table { border-radius: 18px; overflow: hidden; }
.form-control, .form-select { border-radius: 11px; border-color: #d6dfda; padding: .55rem .85rem; background-color: #fff; }
.form-control-lg { padding: .7rem 1rem; font-size: 1rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #3aa57e; box-shadow: 0 0 0 .25rem rgba(15,122,85,.16); }
.form-label { font-weight: 600; font-size: .86rem; color: #33433d; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--t-brand); border-color: var(--t-brand); }
.btn { border-radius: 11px; font-weight: 600; padding: .5rem 1.05rem; transition: transform .12s, box-shadow .15s, background .15s; }
.btn-lg { padding: .75rem 1.4rem; border-radius: 13px; }
.btn-sm { padding: .3rem .75rem; border-radius: 9px; }
.btn-success { --bs-btn-bg: #0f7a55; --bs-btn-border-color: #0f7a55; --bs-btn-hover-bg: #0a5c40; --bs-btn-hover-border-color: #0a5c40;
  --bs-btn-active-bg: #094d36; --bs-btn-active-border-color: #094d36; --bs-btn-disabled-bg: #0f7a55; --bs-btn-disabled-border-color: #0f7a55;
  background-image: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0)); box-shadow: 0 6px 14px -6px rgba(15,122,85,.55); }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 10px 18px -8px rgba(15,122,85,.6); }
.btn-outline-success { --bs-btn-color: #0f7a55; --bs-btn-border-color: #9fd1bd; --bs-btn-hover-bg: #0f7a55; --bs-btn-hover-border-color: #0f7a55; --bs-btn-active-bg: #0a5c40; --bs-btn-active-border-color: #0a5c40; }
.btn-outline-secondary { --bs-btn-color: #4a5a54; --bs-btn-border-color: #d6dfda; --bs-btn-hover-bg: #f3f7f5; --bs-btn-hover-color: #1d2a26; --bs-btn-hover-border-color: #c3cec8; }
.badge { font-weight: 600; padding: .38em .7em; border-radius: 999px; letter-spacing: .01em; }
.alert { border-radius: 14px; border-width: 1px; }
.alert-success { background: #e8f5ef; border-color: #bfe3d2; color: #0a4a33; }
.alert-danger { background: #fdecec; border-color: #f4c7c7; color: #8a1f1f; }
.alert-light { background: #f8fbf9; }
.progress { border-radius: 999px; background: #e9efec; }
.nav-tabs .nav-link.active { color: var(--t-brand-dark); }
h1.h3, h1.h4 { font-weight: 700; }
.site-foot { text-align: center; color: #7a8882; font-size: .78rem; padding: 1.5rem 1rem 2rem; }

/* Login */
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 150px); padding: .5rem 0 2rem; }
.auth-card { display: grid; grid-template-columns: 1.05fr 1fr; width: 100%; max-width: 920px; background: #fff; border: 1px solid var(--t-line);
  border-radius: 26px; overflow: hidden; box-shadow: 0 30px 70px -30px rgba(16,40,30,.35); }
.auth-side { padding: 2.6rem 2.3rem; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, #19a171 0%, #0f7a55 50%, #094d36 100%); }
.auth-side::after { content: ""; position: absolute; width: 320px; height: 320px; right: -120px; bottom: -120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-side h2 { font-size: 1.55rem; line-height: 1.2; margin: 1.4rem 0 .8rem; font-weight: 700; }
.auth-side p { opacity: .9; font-size: .95rem; }
.auth-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .55rem; font-size: .9rem; }
.auth-points li::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.2); margin-right: .6rem; font-size: .7rem; }
.auth-form { padding: 2.6rem 2.3rem; align-self: center; }
.auth-form h1 { font-size: 1.6rem; margin-bottom: .2rem; }

/* Entrada do participante */
.hero-card { overflow: hidden; }
.hero-card-top { padding: 1.9rem 1.7rem 1.6rem; color: #fff; background: radial-gradient(130% 150% at 0% 0%, #19a171 0%, #0f7a55 52%, #094d36 100%); }
.hero-kicker { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; font-weight: 600; }
.hero-card-top h1 { font-size: 1.65rem; margin: .35rem 0 1rem; font-weight: 700; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-chips span { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: .2rem .8rem; font-size: .8rem; }

/* Questionário */
.q-progress { position: sticky; top: 0; z-index: 20; background: rgba(243,247,245,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: .7rem 0 .6rem; margin-top: -.5rem; }
.q-progress .progress { height: .5rem !important; }
#qbar { background: linear-gradient(90deg, #17a673, #0f7a55); border-radius: 999px; transition: width .35s ease; }
.q-domain { font-size: 1.25rem; font-weight: 700; color: var(--t-brand-dark); display: flex; align-items: center; gap: .6rem; }
.q-domain::before { content: ""; width: 6px; height: 1.3rem; border-radius: 3px; background: linear-gradient(180deg, #17a673, #0f7a55); }
.q-card { border-left: 1px solid var(--t-line); border-radius: 18px; }
.q-option { border: 1.5px solid #e0e8e4; border-radius: 13px; padding: .8rem 1rem; margin-bottom: .55rem; background: #fff; transition: all .15s; line-height: 1.35; }
.q-option:hover { background: #f4faf7; border-color: #8cc9b0; transform: translateX(2px); }
.q-option:has(input:checked) { background: #e8f5ef; border-color: var(--t-brand); box-shadow: 0 0 0 3px rgba(15,122,85,.12); }
.q-option input { accent-color: var(--t-brand); width: 1.05rem; height: 1.05rem; vertical-align: -2px; margin-right: .7rem; }
.q-invalid { outline: 2px solid #dc3545; outline-offset: 2px; border-radius: 18px; }

/* Resultado e relatório */
.rel-card { position: relative; overflow: hidden; }
.rel-top { height: 6px; background: var(--c, var(--t-brand)); }
.score-circle { width: 168px; height: 168px; box-shadow: 0 0 0 8px rgba(255,255,255,1), 0 0 0 10px rgba(0,0,0,.06), 0 18px 34px -14px rgba(0,0,0,.35); }
.score-circle .n { font-size: 3.2rem; letter-spacing: -.03em; }
.dom-bar { height: .85rem; border-radius: 999px; overflow: visible; }
.dom-bar .progress-bar { border-radius: 999px; }
.dom-cut { background: #1d2a26; border-radius: 2px; top: -4px; bottom: -4px; }
.msg-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; font-weight: 800; font-size: 1.5rem; }
.msg-ico.warn { background: #fff4d6; color: #8a6100; } .msg-ico.bad { background: #fdecec; color: #b42323; }

/* Dashboard: acompanha o tema */
.dash { --brand: #0f6b4a; --brand2: #0f7a55; }
.dash-hero { background: radial-gradient(120% 140% at 0% 0%, #19a171 0%, #0f7a55 55%, #094d36 100%); }

@media (max-width: 991.98px) {
  .topbar .navbar-collapse { padding-top: .5rem; }
  .user-meta { max-width: none; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { padding: 1.8rem 1.6rem; } .auth-side h2 { font-size: 1.25rem; margin-top: 1rem; } .auth-points { display: none; }
  .auth-form { padding: 1.8rem 1.6rem; }
}
@media (max-width: 575.98px) { .hero-card-top h1 { font-size: 1.35rem; } .q-option:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  body.app-body { background: #fff !important; }
  .rel-card { border: 1px solid #ccc; } .site-foot { display: none; }
  .score-circle { box-shadow: none; }
}
:root { --bs-link-color-rgb: 15,122,85; --bs-link-hover-color-rgb: 10,92,64; }
.table { --bs-table-color: #1d2a26; }
.site-foot { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.site-foot .brand-mark.sm { margin: 0; vertical-align: 0; }
.dash-table a, .table a.fw-semibold { color: var(--t-brand-dark); }
.table a.fw-semibold:hover { text-decoration: underline !important; }
.q-progress .progress { background: #dbe5e0; }
