/* Identidade visual do Avaly (avaly.me): cores e fontes. */
:root {
  --paper: #F3F2EC;
  --surface: #FCFBF7;
  --sunken: #ECEBE4;
  --ink: #123D2E;
  --ink2: #44524B;
  --muted: #5F6B65;
  --line: #E2E0D6;
  --line2: #D2D0C4;
  --forest: #123D2E;
  --f700: #2C7258;
  --f100: #E3EEE6;
  --lime: #CDEB6E;
  --lime6: #B9DA52;
  --amber: #F59E0B;
  --hero-texto: #B9CCC2;

  --alerta-fundo: #FEF3C7;
  --alerta-texto: #8A4B08;
  --erro: #B42318;
  --erro-fundo: #FBE4E1;

  --fd: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --fs: "Instrument Serif", Georgia, serif;
  --fu: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fm: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --ease: cubic-bezier(.2, .75, .15, 1);
  --mola: cubic-bezier(.34, 1.56, .64, 1);
  --sombra: 0 1px 2px rgba(10, 42, 31, .05), 0 28px 56px -24px rgba(10, 42, 31, .28);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--fu);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.coluna {
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.rotulo {
  display: block;
  margin: 0;
  font-family: var(--fm);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Animações base ----------------------------------------------------- */

@keyframes surgir {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.5);
  }
}

@keyframes anel {
  from {
    box-shadow: 0 0 0 0 rgba(185, 218, 82, .7);
  }
  to {
    box-shadow: 0 0 0 16px rgba(185, 218, 82, 0);
  }
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

@keyframes flutuar {
  50% {
    transform: translateY(-12px);
  }
}

@keyframes pulsar {
  0% {
    box-shadow: 0 0 0 0 rgba(205, 235, 110, .6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(205, 235, 110, 0);
  }
}

@keyframes riscar {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes tremer {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

@keyframes brilho {
  0% {
    transform: translateX(-100%);
  }
  45%,
  100% {
    transform: translateX(250%);
  }
}

@keyframes respirar {
  50% {
    transform: scale(1.08);
    opacity: .55;
  }
}

.entrada {
  animation: surgir .8s var(--ease) both;
}

.d1 { animation-delay: .08s; }
.d2 { animation-delay: .16s; }
.d3 { animation-delay: .26s; }
.d4 { animation-delay: .38s; }

/* ---- Topo (faixa verde) -------------------------------------------------- */

.topo {
  position: relative;
  overflow: hidden;
  padding: 0 16px 136px;
  background-color: var(--forest);
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.4px);
  background-size: 22px 22px;
  color: #fff;
}

.topo::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  left: -220px;
  bottom: -230px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
  pointer-events: none;
}

.orbita {
  position: absolute;
  width: 620px;
  height: 620px;
  right: -260px;
  top: 30px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  pointer-events: none;
  animation: girar 48s linear infinite;
}

.orbita::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 6px rgba(205, 235, 110, .14), 0 0 24px rgba(205, 235, 110, .5);
}

.topo__ponto {
  position: absolute;
  right: 14%;
  top: 112px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lime);
  opacity: .9;
  animation: flutuar 6s ease-in-out infinite;
}

.topo__barra {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0;
}

.marca {
  font-family: var(--fd);
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -.03em;
  text-decoration: none;
  color: #fff;
}

.marca span,
.rodape a span {
  color: var(--lime);
}

.topo__hero {
  position: relative;
  z-index: 1;
  padding-top: 36px;
}

.pilula {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.pilula__ponto {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulsar 2s ease-out infinite;
}

.topo h1 {
  margin: 20px 0 16px;
  font-family: var(--fd);
  font-size: clamp(2.375rem, 5vw + 1rem, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.035em;
}

.topo h1 em,
.regras h2 em {
  font-family: var(--fs);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
}

.topo h1 em {
  font-size: 1.08em;
  color: var(--lime);
}

.destaque {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.destaque__risco {
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 12px;
  overflow: visible;
}

.destaque__risco path {
  fill: none;
  stroke: var(--lime);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: .75;
  animation: riscar 1.1s var(--ease) .9s forwards;
}

.topo__hero p {
  max-width: 500px;
  margin: 0;
  font-size: 1.0625rem;
  color: var(--hero-texto);
}

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

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--fu);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}

.botao:active {
  transform: translateY(1px) scale(.99);
}

.botao:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(205, 235, 110, .55);
}

.botao--primario {
  flex: 1;
  background: var(--lime);
  color: var(--forest);
}

.botao--primario:hover {
  background: var(--lime6);
  box-shadow: 0 10px 24px -12px rgba(18, 61, 46, .45);
}

.seta {
  display: inline-block;
  transition: transform .25s var(--ease);
}

.botao--primario:hover .seta {
  transform: translateX(4px);
}

.botao--secundario {
  background: transparent;
  color: var(--ink);
  border-color: var(--line2);
}

.botao--secundario:hover {
  border-color: var(--ink2);
}

.botao--fantasma {
  min-height: 40px;
  padding: 0 16px;
  font-size: .875rem;
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
}

.botao--fantasma:hover {
  border-color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .06);
}

/* ---- Conteúdo e cartões ------------------------------------------------- */

.conteudo {
  position: relative;
  z-index: 1;
  max-width: 672px; /* 640 + o respiro lateral, para alinhar com o topo */
  margin-top: -100px;
  padding: 0 16px 40px;
}

.cartao {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--sombra);
  padding: 28px;
}

.cartao + .cartao {
  margin-top: 20px;
}

.cartao > .rotulo {
  margin-bottom: 18px;
}

/* ---- Campos ------------------------------------------------------------- */

.trimestres {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.campo label {
  display: block;
  margin-bottom: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink);
}

.campo .opcional {
  font-weight: 400;
  color: var(--muted);
}

.campo input {
  width: 100%;
  height: 60px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--fd);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: center;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease), transform .25s var(--ease);
}

.campo input::placeholder {
  font-family: var(--fu);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: #9AA39E;
}

.campo input:hover {
  border-color: #BEBCAF;
}

.campo input.preenchido {
  background: #fff;
  border-color: #B5CDBE;
}

.campo input:focus {
  outline: none;
  border-color: var(--forest);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(205, 235, 110, .55);
  transform: translateY(-1px);
}

.campo input[aria-invalid="true"] {
  border-color: var(--erro);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, .1);
}

.campo input.tremer {
  animation: tremer .4s ease;
}

.erro {
  min-height: 1.3em;
  margin: 6px 0 0;
  font-size: .8125rem;
  line-height: 1.3;
  color: var(--erro);
}

.acoes {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

/* ---- Aguardando as notas ------------------------------------------------ */

.aguardando {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px dashed var(--line2);
  border-radius: 16px;
  font-size: .9375rem;
  color: var(--muted);
  animation: surgir .5s var(--ease);
}

.aguardando p {
  margin: 0;
}

.aguardando__pontos {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.aguardando__pontos span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line2);
  transition: background-color .3s var(--ease), transform .3s var(--mola);
}

.aguardando__pontos span.ativo {
  background: var(--lime6);
  transform: scale(1.25);
}

/* ---- Resultado ---------------------------------------------------------- */

.resultado {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px dashed var(--line2);
}

.resultado > *,
.final > * {
  animation: surgir .55s var(--ease) both;
}

.resultado > :nth-child(2),
.final > :nth-child(2) { animation-delay: .06s; }
.resultado > :nth-child(3),
.final > :nth-child(3) { animation-delay: .12s; }
.resultado > :nth-child(4),
.final > :nth-child(4) { animation-delay: .18s; }
.resultado > :nth-child(5) { animation-delay: .26s; }
.resultado > :nth-child(6) { animation-delay: .34s; }

.resultado__linha {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.resultado__nota {
  display: block;
  margin-top: 4px;
  font-family: var(--fd);
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.resultado__nota--menor {
  font-size: 2.75rem;
}

.selo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}

.selo::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.selo--pop {
  animation: pop .5s var(--mola) both;
}

.selo--ok {
  background: var(--lime);
  color: var(--forest);
}

.selo--ok.selo--pop {
  animation: pop .5s var(--mola) both, anel 1.1s ease-out .3s 2;
}

.selo--alerta {
  background: var(--alerta-fundo);
  color: var(--alerta-texto);
}

.selo--erro {
  background: var(--erro-fundo);
  color: var(--erro);
}

/* Barra de 0 a 10 com a marca do mínimo */
.medidor {
  margin-top: 20px;
}

.medidor__trilho {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--sunken);
}

.medidor__barra {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--valor, 0%);
  overflow: hidden;
  border-radius: inherit;
  background: var(--lime6);
  transition: width 1.1s var(--ease), background-color .4s var(--ease);
}

.medidor__barra::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
  animation: brilho 3.6s ease-in-out 1.2s infinite;
}

.medidor[data-situacao="recuperacao"] .medidor__barra {
  background: var(--amber);
}

.medidor[data-situacao="reprovado"] .medidor__barra {
  background: var(--erro);
}

.medidor__marca {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: var(--marca, 70%);
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--ink);
}

.medidor__marca::after {
  content: attr(data-rotulo);
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.medidor__escala {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--fm);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.conta {
  margin: 12px 0 0;
  font-family: var(--fm);
  font-size: .8125rem;
  color: var(--muted);
}

.mensagem {
  margin: 12px 0 0;
  color: var(--ink2);
}

/* Cartão verde: quanto precisa na recuperação */
.precisa {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 24px;
  border-radius: 20px;
  background-color: var(--forest);
  background-image:
    radial-gradient(circle at 100% 0%, rgba(205, 235, 110, .2), transparent 50%),
    radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px);
  background-size: auto, 18px 18px;
  color: #fff;
}

.precisa::before,
.precisa::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.precisa::before {
  width: 240px;
  height: 240px;
  right: -90px;
  top: -90px;
  border: 1px solid rgba(255, 255, 255, .09);
}

.precisa::after {
  width: 150px;
  height: 150px;
  right: -45px;
  top: -45px;
  border: 1px solid rgba(205, 235, 110, .25);
  animation: respirar 4s ease-in-out infinite;
}

.precisa .rotulo {
  position: relative;
  color: var(--hero-texto);
}

.precisa__nota {
  position: relative;
  display: block;
  margin-top: 8px;
  font-family: var(--fd);
  font-size: 4.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  color: var(--lime);
  text-shadow: 0 0 32px rgba(205, 235, 110, .35);
}

.precisa__sub {
  position: relative;
  display: block;
  margin-top: 8px;
  font-size: 1.0625rem;
  font-weight: 500;
}

.precisa__motivo {
  position: relative;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .875rem;
  color: var(--hero-texto);
}

/* Simulação com a nota da recuperação */
.recuperacao {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.recuperacao .campo input {
  max-width: 180px;
  background: var(--surface);
}

.final {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px dashed var(--line2);
}

/* ---- Regras ------------------------------------------------------------- */

.regras h2 {
  margin: 8px 0 18px;
  font-family: var(--fd);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.regras h2 em {
  font-size: 1.08em;
  color: var(--f700);
}

.passos {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}

.passos li {
  counter-increment: passo;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.passos li:first-child {
  border-top: 0;
  padding-top: 0;
}

.passos li:last-child {
  padding-bottom: 0;
}

.passos li::before {
  content: counter(passo);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--f100);
  color: var(--f700);
  font-family: var(--fm);
  font-size: .75rem;
  font-weight: 600;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--mola);
}

.passos li:hover::before {
  background: var(--lime);
  color: var(--forest);
  transform: scale(1.12);
}

.passo__titulo {
  font-weight: 600;
}

.passo__valor {
  font-size: .9375rem;
  color: var(--muted);
  text-align: right;
}

/* Aparece ao rolar a página (navegadores com scroll-driven animations). */
@supports (animation-timeline: view()) {
  .revelar,
  .revelar .passos li {
    animation: surgir linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}

/* ---- Rodapé ------------------------------------------------------------- */

.rodape {
  margin-top: 28px;
  text-align: center;
  font-size: .8125rem;
  color: var(--muted);
}

.rodape p {
  margin: 4px 0;
}

.rodape a {
  font-family: var(--fd);
  font-weight: 750;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}

/* ---- Confete ------------------------------------------------------------ */

.confete {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---- Telas pequenas ----------------------------------------------------- */

@media (max-width: 520px) {
  .topo {
    padding-bottom: 120px;
  }

  .topo__hero {
    padding-top: 20px;
  }

  .topo__ponto {
    right: 8%;
    top: 96px;
    width: 10px;
    height: 10px;
  }

  .conteudo {
    margin-top: -88px;
  }

  .cartao {
    padding: 20px;
    border-radius: 20px;
  }

  .trimestres {
    gap: 8px;
  }

  .campo label {
    font-size: .8125rem;
  }

  .campo input {
    height: 56px;
    font-size: 1.375rem;
  }

  .aguardando {
    padding: 14px;
    font-size: .875rem;
  }

  .resultado__nota {
    font-size: 3.25rem;
  }

  .resultado__nota--menor {
    font-size: 2.5rem;
  }

  .precisa {
    padding: 20px;
  }

  .precisa__nota {
    font-size: 3.5rem;
  }

  .recuperacao {
    padding: 16px;
  }

  .passos li {
    grid-template-columns: 28px 1fr;
  }

  .passo__valor {
    grid-column: 2;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .destaque__risco path {
    stroke-dashoffset: 0;
  }
}
