/* QuizMassa — bilhete de rifa sobre azul-anil; a resposta fica sob uma faixa prateada. */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2-variations"),
       url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  --anil: #2433d6;
  --limao: #fff3a6;
  --rosa: #ff5c9e;
  --rosa-claro: #ff7fb2;
  --tinta: #16133f;
  --nevoa: #e7eaff;
  --prata-1: #bcc2cf;
  --prata-2: #d9dde5;
  --erro: #b3104a;

  /* Escala tipográfica clássica: 14 16 18 21 24 36 48 72 */
  --t-14: 0.875rem;
  --t-16: 1rem;
  --t-18: 1.125rem;
  --t-21: 1.3125rem;
  --t-24: 1.5rem;
  --t-36: 2.25rem;
  --t-48: 3rem;
  --t-72: 4.5rem;

  --raio: 22px;
  --margem: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--anil);
  color: var(--nevoa);
  font-family: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--t-18);
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--rosa); color: var(--tinta); }

main { flex: 1; overflow-x: clip; }

.pagina { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }

/* ---------- Topo e rodapé ---------- */

.topo { padding: 1.5rem var(--margem) 0.5rem; }

.marca {
  font-weight: 800;
  font-stretch: 75%;
  font-size: var(--t-24);
  letter-spacing: -0.01em;
  color: var(--limao);
  text-decoration: none;
}
.marca:focus-visible { outline: 3px solid var(--limao); outline-offset: 4px; border-radius: 4px; }

.rodape {
  padding: 2rem var(--margem) 2.5rem;
  font-size: var(--t-14);
  color: rgb(231 234 255 / 0.78);
}
.rodape p { margin: 0; max-width: 40em; }

/* ---------- Tipografia ---------- */

.titulo-grande {
  margin: 0 0 1.5rem;
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(var(--t-48), 7vw, var(--t-72));
  line-height: 0.95;
  letter-spacing: -0.012em;
  color: var(--limao);
  text-wrap: balance;
}
.titulo-grande--medio { font-size: clamp(var(--t-36), 5vw, var(--t-48)); line-height: 1; }

.titulo-medio {
  margin: 0 0 1.5rem;
  font-weight: 800;
  font-stretch: 75%;
  font-size: var(--t-36);
  line-height: 1;
  color: var(--limao);
}

.lead {
  margin: 0 0 2rem;
  max-width: 32em;
  font-size: var(--t-21);
  line-height: 1.5;
}
.lead--alerta { color: var(--limao); font-weight: 700; }

/* ---------- Botões ---------- */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9em 1.6em;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 750;
  font-stretch: 87.5%;
  font-size: var(--t-21);
  line-height: 1.1;
  color: var(--tinta);
  background: var(--rosa);
  box-shadow: inset 0 -4px 0 rgb(22 19 63 / 0.22);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.botao:hover { background: var(--rosa-claro); }
.botao:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgb(22 19 63 / 0.22); }
.botao:focus-visible { outline: 3px solid var(--limao); outline-offset: 3px; }
.bilhete .botao:focus-visible { outline-color: var(--tinta); }
.botao[disabled] { cursor: progress; opacity: 0.8; }

.botao--largo { width: 100%; margin-top: 1.5rem; }

.botao--contorno { background: transparent; box-shadow: inset 0 0 0 2px var(--tinta); }
.botao--contorno:hover { background: rgb(22 19 63 / 0.07); }
.botao--contorno:active { box-shadow: inset 0 0 0 2px var(--tinta); }

.link-simples {
  color: var(--tinta);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.link-simples:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; border-radius: 3px; }

/* ---------- Layouts ---------- */

.dupla {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
}
.dupla--criar { align-items: start; }
.dupla__bilhete { display: flex; justify-content: center; }

.centro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: clamp(1rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
}
.centro .bilhete { text-align: left; }
.centro .lead { margin-inline: auto; text-wrap: balance; }

.convite { margin: 0 0 2rem; max-width: 30em; font-size: var(--t-21); line-height: 1.45; text-wrap: balance; }

.erro { padding-top: clamp(2rem, 8vw, 6rem); }
.erro .titulo-grande { max-width: 14em; }

/* ---------- O bilhete ---------- */

.bilhete {
  position: relative;
  width: 100%;
  max-width: 33rem;
  color: var(--tinta);
  filter: drop-shadow(0 22px 26px rgb(9 13 92 / 0.45));
}
.bilhete--inclinado { transform: rotate(-2.5deg); }
.bilhete--desafio { max-width: 38rem; }

.bilhete__corpo,
.bilhete__canhoto {
  --furo: 15px;
  background-color: var(--limao);
}

.bilhete__corpo {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: var(--raio) var(--raio) 0 0;
  /* Linhas concêntricas de papel de segurança */
  background-image: repeating-radial-gradient(circle at 100% 0, transparent 0 13px, rgb(22 19 63 / 0.05) 13px 14px);
  -webkit-mask:
    radial-gradient(circle var(--furo) at 0 100%, #0000 98%, #000),
    radial-gradient(circle var(--furo) at 100% 100%, #0000 98%, #000);
  mask:
    radial-gradient(circle var(--furo) at 0 100%, #0000 98%, #000),
    radial-gradient(circle var(--furo) at 100% 100%, #0000 98%, #000);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.bilhete__canhoto {
  position: relative;
  padding: 1.35rem clamp(1.5rem, 4vw, 2.25rem) 1.5rem;
  border-radius: 0 0 var(--raio) var(--raio);
  font-size: var(--t-16);
  line-height: 1.5;
  -webkit-mask:
    radial-gradient(circle var(--furo) at 0 0, #0000 98%, #000),
    radial-gradient(circle var(--furo) at 100% 0, #0000 98%, #000);
  mask:
    radial-gradient(circle var(--furo) at 0 0, #0000 98%, #000),
    radial-gradient(circle var(--furo) at 100% 0, #0000 98%, #000);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* Picote */
.bilhete__canhoto::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--furo) + 8px);
  right: calc(var(--furo) + 8px);
  border-top: 2px dashed rgb(22 19 63 / 0.3);
}
.bilhete__canhoto p { margin: 0; }
.bilhete__canhoto p + p { margin-top: 0.6rem; }

.pergunta {
  margin: 0;
  font-weight: 700;
  font-stretch: 87.5%;
  font-size: clamp(1.75rem, 4.6vw, var(--t-36));
  line-height: 1.12;
  letter-spacing: -0.005em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.pergunta--eco { margin-bottom: 1.25rem; font-size: var(--t-24); line-height: 1.2; }

/* ---------- Lacre (faixa prateada) ---------- */

.lacre-area {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 8rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.55);
  box-shadow: inset 0 0 0 2px rgb(22 19 63 / 0.12);
  overflow: hidden;
}

.resposta {
  margin: 0;
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(var(--t-48), 12vw, var(--t-72));
  line-height: 1;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease 0.35s, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.25) 0.3s;
}
.resposta:focus { outline: none; }
.resposta--media { font-size: clamp(1.75rem, 6vw, var(--t-36)); line-height: 1.15; }
.resposta--longa {
  justify-self: stretch;
  font-weight: 600;
  font-stretch: 100%;
  font-size: var(--t-18);
  line-height: 1.55;
  text-align: left;
}

.lacre {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #474d66;
  font-weight: 700;
  font-stretch: 87.5%;
  font-size: var(--t-18);
  background:
    linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.6) 50%, transparent 65%),
    repeating-linear-gradient(-45deg, var(--prata-1) 0 9px, var(--prata-2) 9px 18px);
  background-size: 250% 100%, auto;
  background-position: 120% 0, 0 0;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.8s cubic-bezier(0.75, 0, 0.2, 1);
}
.lacre span { padding: 0.3rem 0.75rem; border-radius: 999px; background: rgb(255 255 255 / 0.55); }
.lacre svg { flex: none; }

.carregando .lacre { animation: brilho 1.1s linear infinite; }
@keyframes brilho {
  from { background-position: 120% 0, 0 0; }
  to { background-position: -20% 0, 0 0; }
}

.foi-revelado .lacre { clip-path: inset(0 0 0 100%); }
.foi-revelado .resposta { opacity: 1; transform: none; }

.expirou .lacre { clip-path: inset(0 0 0 0); }
.expirou .resposta { opacity: 0; }

/* ---------- Mensagens e horários ---------- */

.mensagem {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgb(179 16 74 / 0.1);
  color: var(--erro);
  font-size: var(--t-16);
  font-weight: 650;
}

.horarios { display: grid; gap: 0.3rem; margin: 0; }
.horarios > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.45rem; }
.horarios dt { font-weight: 500; }
.horarios dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.horarios [data-faltam] { font-size: var(--t-24); font-stretch: 87.5%; line-height: 1.2; }
.fuso { font-size: var(--t-14); }
.bilhete__canhoto .fuso { margin-top: 0.5rem; }

/* ---------- Formulário de criação ---------- */

.formulario { display: grid; gap: 1.1rem; }
.campo { display: grid; gap: 0.4rem; }
.campo label { font-weight: 700; font-size: var(--t-16); }

.formulario textarea,
.campo-link {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 2px solid rgb(22 19 63 / 0.22);
  border-radius: 12px;
  font: inherit;
  font-size: var(--t-18);
  line-height: 1.4;
  color: var(--tinta);
  background: rgb(255 255 255 / 0.72);
}
.formulario textarea { resize: vertical; min-height: 3.4rem; }
.formulario textarea::placeholder { color: rgb(22 19 63 / 0.42); }
.formulario textarea:focus,
.campo-link:focus {
  outline: none;
  border-color: var(--tinta);
  background: #fff;
  box-shadow: 0 0 0 3px rgb(255 92 158 / 0.5);
}
.campo--erro textarea { border-color: var(--erro); }

.contador {
  margin: 0;
  font-size: var(--t-14);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgb(22 19 63 / 0.7);
}
.formulario .botao--largo { margin-top: 0.25rem; }
.formulario .mensagem { margin: 0; }

.titulo-bilhete {
  margin: 0 0 0.75rem;
  font-weight: 800;
  font-stretch: 75%;
  font-size: var(--t-36);
  line-height: 1;
}
.titulo-bilhete:focus { outline: none; }

.campo-link { font-size: var(--t-16); text-overflow: ellipsis; }

.acoes { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.acoes .botao { flex: 1 1 auto; padding-inline: 1.2em; font-size: var(--t-18); white-space: nowrap; }

/* ---------- Como funciona ---------- */

.passos { padding-block: 0.5rem clamp(3rem, 7vw, 6rem); }

.passos__lista {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}
.passos__lista li {
  counter-increment: passo;
  padding-top: 1rem;
  border-top: 2px dashed rgb(255 243 166 / 0.5);
  font-size: var(--t-16);
  line-height: 1.5;
}
.passos__lista li::before {
  content: counter(passo);
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 800;
  font-stretch: 75%;
  font-size: var(--t-48);
  line-height: 1;
  color: var(--limao);
}
.passos__lista strong { display: block; color: #fff; font-size: var(--t-18); }

/* ---------- Responsivo ---------- */

@media (max-width: 52rem) {
  .dupla { grid-template-columns: minmax(0, 1fr); }
  .passos__lista { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 34rem) {
  .lead, .convite { font-size: var(--t-18); }
  .passos__lista { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .bilhete--inclinado { transform: rotate(-1.5deg); }
  .bilhete__corpo, .bilhete__canhoto { --furo: 12px; }
  .botao { font-size: var(--t-18); }
  .horarios { gap: 0.6rem; }
  .horarios > div { display: block; }
  .horarios dt { font-size: var(--t-14); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
