/* Estilos exclusivos das paginas de enquete. Carregado so onde e usado. */

/* ===== Enquete ===== */
.poll {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: var(--space-lg) var(--space-sm) var(--space-xl);
}
.poll__head { max-width: 52rem; margin-bottom: var(--space-lg); }
.poll__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 1.1em;
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--color-gold);
}
.poll__dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--color-red);
  box-shadow: 0 0 0 3px rgba(217, 59, 59, 0.25);
}
.poll__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 1.6rem + 3.2vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-md);
  text-wrap: balance;
}
.poll__title-accent { color: var(--color-gold); }
.poll__lede {
  max-width: 42rem;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  opacity: 0.8;
  margin: 0 0 var(--space-md);
}
.poll__lede strong { color: var(--color-gold-soft); }

.poll__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
.poll__fact {
  padding: var(--space-sm);
  border: 1px solid rgba(250, 250, 247, 0.12);
  border-radius: 12px;
  background: rgba(250, 250, 247, 0.03);
}
.poll__fact-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.25em;
}
.poll__fact-value { display: block; font-weight: 600; font-size: 0.95rem; }

.poll__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: var(--space-md);
  align-items: start;
}
.poll__section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 var(--space-sm);
}
.poll__form-wrap,
.poll__results {
  padding: var(--space-md);
  border: 1px solid rgba(250, 250, 247, 0.12);
  border-radius: 16px;
  background: rgba(250, 250, 247, 0.03);
}

.poll__art {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin-bottom: var(--space-md);
  border: 1px dashed rgba(250, 250, 247, 0.2);
  border-radius: 12px;
  font-family: var(--font-accent);
  font-style: italic;
  opacity: 0.45;
  text-align: center;
  padding: var(--space-sm);
}

.poll-form__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.5em;
  padding: 0;
}
.poll-form__input {
  width: 100%;
  padding: 0.9em 1.1em;
  margin-bottom: var(--space-sm);
  border: 1px solid rgba(250, 250, 247, 0.18);
  border-radius: 10px;
  background: rgba(8, 13, 28, 0.6);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: 1rem;
}
.poll-form__input::placeholder { color: rgba(250, 250, 247, 0.35); }
.poll-form__input:focus-visible { border-color: var(--color-gold); }

.poll-form__fieldset { border: 0; padding: 0; margin: 0 0 var(--space-sm); }
.poll-form__fieldset[hidden] { display: none; }
.poll-form__choices { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.poll-choice,
.poll-size {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.2em;
  border: 1px solid rgba(250, 250, 247, 0.2);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color var(--duration-normal) var(--ease-out-expo),
              background var(--duration-normal) var(--ease-out-expo);
}
.poll-choice input,
.poll-size input { position: absolute; opacity: 0; pointer-events: none; }
.poll-choice:hover,
.poll-size:hover { border-color: rgba(250, 250, 247, 0.45); }
.poll-choice:has(input:checked),
.poll-size:has(input:checked) {
  border-color: var(--color-gold);
  background: rgba(245, 197, 24, 0.14);
  color: var(--color-gold-soft);
}
.poll-choice:has(input:focus-visible),
.poll-size:has(input:focus-visible) { outline: 3px solid var(--color-gold); outline-offset: 3px; }

.poll-form__sizes { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.poll-size { min-width: 3.5rem; justify-content: center; }

.poll-form__error {
  margin: 0 0 var(--space-sm);
  padding: 0.7em 1em;
  border-radius: 8px;
  background: rgba(217, 59, 59, 0.15);
  border: 1px solid rgba(217, 59, 59, 0.4);
  color: #ffb4b4;
  font-size: 0.9rem;
}
.poll-form__error[hidden] { display: none; }

.poll-form__submit {
  width: 100%;
  padding: 1em 1.5em;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe27a 0%, #f5c518 55%, #d9960f 100%);
  color: #1a1408;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 0 24px 3px rgba(245, 197, 24, 0.25);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo);
}
.poll-form__submit:hover:not(:disabled),
.poll-form__submit:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 34px 8px rgba(245, 197, 24, 0.4);
}
.poll-form__submit:disabled { opacity: 0.6; cursor: default; }
.poll-form__note { font-size: 0.78rem; opacity: 0.5; margin: var(--space-sm) 0 0; }

/* Resultado no estilo das enquetes do WhatsApp */
.poll-results__loading { font-family: var(--font-accent); font-style: italic; opacity: 0.5; margin: 0; }
.poll-results__total { font-size: 0.8rem; opacity: 0.55; margin: 0 0 var(--space-sm); }
.poll-results__subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: var(--space-md) 0 var(--space-xs);
}
.poll-results__list,
.poll-results__sizes { list-style: none; margin: 0; padding: 0; }

.poll-bar { display: grid; grid-template-columns: 1fr auto; gap: 0.3em 0.6em; margin-bottom: var(--space-sm); }
.poll-bar__top { display: flex; justify-content: space-between; align-items: baseline; grid-column: 1 / -1; }
.poll-bar__label { font-weight: 600; font-size: 0.95rem; }
.poll-bar__count { font-size: 0.8rem; opacity: 0.55; }
.poll-bar > .poll-bar__track { grid-column: 1; }
.poll-bar__track {
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(250, 250, 247, 0.1);
  overflow: hidden;
}
.poll-bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: rgba(250, 250, 247, 0.35);
  transition: width 600ms var(--ease-out-expo);
}
.poll-bar--yes .poll-bar__fill { background: linear-gradient(90deg, #f5c518, #ffe27a); }
.poll-bar__pct { grid-column: 2; font-size: 0.78rem; opacity: 0.6; font-variant-numeric: tabular-nums; }

.poll-size-bar {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2rem;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.5em;
}
.poll-size-bar__label { font-weight: 700; font-size: 0.85rem; }
.poll-size-bar__count { font-size: 0.8rem; opacity: 0.6; text-align: right; font-variant-numeric: tabular-nums; }

.poll__back {
  display: inline-block;
  margin-top: var(--space-lg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid var(--color-line);
  padding-bottom: 0.2em;
}
.poll__back:hover,
.poll__back:focus-visible { border-color: var(--color-gold); }

/* ===== Lista interna da enquete ===== */
.tally {
  max-width: 60rem;
  margin-inline: auto;
  padding: var(--space-lg) var(--space-sm) var(--space-xl);
}
.tally__head { margin-bottom: var(--space-md); }
.tally__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  margin: 0 0 var(--space-xs);
}
.tally__lede { opacity: 0.6; margin: 0; }
.tally__auth {
  max-width: 22rem;
  padding: var(--space-md);
  border: 1px solid rgba(250, 250, 247, 0.12);
  border-radius: 16px;
  background: rgba(250, 250, 247, 0.03);
}
.tally__result[hidden] { display: none; }
.tally__summary {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--color-gold);
  background: rgba(245, 197, 24, 0.08);
  line-height: 1.7;
}
.tally__summary span { font-size: 0.85rem; opacity: 0.7; }
.tally__actions { margin-bottom: var(--space-sm); }
.tally__csv {
  padding: 0.6em 1.3em;
  border: 1px solid rgba(250, 250, 247, 0.3);
  border-radius: 999px;
  background: none;
  color: var(--color-cream);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}
.tally__csv:hover,
.tally__csv:focus-visible { border-color: var(--color-gold); }
.tally__table-wrap { overflow-x: auto; }
.tally__table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tally__table th,
.tally__table td {
  padding: 0.7em 0.9em;
  text-align: left;
  border-bottom: 1px solid rgba(250, 250, 247, 0.1);
  white-space: nowrap;
}
.tally__table th {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}

.poll-form__hint {
  margin: -0.4rem 0 var(--space-sm);
  padding: 0.7em 1em;
  border-radius: 8px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  background: rgba(245, 197, 24, 0.1);
  color: var(--color-gold-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}
.poll-form__hint[hidden] { display: none; }

/* ===== Celular ===== */
@media (max-width: 640px) {
  .poll { padding-left: var(--space-sm); padding-right: var(--space-sm); }
  .poll__grid { grid-template-columns: 1fr; }
  .poll__facts { grid-template-columns: 1fr 1fr; }
  .poll__form-wrap,
  .poll__results { padding: var(--space-sm); }

  /* alvos de toque confortaveis */
  .poll-form__input { font-size: 16px; padding: 0.95em 1em; }
  .poll-choice,
  .poll-size { padding: 0.85em 1.2em; font-size: 0.95rem; }
  .poll-form__choices { display: grid; grid-template-columns: 1fr 1fr; }
  .poll-choice { justify-content: center; }
  .poll-form__sizes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
  .poll-size { min-width: 0; padding: 0.85em 0.3em; }
  .poll-form__submit { padding: 1.1em 1.2em; }

  .poll__art { aspect-ratio: 3 / 2; }
  .poll-size-bar { grid-template-columns: 2rem 1fr 1.75rem; }

  .tally__auth { max-width: none; padding: var(--space-sm); }
  .tally__table th,
  .tally__table td { padding: 0.6em 0.7em; }
}

@media (max-width: 380px) {
  .poll__facts { grid-template-columns: 1fr; }
  .poll-form__sizes { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Portao de acesso da enquete ===== */
.poll-gate {
  max-width: 26rem;
  padding: var(--space-md);
  border: 1px solid rgba(250, 250, 247, 0.12);
  border-radius: 16px;
  background: rgba(250, 250, 247, 0.03);
}
.poll-gate[hidden] { display: none; }
.poll-gate__text { font-size: 0.95rem; opacity: 0.75; margin: 0 0 var(--space-md); }
.poll-gate__input {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  padding-left: 0.5em;
}
.poll__grid[hidden] { display: none; }

/* ===== Anel de participacao ===== */
.turnout {
  grid-column: 1 / -1;
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 1px solid rgba(250, 250, 247, 0.12);
  border-radius: 16px;
  background: rgba(250, 250, 247, 0.03);
  text-align: center;
}
.turnout__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 var(--space-md);
}
.turnout__chart {
  position: relative;
  width: min(15rem, 70vw);
  margin-inline: auto;
}
.turnout__svg { display: block; width: 100%; height: auto; transform: rotate(-90deg); }
.turnout__track {
  fill: none;
  stroke: rgba(250, 250, 247, 0.09);
  stroke-width: 20;
}
.turnout__value {
  fill: none;
  stroke: url(#turnoutGrad);
  stroke-width: 20;
  stroke-linecap: round;
  /* 2 * PI * 82 */
  stroke-dasharray: 515.22;
  stroke-dashoffset: 515.22;
  transition: stroke-dashoffset 900ms var(--ease-out-expo);
}
.turnout__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
}
.turnout__pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.turnout__caption { font-size: 0.75rem; opacity: 0.55; }
.turnout__note {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 0.9rem;
  opacity: 0.55;
  margin: var(--space-md) 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .turnout__value { transition: none; }
}
