/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --text: #111827;
  --text-soft: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

#app { min-height: 100vh; }

/* ── Screens ────────────────────────────────────────────────────────── */
.screen {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── Logo ───────────────────────────────────────────────────────────── */
.logo-mark {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--primary-dark);
  line-height: 1;
}
.logo-mark span { color: var(--primary); }
.logo-mark.small { font-size: 1.4rem; }

/* ── Home ───────────────────────────────────────────────────────────── */
.home-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; }
.home-hero { max-width: 680px; text-align: center; }
.home-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin: 1.2rem 0 .8rem; color: var(--text); }
.home-hero p { font-size: 1.1rem; color: var(--text-soft); max-width: 520px; margin: 0 auto 2rem; }

.home-pillars {
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: center; margin-bottom: 2.5rem;
}
.pillar-chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 99px;
  padding: .3rem .9rem;
  font-size: .82rem;
  font-weight: 500;
}

.home-cta { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin-bottom: 2rem; }

.home-meta {
  display: flex; flex-wrap: wrap; gap: 1.2rem;
  justify-content: center; color: var(--text-soft); font-size: .9rem;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #d1d5db; cursor: not-allowed; }
.btn-primary.btn-lg { padding: .9rem 2rem; font-size: 1.05rem; }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem 1.5rem;
  font-size: .95rem;
  cursor: pointer;
  transition: all .15s;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-back {
  background: none; border: none;
  color: var(--text-soft); cursor: pointer;
  font-size: .9rem; padding: 0;
}
.btn-back:hover { color: var(--primary); }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-form { padding: 2rem; max-width: 600px; margin: 3rem auto 0; }
.card-header { margin-bottom: 1.5rem; }
.card-header h2 { font-size: 1.4rem; margin: .6rem 0 .3rem; }
.card-header p { color: var(--text-soft); font-size: .9rem; }

/* ── Formulário ─────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .875rem; font-weight: 500; color: var(--text); }
.form-group input,
.form-group select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .9rem;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
  transition: border .15s;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #4f46e520; }

/* ── Diagnóstico ─────────────────────────────────────────────────────── */
.diag-header { margin-bottom: 1rem; }
.diag-progress-bar {
  height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden; margin-bottom: .4rem;
}
.diag-progress-fill {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .3s ease;
}
.diag-meta {
  display: flex; justify-content: space-between;
  font-size: .82rem; color: var(--text-soft);
}

.diag-card { padding: 1.5rem 1.25rem 1.25rem; }

.pilar-header {
  display: flex; align-items: center; gap: .9rem;
  padding: .8rem 1rem; border-radius: 8px;
  background: #f9fafb; margin-bottom: 1.25rem;
}
.pilar-icon { font-size: 1.8rem; line-height: 1; }
.pilar-label { font-size: .78rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; }
.pilar-name { font-size: 1.05rem; font-weight: 700; }

.legend-strip {
  display: flex; flex-wrap: wrap; gap: .4rem 1rem;
  font-size: .78rem; color: var(--text-soft);
  padding: .6rem .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.legend-strip strong { color: var(--text); margin-right: .2rem; }

.questions-list { display: flex; flex-direction: column; gap: .75rem; }

.question-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  transition: border-color .15s, background .15s;
}
.question-item.answered { background: #f0fdf4; border-color: #86efac; }

.question-text {
  font-size: .95rem; font-weight: 500; margin-bottom: .75rem; line-height: 1.5;
}
.q-num { color: var(--primary); font-weight: 700; margin-right: .3rem; }

.options-row {
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.opt-label {
  display: flex; flex-direction: column; align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .7rem;
  cursor: pointer;
  transition: all .15s;
  min-width: 80px; flex: 1;
  text-align: center;
}
.opt-label:hover { border-color: var(--primary); background: var(--primary-light); }
.opt-label.selected { border-color: var(--primary); background: var(--primary-light); }
.opt-label input { display: none; }
.opt-value { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); }
.opt-text { font-size: .72rem; color: var(--text-soft); line-height: 1.2; }

.diag-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: .75rem;
}
.respondidas-count { font-size: .85rem; color: var(--text-soft); }

/* ── Resultado ──────────────────────────────────────────────────────── */
.resultado-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--card); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.empresa-nome { font-weight: 700; font-size: 1rem; }
.empresa-meta { font-size: .82rem; color: var(--text-soft); }

.resultado-hero {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2rem;
  display: flex; align-items: center; gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.score-circle {
  flex-shrink: 0;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 5px solid;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.score-label { font-size: .72rem; color: var(--text-soft); margin-top: .2rem; }

.resultado-info h2 { font-size: 1.4rem; margin: .5rem 0 .4rem; }
.resultado-info p { font-size: .9rem; color: var(--text-soft); margin-bottom: .75rem; }

.scale-bar {
  display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .75rem;
}
.scale-item {
  border-radius: 6px; padding: .3rem .6rem;
  font-size: .75rem; font-weight: 500;
}
.scale-item.active { font-weight: 700 !important; }

.section-title {
  font-size: 1.1rem; font-weight: 700;
  margin: 1.5rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

.pilares-grid { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.pilar-result-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem;
}
.pilar-result-top {
  display: flex; justify-content: space-between;
  font-size: .92rem; font-weight: 500; margin-bottom: .5rem;
}
.pilar-score { font-size: 1.1rem; font-weight: 800; }
.bar-track { height: 8px; background: #f3f4f6; border-radius: 99px; overflow: hidden; margin-bottom: .4rem; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.pilar-result-nivel { margin-top: .25rem; }

.destaques-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 560px) { .destaques-grid { grid-template-columns: 1fr; } }
.destaque-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.destaque-card h4 { font-size: .9rem; margin-bottom: .75rem; }
.destaque-item {
  display: flex; justify-content: space-between;
  font-size: .88rem; padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.destaque-item:last-child { border-bottom: none; }

.resultado-actions {
  display: flex; gap: .75rem; margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ── Plano de Ação ──────────────────────────────────────────────────── */
.plano-intro { color: var(--text-soft); font-size: .9rem; margin-bottom: 1.5rem; }

.plano-pilar-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 1.25rem;
  overflow: hidden;
}
.plano-pilar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; background: #f9fafb;
  font-size: .95rem; flex-wrap: wrap; gap: .5rem;
}
.plano-pilar-icon { font-size: 1.2rem; margin-right: .4rem; }
.plano-pilar-right { display: flex; align-items: center; gap: .75rem; }
.pilar-score-sm { font-weight: 700; font-size: .95rem; }

.plano-diagnostico { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.plano-diagnostico p { font-size: .9rem; color: var(--text-soft); margin-bottom: .75rem; }
.risco-box {
  background: #fef3c7; border-left: 3px solid #f59e0b;
  border-radius: 6px; padding: .6rem .9rem;
  font-size: .85rem; color: #92400e;
}

.acoes-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.acoes-table thead { background: #f9fafb; }
.acoes-table th { padding: .6rem 1rem; text-align: left; font-size: .78rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }
.acoes-table td { padding: .7rem 1rem; border-top: 1px solid var(--border); vertical-align: top; }
.acoes-table tr:hover td { background: #fafafa; }

/* Tags */
.badge {
  display: inline-block; border-radius: 99px;
  padding: .2rem .7rem; font-size: .78rem; font-weight: 600;
}
.tag {
  display: inline-block; border-radius: 6px;
  padding: .15rem .55rem; font-size: .78rem; font-weight: 600;
}
.tag-alta { background: #fee2e2; color: #dc2626; }
.tag-média { background: #fef3c7; color: #d97706; }
.tag-baixa { background: #f0fdf4; color: #16a34a; }
.tag-impacto-alto { background: #ede9fe; color: #7c3aed; }
.tag-impacto-médio { background: #e0f2fe; color: #0284c7; }
.tag-impacto-baixo { background: #f3f4f6; color: #6b7280; }

/* ── Barra de usuário ───────────────────────────────────────────────── */
.user-bar {
  position: fixed; top: 0; right: 0; left: 0; z-index: 100;
  display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
  padding: .5rem 1.25rem;
  background: var(--card); border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.user-email { color: var(--text-soft); }
.home-screen { padding-top: 3.5rem; }

/* ── Login ──────────────────────────────────────────────────────────── */
.login-footer {
  font-size: .8rem; color: var(--text-soft);
  margin-top: 2rem;
}

/* ── Print ──────────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .screen { padding: 0; max-width: 100%; }
  .card, .pilar-result-card, .plano-pilar-card, .destaque-card, .resultado-hero, .resultado-header {
    box-shadow: none !important; break-inside: avoid;
  }
  .plano-pilar-card { page-break-inside: avoid; }
}

/* ── Responsivo ─────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .resultado-hero { flex-direction: column; align-items: flex-start; }
  .options-row { gap: .3rem; }
  .opt-label { min-width: 60px; }
  .acoes-table { display: block; overflow-x: auto; }
}

/* ══════════════════════════════════════════════════════════════════════
   HCI — Pesquisa de Clima
   ══════════════════════════════════════════════════════════════════════ */

/* Portal home */
.hci-home-link { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.hci-home-link .btn-ghost { font-size: .9rem; }

/* Portal header */
.hci-portal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; margin-bottom: 1rem;
  padding-top: 4rem;
}
.hci-portal-header h2 { font-size: 1.25rem; font-weight: 700; }
.hci-loading-txt { text-align: center; padding: 2rem; color: var(--text-soft); }

/* Survey cards (list) */
.hci-survey-card { margin-bottom: 1rem; }
.hci-sc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: .75rem;
}
.hci-sc-company { font-weight: 700; font-size: 1.05rem; }
.hci-sc-meta { font-size: .82rem; color: var(--text-soft); margin-top: .2rem; }
.hci-status-badge {
  font-size: .78rem; padding: .25rem .6rem; border-radius: 999px;
  white-space: nowrap; margin-left: .5rem;
}
.hci-status-badge.active { background: #f0fdf4; color: #16a34a; }
.hci-status-badge.closed { background: #f3f4f6; color: #6b7280; }
.hci-sc-link {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: .5rem .75rem; margin-bottom: .75rem;
  overflow: hidden;
}
.hci-link-text {
  flex: 1; font-size: .75rem; color: var(--text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: monospace;
}
.hci-sc-actions { display: flex; gap: .5rem; }
.btn-sm { font-size: .82rem; padding: .35rem .8rem; }

/* Employee survey — hero / welcome / obrigado */
.hci-screen { padding-top: 1.5rem; }
.hci-hero {
  max-width: 560px; margin: 0 auto; padding: 2rem 1.25rem;
  text-align: center;
}
.hci-hero h1 { font-size: 1.6rem; margin: .75rem 0 1rem; }
.hci-type-badge {
  display: inline-block; font-size: .78rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: .25rem .75rem; border-radius: 999px; margin-bottom: .5rem;
}
.hci-scale-note { font-size: .85rem; color: var(--text-soft); margin-top: .75rem; }
.obrigado-icon { font-size: 3rem; margin: .75rem 0; }

/* Progress */
.hci-progress-wrap {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem 0; max-width: 680px; margin: 0 auto;
}
.hci-pbar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.hci-pbar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.hci-pbar-pct { font-size: .78rem; color: var(--text-soft); min-width: 2.5rem; text-align: right; }

/* Nav */
.hci-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem 1.25rem; max-width: 680px; margin: 0 auto;
}
.hci-step-count { font-size: .82rem; color: var(--text-soft); }

/* Card */
.hci-card { max-width: 680px; margin: .5rem auto 2rem; }
.hci-card-header {
  display: flex; align-items: center; gap: .75rem;
  padding-left: 1rem; margin-bottom: 1.25rem;
}
.hci-dim-icon { font-size: 1.75rem; line-height: 1; }
.hci-dim-tag { font-size: .75rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }
.hci-dim-name { font-size: 1.1rem; font-weight: 700; margin-top: .15rem; }

/* Likert */
.likert-legend {
  display: flex; flex-wrap: wrap; gap: .4rem .75rem;
  font-size: .75rem; color: var(--text-soft);
  margin-bottom: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.likert-legend b { color: var(--text); }
.likert-questions { display: flex; flex-direction: column; gap: 1.25rem; }
.likert-q { padding: .75rem; border-radius: 8px; transition: background .15s; }
.likert-q.answered { background: var(--accent-soft); }
.likert-q-text { font-size: .93rem; margin-bottom: .6rem; line-height: 1.5; }
.q-num { font-weight: 600; color: var(--accent); margin-right: .25rem; }
.likert-options { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.likert-opt {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  cursor: pointer; border: 1.5px solid var(--border); border-radius: 8px;
  padding: .4rem .5rem; min-width: 56px; transition: all .15s;
  font-size: .72rem; text-align: center; user-select: none;
}
.likert-opt input { display: none; }
.likert-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.likert-opt.sel { border-color: var(--accent); background: var(--accent); color: #fff; }
.likert-num { font-size: 1rem; font-weight: 700; }
.likert-lbl { line-height: 1.2; }
.hci-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.resp-count { font-size: .82rem; color: var(--text-soft); }

/* eNPS */
.enps-question { padding: .5rem 0 1rem; }
.enps-question p { font-size: .95rem; margin-bottom: 1rem; }
.enps-scale { display: flex; flex-wrap: wrap; gap: .4rem; }
.enps-btn {
  width: 44px; height: 44px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--card);
  font-size: .9rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.enps-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.enps-btn.sel { border-color: var(--accent); background: var(--accent); color: #fff; }
.enps-labels {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--text-soft); margin-top: .5rem;
}

/* Open questions */
.open-questions { display: flex; flex-direction: column; gap: 1.25rem; }
.open-q-group { display: flex; flex-direction: column; gap: .4rem; }
.open-q-label { font-size: .9rem; font-weight: 500; }
.open-q-input {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: .6rem .75rem; font-size: .88rem; resize: vertical;
  font-family: inherit; background: var(--card); color: var(--text);
  transition: border-color .15s;
}
.open-q-input:focus { outline: none; border-color: var(--accent); }
.open-optional-note { font-size: .78rem; color: var(--text-soft); }

/* Error / loading */
.hci-status-screen { display: flex; justify-content: center; align-items: center; min-height: 60vh; }
.hci-error-msg { color: #dc2626; font-size: .95rem; text-align: center; padding: 1rem; }

/* Results — eNPS card */
.enps-result-card {
  margin-top: .75rem; padding: .75rem 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.enps-result-row { display: flex; align-items: baseline; gap: .75rem; }
.enps-result-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.enps-result-score { font-size: 1.6rem; font-weight: 800; }
.enps-result-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.enps-chip { font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; }
.enps-chip.promo { background: #f0fdf4; color: #16a34a; }
.enps-chip.neutro { background: #f9fafb; color: #6b7280; }
.enps-chip.detr  { background: #fef2f2; color: #dc2626; }

/* Results — NR-01 */
.nr01-result-card {
  margin: 1rem 0; padding: 1rem 1.25rem;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card);
}
.nr01-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; margin-bottom: .25rem;
}
.nr01-nota { font-size: .82rem; color: var(--text-soft); margin-top: .4rem; }

/* Results — open answers */
.open-result-card {
  margin-bottom: 1rem; padding: 1rem 1.25rem;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card);
}
.open-result-q { font-weight: 600; font-size: .9rem; margin-bottom: .6rem; }
.open-result-list {
  margin: 0; padding-left: 1.25rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.open-result-list li { font-size: .88rem; color: var(--text); line-height: 1.5; }

/* Responsive survey */
@media (max-width: 560px) {
  .likert-opt { min-width: 48px; font-size: .68rem; }
  .enps-btn { width: 36px; height: 36px; font-size: .82rem; }
  .hci-sc-link { flex-direction: column; align-items: flex-start; }
  .hci-portal-header { flex-wrap: wrap; gap: .5rem; }
}
