/* Pesquisa qualitativa "Sua opinião" (ver inc/pesquisa-site.php).
   Mesmo tema escuro do resto do site (--black/--white/--yellow). Toda
   regra de display vem com o [hidden] junto, lição já repetida no tema. */

.rmg-pesquisa[hidden],
.rmg-pesquisa [hidden] { display: none !important; }

/* ── Aba lateral (desktop) ─────────────────────────────────────────── */
.rmg-pesquisa__aba {
  position: fixed;
  right: 0; top: 50%;
  z-index: 520;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  padding: 1rem .6rem;
  background: var(--yellow);
  color: var(--black);
  border: 0;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font: 700 .8rem/1 var(--sans);
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: padding-right .2s ease;
}
.rmg-pesquisa__aba:hover { padding-right: .9rem; }
.rmg-pesquisa.is-aberta .rmg-pesquisa__aba { display: none; }

/* ── Painel ────────────────────────────────────────────────────────── */
.rmg-pesquisa__painel {
  position: fixed;
  right: 1.5rem; top: 50%;
  transform: translateY(-50%);
  z-index: 530;
  width: 380px; max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: #151515;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.rmg-pesquisa__topo { display: flex; align-items: center; justify-content: space-between; }
.rmg-pesquisa__progresso { color: var(--yellow); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.rmg-pesquisa__barra { height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; margin: .6rem 0 1.25rem; overflow: hidden; }
.rmg-pesquisa__barra span { display: block; height: 100%; width: 0; background: var(--yellow); transition: width .25s ease; }

.rmg-pesquisa__fechar {
  appearance: none; -webkit-appearance: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--white);
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
}

.rmg-pesquisa__etapa { border: 0; margin: 0; padding: 0; min-width: 0; }
.rmg-pesquisa__pergunta {
  display: block;
  padding: 0;
  margin: 0 0 1rem;
  font: 700 1.05rem/1.35 var(--sans);
  color: var(--white);
}

.rmg-pesquisa__escala { display: grid; grid-template-columns: repeat(11, 1fr); gap: .3rem; }
.rmg-pesquisa__nota,
.rmg-pesquisa__opcao {
  appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--white);
  border-radius: var(--radius-md);
  font-family: var(--sans);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.rmg-pesquisa__nota { aspect-ratio: 1; padding: 0; font-size: .85rem; font-weight: 700; }
.rmg-pesquisa__escala-legenda { display: flex; justify-content: space-between; margin-top: .4rem; font-size: .72rem; color: rgba(255,255,255,.5); }

.rmg-pesquisa__opcoes { display: flex; flex-direction: column; gap: .5rem; }
.rmg-pesquisa__opcao { text-align: left; padding: .8rem 1rem; font-size: .92rem; }

.rmg-pesquisa__nota:hover,
.rmg-pesquisa__opcao:hover { border-color: var(--yellow); }
.rmg-pesquisa__nota.is-escolhida,
.rmg-pesquisa__opcao.is-escolhida { background: var(--yellow); border-color: var(--yellow); color: var(--black); }

.rmg-pesquisa textarea {
  width: 100%;
  padding: .8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color: var(--white);
  font: .92rem/1.5 var(--sans);
  resize: vertical;
}
.rmg-pesquisa textarea::placeholder { color: rgba(255,255,255,.4); }
.rmg-pesquisa__turnstile { margin: .75rem 0; min-height: 65px; }
.rmg-pesquisa__enviar { width: 100%; justify-content: center; border: 0; cursor: pointer; }
.rmg-pesquisa__enviar:disabled { opacity: .6; cursor: default; }

.rmg-pesquisa__link {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; padding: 0;
  color: rgba(255,255,255,.6);
  font: 600 .82rem var(--sans);
  cursor: pointer;
}
.rmg-pesquisa__link:hover { color: var(--white); }
.rmg-pesquisa__voltar { margin-top: 1rem; }

.rmg-pesquisa__obrigado .btn { width: 100%; justify-content: center; border: 0; cursor: pointer; }
.rmg-pesquisa__erro { margin: .75rem 0 0; color: #ff8080; font-size: .85rem; }

/* ── Convite contextual (mobile) ───────────────────────────────────── */
.rmg-pesquisa__convite {
  position: fixed;
  left: .75rem; right: .75rem; bottom: .75rem;
  z-index: 540;
  background: #151515;
  color: var(--white);
  border: 1px solid rgba(255,204,0,.45);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
  animation: rmg-pesquisa-sobe .35s ease both;
}
.rmg-pesquisa__convite .rmg-pesquisa__fechar { position: absolute; top: .6rem; right: .6rem; }
.rmg-pesquisa__convite-titulo { margin: 0 2.5rem .35rem 0; font: 700 1rem var(--sans); color: var(--white); }
.rmg-pesquisa__convite-texto { margin: 0 0 .9rem; font-size: .88rem; line-height: 1.45; color: rgba(255,255,255,.7); }
.rmg-pesquisa__convite-acoes { display: flex; align-items: center; gap: 1rem; }
.rmg-pesquisa__convite-acoes .btn { border: 0; cursor: pointer; }

@keyframes rmg-pesquisa-sobe {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@media (max-width: 767px) {
  .rmg-pesquisa__aba { display: none; }

  /* Painel vira bottom sheet de largura total. */
  .rmg-pesquisa__painel {
    top: auto; right: 0; left: 0; bottom: 0;
    transform: none;
    width: 100%; max-width: none;
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
    padding: 1.1rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
    animation: rmg-pesquisa-sobe .3s ease both;
  }
  .rmg-pesquisa__escala { grid-template-columns: repeat(6, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .rmg-pesquisa__convite,
  .rmg-pesquisa__painel { animation: none; }
}
