:root {
  --green: #06bc61;
  --green-dark: #048c49;
  --green-deep: #037a3f;
  --green-soft: #e7f8ef;
  --navy: #0a2342;
  --ink: #122033;
  --muted: #5c6b7a;
  --line: #e1ebe6;
  --bg: #eef3f0;
  --white: #ffffff;
  --bad: #e5484d;
  --bad-soft: #fdecec;
  --warn: #e8a317;
  --warn-soft: #fff6df;
  --orange: #ef7d32;
  --shadow: 0 18px 50px rgba(10, 35, 66, 0.08);
  --display: "Outfit", "Segoe UI", sans-serif;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: #eef3f0;
  background-image:
    radial-gradient(900px 420px at 100% -10%, rgba(6, 188, 97, 0.16), transparent 55%),
    linear-gradient(180deg, #f7faf8 0%, #e7eee9 100%);
}
button, input, textarea, select { font: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); color: var(--navy); letter-spacing: -0.03em; }
:focus-visible { outline: 3px solid rgba(6, 188, 97, 0.45); outline-offset: 2px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 4px solid var(--green);
  border-bottom: 1px solid rgba(10, 35, 66, 0.06);
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  min-width: 0;
}
.brand { flex: none; }
.brand img { height: 84px; width: auto; display: block; }
.brand-copy { text-align: right; min-width: 0; }
.brand-copy strong { display: block; color: var(--navy); }
.brand-copy span { color: var(--muted); font-size: 0.9rem; }
.progress { height: 4px; background: #e3eee8; }
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
  transition: width 0.35s ease;
}

.wrap { width: min(780px, calc(100% - 28px)); margin: 28px auto 40px; }
.panel {
  background: var(--white);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.wrap .panel { padding: 26px 20px 20px; animation: rise 0.4s ease; }
@media (min-width: 720px) {
  .wrap .panel { padding: 36px 36px 28px; }
}
.wrap h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 10px;
}
.kicker {
  margin: 0 0 6px;
  color: var(--green-deep);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lead { font-size: 1.08rem; color: var(--ink); margin: 0 0 8px; }
.help { color: var(--muted); margin: 8px 0 0; }
.req { color: var(--bad); }
.opt { color: var(--muted); font-weight: 600; }

.control {
  width: 100%;
  border: 1.5px solid #d5e0da;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fbfefc;
  color: var(--ink);
  outline: none;
}
textarea.control { min-height: 140px; resize: vertical; }
.control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(6, 188, 97, 0.15);
}
label { display: block; font-weight: 700; margin: 14px 0 6px; color: var(--navy); }
.search { margin-top: 16px; }
.count { text-align: right; color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  background: #e7eee9;
}
.btn.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 8px 20px rgba(6, 188, 97, 0.28);
}
.btn.primary:hover { background: var(--green-dark); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad-soft); color: #9f1c1c; }
.btn.tiny { padding: 8px 12px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.linkish {
  background: none;
  border: 0;
  color: var(--green-deep);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.actions .btn.primary { margin-left: auto; }
.error {
  background: var(--bad-soft);
  color: #9f1c1c;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}
.callout {
  background: var(--warn-soft);
  color: #6d4b00;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
}

.context { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  background: var(--green-soft);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 0.85rem;
}
.chip.dark { background: #e7eef6; color: var(--navy); }

.companies { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) {
  .companies { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .companies { grid-template-columns: 1fr 1fr 1fr; }
}
.company {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1.5px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
  white-space: normal;
  min-width: 0;
}
.company > span:last-child { min-width: 0; line-height: 1.2; }
.company.selected {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(6, 188, 97, 0.16);
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  flex: none;
}
.avatar.g { background: var(--green); }
.avatar.n { background: var(--navy); }

.choices { display: grid; gap: 12px; }
@media (min-width: 700px) {
  .choices { grid-template-columns: 1fr 1fr; }
}
.choice {
  text-align: left;
  border: 1.5px solid var(--line);
  background: white;
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
}
.choice:hover, .choice.selected { border-color: var(--green); background: var(--green-soft); }
.choice strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.choice span { color: var(--muted); }
.saved {
  background: var(--green-soft);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.saved strong, .saved span { display: block; }
.saved span { color: var(--muted); margin: 4px 0 10px; }

.rates { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 18px; }
.rate {
  border: 1.5px solid var(--line);
  background: #f7faf8;
  border-radius: 16px;
  padding: 12px 2px;
  cursor: pointer;
  color: var(--navy);
  transition: transform 0.15s ease;
}
.rate:hover { transform: translateY(-2px); }
.rate strong { display: block; font-family: var(--display); font-size: 1.35rem; }
.rate span { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.rate.on { color: white; border-color: transparent; }
.rate.on span { color: rgba(255, 255, 255, 0.92); }
.rate.on.s1 { background: var(--bad); }
.rate.on.s2 { background: var(--orange); }
.rate.on.s3 { background: var(--warn); color: #3d2e00; }
.rate.on.s3 span { color: #5c4300; }
.rate.on.s4 { background: #12a35a; }
.rate.on.s5 { background: var(--green-dark); }

.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin-top: 18px; }
.nps-btn {
  border: 1.5px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 12px 0;
  font-weight: 800;
  cursor: pointer;
  color: var(--navy);
}
.nps-btn.on { color: white; border-color: transparent; }
.nps-btn.on.n0, .nps-btn.on.n1, .nps-btn.on.n2, .nps-btn.on.n3,
.nps-btn.on.n4, .nps-btn.on.n5, .nps-btn.on.n6 { background: var(--bad); }
.nps-btn.on.n7, .nps-btn.on.n8 { background: var(--warn); color: #3d2e00; }
.nps-btn.on.n9, .nps-btn.on.n10 { background: var(--green); }
.nps-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
}
@media (max-width: 700px) {
  .nps { grid-template-columns: repeat(6, 1fr); }
}

.rev {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.rev b { display: block; }
.rev span { color: var(--muted); }
.rev .mini { display: block; margin-top: 4px; white-space: pre-wrap; }
.rev button {
  background: none;
  border: 0;
  color: var(--green-deep);
  font-weight: 700;
  cursor: pointer;
}
.note { font-weight: 800; }
.note.s1, .note.s2 { color: var(--bad); }
.note.s3 { color: #9a6b00; }
.note.s4, .note.s5 { color: var(--green-deep); }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
}
.badge.bom { background: var(--green-soft); color: var(--green-deep); }
.badge.atencao { background: var(--warn-soft); color: #8a5b00; }
.badge.critico { background: var(--bad-soft); color: #9f1c1c; }

.loading { text-align: center; padding: 12px 8px 8px; }
.loading img, .load-logo { height: 120px; width: auto; }
.spin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #d7e8de;
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
  margin: 16px auto 0;
}
.thanks { position: relative; overflow: hidden; text-align: center; }
.center-btn { display: flex; justify-content: center; margin-top: 16px; }
.ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 8px auto 16px;
  background: conic-gradient(var(--c, var(--green)) calc(var(--p) * 1%), #e4eee8 0);
}
.ring-inner {
  width: 114px;
  height: 114px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-inner strong { font-family: var(--display); font-size: 2rem; color: var(--navy); line-height: 1; }
.ring-inner span { color: var(--muted); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0;
  animation: fall 1.5s ease forwards;
}
.confetti i:nth-child(1) { left: 8%; background: var(--green); }
.confetti i:nth-child(2) { left: 18%; background: var(--navy); animation-delay: 0.08s; }
.confetti i:nth-child(3) { left: 30%; background: var(--green); animation-delay: 0.16s; width: 6px; height: 12px; }
.confetti i:nth-child(4) { left: 44%; background: var(--warn); animation-delay: 0.05s; }
.confetti i:nth-child(5) { left: 56%; background: var(--green-dark); animation-delay: 0.2s; }
.confetti i:nth-child(6) { left: 68%; background: var(--navy); animation-delay: 0.12s; width: 10px; height: 6px; }
.confetti i:nth-child(7) { left: 78%; background: var(--green); animation-delay: 0.18s; }
.confetti i:nth-child(8) { left: 88%; background: var(--green-dark); animation-delay: 0.02s; }

.foot { text-align: center; color: var(--muted); font-size: 0.92rem; padding: 0 16px 32px; }
.foot a { color: var(--navy); font-weight: 700; }
.noscript { text-align: center; padding: 16px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(220px) rotate(80deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 560px) {
  .brand img { height: 68px; }
  .brand-copy strong { display: none; }
  .topbar-row { padding: 8px 12px; gap: 10px; }
  .avatar { width: 36px; height: 36px; font-size: 0.68rem; }
  .company { padding: 10px; gap: 8px; }
  .rates { gap: 6px; }
  .rate { padding: 10px 1px; }
  .rate strong { font-size: 1.15rem; }
  .actions .btn { width: 100%; }
  .actions .btn.primary { margin-left: 0; }
}
