/* ========================================================================
   WAID Quiz NPS — Estilos
   Paleta oficial do brandbook (waid_home_v4_brandbook_oficial.html):
   branco (soft-bone) + roxo (waid-purple) + preto (anthracite)
   acentos: warm-sand (bordas), sage-glass (eyebrows), lucid-violet (hover)
   ======================================================================== */

:root {
  /* === Brandbook WAID — tokens originais === */
  --soft-bone:      #F9F8F6;
  --warm-sand:      #E8E2D6;
  --anthracite:     #2B2B2B;
  --waid-purple:    #5D3987;
  --lucid-violet:   #977DC9;
  --sage-glass:     #8BA88E;
  --deep-forest:    #234131;

  /* === Tokens semanticos do quiz === */
  --bg:             var(--soft-bone);
  --surface:        #FFFFFF;
  --text:           var(--anthracite);
  --text-soft:      #555555;
  --text-mute:      #8A8A8A;
  --border:         var(--warm-sand);
  --border-strong:  #D4CFC2;
  --accent:         var(--waid-purple);
  --accent-hover:   var(--lucid-violet);
  --accent-soft:    #EFE9F5;
  --accent-text:    var(--soft-bone);
  --eyebrow:        var(--sage-glass);
  --danger:         #B6362A;
  --success:        var(--deep-forest);

  /* === Tipografia (brandbook: Space Grotesk + Inter) === */
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(45,45,45,0.04);
  --shadow-md: 0 4px 24px rgba(93,57,135,0.07);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); }

/* ============================
   Container e layout geral
   ============================ */
.wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 60px;
}

.brand {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

/* Logo oficial WAID (SVG) — preto + pingo roxo lucid-violet */
.brand-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

@media (max-width: 600px) {
  .brand-logo-img { height: 26px; }
}

.brand-sub {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 36px 28px;
  box-shadow: var(--shadow-md);
}

/* ============================
   Barra de progresso
   ============================ */
.progress-bar-wrap {
  width: 100%;
  max-width: 640px;
  margin-bottom: 16px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 350ms cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ============================
   Telas (fade in)
   ============================ */
.screen {
  animation: fadeIn 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.15;
  color: var(--anthracite);
}

.screen-lead {
  font-size: 16px;
  color: var(--text-soft);
  margin: 0 0 28px;
  line-height: 1.6;
}

.question-label {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  line-height: 1.25;
  color: var(--anthracite);
}

/* ============================
   Inputs / textarea
   ============================ */
.field {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.field-label .required { color: var(--danger); }

input[type="text"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3e%3cpath fill='none' stroke='%23555' stroke-width='1.6' d='M1 1l5 5 5-5'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* ============================
   Header de secao
   ============================ */
.section-header {
  margin: -8px 0 22px;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.section-eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--eyebrow);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-description {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.45;
}

/* ============================
   Escala 1-5 com rotulos
   ============================ */
.escala-num {
  display: block;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

.escala-rotulo {
  display: block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: inherit;
  opacity: 0.75;
}

.escala-btn.selected .escala-rotulo { opacity: 1; }

/* ============================
   Contador de selecao (X de Y)
   ============================ */
.select-counter {
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}

.select-counter.at-limit { color: var(--accent); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.select-counter.shake {
  color: var(--danger);
  animation: shake 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================
   Campo "Outro" inline
   ============================ */
.outro-wrap {
  margin: 10px 0 6px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  animation: fadeIn 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.outro-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.outro-input {
  background: var(--surface);
}

/* ============================
   Comentario opcional
   ============================ */
.comment-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  animation: fadeIn 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-label {
  display: block;
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 6px;
  font-weight: 500;
}

.comment-input {
  min-height: 64px;
  font-size: 14px;
}

/* ============================
   NPS 0-10
   ============================ */
.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.nps-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.nps-btn:hover { border-color: var(--accent); color: var(--accent); }
.nps-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.nps-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.nps-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 6px;
}

/* ============================
   Escala 1-5
   ============================ */
.escala-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.escala-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 16px 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.escala-btn:hover { border-color: var(--accent); color: var(--accent); }
.escala-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.escala-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.escala-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
}

/* ============================
   Multipla escolha (radio)
   ============================ */
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.option:hover { border-color: var(--accent); background: var(--accent-soft); }
.option input { margin: 0; accent-color: var(--accent); }
.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================
   Botoes
   ============================ */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  gap: 12px;
}

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius);
  padding: 12px 22px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { filter: brightness(0.92); }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================
   Resumo
   ============================ */
.summary-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.summary-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.summary-item:last-child { border-bottom: none; }

.summary-q {
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 4px;
}

.summary-a {
  font-size: 15px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.summary-a.empty { color: var(--text-mute); font-style: italic; }

.summary-comment {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-soft);
  padding-left: 10px;
  border-left: 2px solid var(--border-strong);
  font-style: italic;
}

/* Checkbox visual no multipla_selecao: igual ao radio, ja estilizado em .option */
.checkbox-group .option input[type="checkbox"] { accent-color: var(--accent); }

/* ============================
   Erros + footer + utilitarios
   ============================ */
.error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

.footnote {
  width: 100%;
  max-width: 640px;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ============================
   Tela de obrigado
   ============================ */
.thanks-card {
  text-align: center;
  padding: 56px 36px;
}

.thanks-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
}

.thanks-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--anthracite);
}

.thanks-text {
  font-size: 16px;
  color: var(--text-soft);
  margin: 0 auto;
  max-width: 480px;
}

/* === Bloco B: bonus (destaque maior) === */
.thanks-bonus {
  text-align: center;
  padding: 48px 36px;
  margin-top: 18px;
  background: var(--anthracite);
  color: var(--soft-bone);
  border: none;
  position: relative;
  overflow: hidden;
}

.thanks-bonus-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-glass);
  margin-bottom: 16px;
}

.thanks-bonus-number {
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--lucid-violet);
  margin-bottom: 8px;
}

.thanks-bonus-unit {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--soft-bone);
  display: block;
  margin-top: 6px;
}

.thanks-bonus-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 12px 0 14px;
  color: var(--soft-bone);
}

.thanks-bonus-text {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(249, 248, 246, 0.78);
  max-width: 520px;
  margin: 0 auto;
}

.thanks-bonus-text strong {
  color: var(--soft-bone);
  font-weight: 600;
}

/* === Bloco C: como resgatar (texto operacional) === */
.thanks-howto {
  padding: 28px 32px;
  margin-top: 18px;
  background: var(--accent-soft);
  border: 1px dashed var(--border-strong);
  text-align: left;
}

.thanks-howto-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.thanks-howto-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.thanks-howto-text strong {
  color: var(--accent);
  font-weight: 600;
}

/* ============================
   Mobile
   ============================ */
@media (max-width: 600px) {
  .wrap { padding: 16px 14px 48px; }
  .card { padding: 24px 20px; border-radius: 12px; }
  .thanks-bonus-number { font-size: 80px; }
  .thanks-bonus-unit { font-size: 18px; }
  .thanks-bonus-title { font-size: 19px; }
  .thanks-bonus { padding: 36px 24px; }
  .thanks-howto { padding: 22px 22px; }
  .screen-title { font-size: 24px; }
  .question-label { font-size: 19px; }
  .nps-scale { grid-template-columns: repeat(6, 1fr); }
  .nps-btn { padding: 14px 0; font-size: 14px; }
  .escala-wrap { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .escala-btn { padding: 12px 4px; min-height: 64px; }
  .escala-num { font-size: 16px; }
  .escala-rotulo { font-size: 10px; }
  .section-header { padding: 12px 14px; }
  .section-title { font-size: 16px; }
  .actions { flex-direction: row; }
  .btn { flex: 1; padding: 14px 16px; }
  .btn-ghost { flex: 0 1 auto; }
}
