/* ==========================================================
   Doce Mel · Gestão — login
   Direção: motion "bold / vibrant" editorial.
   Fundo papel, tipografia grande e preta, formas que se
   transformam e as linhas de picolé da Doce Mel como estrelas.
   ========================================================== */

:root {
  --papel: #efebe4;
  --tinta: #141110;
  --cinza: #8b847c;
  --linha: #cfc8be;
  --vermelho: #e3262a;

  /* cor da cena atual (o app.js troca) */
  --cena: #f26a2e;
  --cena-acento: #4dbdc6;

  --mola: cubic-bezier(.34, 1.56, .64, 1);
  --expo: cubic-bezier(.16, 1, .3, 1);
  --margem: clamp(16px, 2vw, 28px);

  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--tinta);
  background: var(--papel);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
button { font: inherit; color: inherit; }

/* texto pequeno em caixa alta — a "letra miúda" do template */
.meta {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-stretch: 110%;
}

.meta b { font-weight: 800; }

/* ==========================================================
   TOPO
   ========================================================== */

.topo {
  display: grid;
  grid-template-columns: auto repeat(3, max-content);
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
  padding: var(--margem) var(--margem) 0;
}

.topo__logo { width: 64px; height: auto; margin-right: clamp(0px, 4vw, 60px); }

/* ==========================================================
   TELA: palco + acesso
   ========================================================== */

.tela {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(380px, 1fr);
  gap: var(--margem);
  padding: var(--margem);
  min-height: 0;
}

/* ---------- PALCO ---------- */

.palco {
  position: relative;
  min-height: 520px;
}

.palco__forma {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--cena);
  border-radius: 50% 50% 28px 28px / 42% 42% 28px 28px;
  transition: border-radius 1.1s var(--expo), background-color .6s;
  isolation: isolate;
}

.palco__forma[data-forma="arco"]    { border-radius: 50% 50% 28px 28px / 42% 42% 28px 28px; }
.palco__forma[data-forma="d"]       { border-radius: 28px 50% 50% 28px / 28px 50% 50% 28px; }
.palco__forma[data-forma="pilula"]  { border-radius: 999px; }
.palco__forma[data-forma="folha"]   { border-radius: 50% 28px 50% 28px / 50% 28px 50% 28px; }
.palco__forma[data-forma="bolha"]   { border-radius: 46% 54% 38% 62% / 52% 44% 56% 48%; }
.palco__forma[data-forma="d-inv"]   { border-radius: 50% 28px 28px 50% / 50% 28px 28px 50%; }

/* cada cena ocupa a forma toda; a nova entra com um círculo que abre */
.cena {
  position: absolute;
  inset: 0;
  background: var(--c);
  clip-path: circle(0% at var(--ox, 50%) var(--oy, 100%));
  transition: clip-path 1.15s var(--expo);
}

.cena.ativa { clip-path: circle(150% at var(--ox, 50%) var(--oy, 100%)); }

/* palavrão no fundo, em faixas que deslizam */
.cena__texto {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .02em;
  font-size: clamp(90px, 13vw, 210px);
  line-height: .8;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: -.03em;
  white-space: nowrap;
  color: var(--a);
  user-select: none;
}

.cena__faixa {
  display: block;
  width: max-content;
  animation: correr 22s linear infinite;
}

.cena__faixa:nth-child(2) {
  animation-direction: reverse;
  color: transparent;
  -webkit-text-stroke: 2px var(--a);
}

.cena__faixa:nth-child(3) { animation-duration: 28s; }

/* disco atrás do picolé */
.cena__disco {
  position: absolute;
  left: 56%;
  bottom: -22%;
  width: min(70%, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--papel);
  transform: translateX(-50%) scale(0);
}

.cena.ativa .cena__disco {
  transform: translateX(-50%) scale(1);
  transition: transform 1s var(--mola) .15s;
}

/* o picolé sobe de baixo. A base da imagem (onde ela foi cortada) fica
   sempre bem abaixo da borda da forma — mesmo com o giro, o balanço e o
   "pulo" da animação — para parecer que o picolé continua lá embaixo. */
.cena__produto {
  position: absolute;
  left: 56%;
  bottom: -24%;
  height: 100%;
  width: auto;
  max-width: none;
  transform: translate(-50%, 70%) rotate(18deg);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .25));
}

.cena.ativa .cena__produto {
  transform: translate(-50%, 0) rotate(var(--giro, -6deg));
  transition: transform 1.3s cubic-bezier(.22, 1.18, .36, 1) .25s;
}

.cena.ativa .cena__produto.balanca {
  animation: balanco 5s ease-in-out infinite 1.5s;
}

/* flor branca girando — o asterisco do template */
.flor {
  position: absolute;
  z-index: 3;
  width: clamp(70px, 8vw, 120px);
  top: 6%;
  right: -2%;
  fill: var(--tinta);
  animation: girar 14s linear infinite;
  transition: top 1.1s var(--expo), right 1.1s var(--expo), width 1.1s var(--mola);
}

/* "agora no ar": contador + linha atual, na coluna do formulário */
.agora {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--tinta);
  overflow: hidden;
  max-width: 440px;
}

.contador {
  display: flex;
  align-items: flex-start;
  font-weight: 900;
  font-stretch: 62%;
  line-height: .82;
  overflow: hidden;
}

.contador__atual {
  display: inline-block;
  font-size: clamp(52px, 5.4vw, 84px);
  letter-spacing: -.02em;
}

.contador__total {
  font-size: clamp(16px, 1.4vw, 20px);
  margin-left: .15em;
  color: var(--cinza);
}

.legenda {
  display: grid;
  justify-items: end;
  text-align: right;
  overflow: hidden;
}

.legenda__linha {
  font-size: clamp(20px, 1.9vw, 28px);
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1;
  color: var(--cena);
  transition: color .6s;
}

.legenda__sabor {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 6px;
  color: var(--cinza);
}

.troca { animation: trocar .7s var(--expo); }

/* ==========================================================
   ACESSO
   ========================================================== */

.acesso {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(8px, 2vw, 24px) clamp(8px, 3vw, 48px) 0;
}

.acesso__miolo {
  margin: auto 0;
  width: 100%;
  max-width: 440px;
  padding-top: 24px;
}

.acesso__pre {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-stretch: 115%;
  color: var(--cena);
  transition: color .6s;
}

.acesso__titulo {
  margin: 0 0 clamp(28px, 5vh, 48px);
  font-size: clamp(56px, 6.4vw, 108px);
  line-height: .82;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

/* ---------- campos: linha simples, sem caixinha ---------- */

.form { display: grid; gap: 26px; }

.campo { position: relative; }

.campo label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-stretch: 115%;
  color: var(--cinza);
  transition: color .2s;
}

.campo:focus-within label { color: var(--tinta); }

.campo__linha { display: flex; align-items: center; gap: 12px; }

.campo input {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid var(--linha);
  border-radius: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 24px;
  font-weight: 600;
  font-stretch: 105%;
  color: var(--tinta);
  transition: border-color .25s;
}

.campo__linha input { flex: 1; }

/* barra que "enche" quando o campo está em foco */
.campo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(17px + 54px - 2px);
  height: 2px;
  background: var(--tinta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--expo);
}

.campo:focus-within::after { transform: scaleX(1); }
.campo.erro::after { transform: scaleX(1); background: var(--vermelho); }

.campo__ver {
  flex: none;
  padding: 8px 0;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  align-self: flex-end;
  margin-bottom: 10px;
}

.campo__ver:hover, .campo__ver:focus-visible { border-bottom-color: currentColor; outline: 0; }

.campo__erro,
.campo__aviso {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.campo__erro { color: var(--vermelho); }
.campo__erro:empty { display: none; }
.campo__aviso { color: #b06a00; }

.campo.erro { animation: tremer .4s; }

/* ---------- opções ---------- */

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

.lembrar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.lembrar input { position: absolute; opacity: 0; pointer-events: none; }

.lembrar__caixa {
  width: 18px;
  height: 18px;
  border: 2px solid var(--tinta);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background .2s;
}

.lembrar__caixa::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--papel);
  transform: scale(0);
  transition: transform .35s var(--mola);
}

.lembrar input:checked + .lembrar__caixa { background: var(--tinta); }
.lembrar input:checked + .lembrar__caixa::after { transform: scale(1); }
.lembrar input:focus-visible + .lembrar__caixa { outline: 2px solid var(--cena); outline-offset: 3px; }

.link {
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

.link:hover { color: var(--vermelho); }

/* ---------- botão: pílula preta que enche com a cor da cena ---------- */

.botao {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  margin-top: 8px;
  padding: 0 8px 0 30px;
  border: 0;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--papel);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-stretch: 115%;
}

.botao::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 34px;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cena);
  transform: translate(50%, -50%) scale(0);
  transition: transform .7s var(--expo), background-color .6s;
}

.botao:hover::before,
.botao:focus-visible::before { transform: translate(50%, -50%) scale(22); }

.botao:focus-visible { outline: 3px solid var(--tinta); outline-offset: 4px; }

.botao__bola {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--papel);
  color: var(--tinta);
  transition: transform .6s var(--mola);
}

.botao:hover .botao__bola { transform: rotate(-45deg); }

.botao__bola svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.botao.carregando { pointer-events: none; }
.botao.carregando .botao__bola { animation: girar 1s linear infinite; }

.form__status {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.form__status.erro { color: var(--vermelho); }

/* ---------- rodapé ---------- */

.rodape {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  color: var(--cinza);
}

/* ==========================================================
   ENTRADA DA PÁGINA
   ========================================================== */

.intro .palco__forma { animation: abrirForma 1.3s var(--expo) both; }
.intro .acesso__titulo,
.intro .acesso__pre,
.intro .form > *,
.intro .topo > * { animation: subir .9s var(--expo) both; }

.intro .topo > :nth-child(2) { animation-delay: .1s; }
.intro .topo > :nth-child(3) { animation-delay: .15s; }
.intro .topo > :nth-child(4) { animation-delay: .2s; }
.intro .acesso__pre { animation-delay: .35s; }
.intro .acesso__titulo { animation-delay: .4s; }
.intro .form > :nth-child(1) { animation-delay: .5s; }
.intro .form > :nth-child(2) { animation-delay: .56s; }
.intro .form > :nth-child(3) { animation-delay: .62s; }
.intro .form > :nth-child(4) { animation-delay: .68s; }

/* ==========================================================
   KEYFRAMES
   ========================================================== */

@keyframes correr { to { transform: translateX(-50%); } }
@keyframes girar { to { transform: rotate(360deg); } }

@keyframes balanco {
  0%, 100% { transform: translate(-50%, 0) rotate(var(--giro, -6deg)); }
  50% { transform: translate(-50%, -1.5%) rotate(calc(var(--giro, -6deg) + 3deg)); }
}

@keyframes trocar {
  from { transform: translateY(60%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes abrirForma {
  from { clip-path: circle(0% at 50% 100%); }
  to { clip-path: circle(120% at 50% 100%); }
}

@keyframes subir {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes tremer {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

/* ==========================================================
   RESPONSIVO
   ========================================================== */

@media (max-width: 1100px) {
  .topo__esconde { display: none; }
  .topo { grid-template-columns: auto repeat(2, max-content); }
}

@media (max-width: 860px) {
  .topo { grid-template-columns: auto 1fr; }
  .topo .meta:nth-of-type(2) { display: none; }
  .topo__logo { width: 48px; margin-right: 0; }

  .tela { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .agora { margin-bottom: 20px; }
  .palco { min-height: 0; height: 52vh; }
  .cena__texto { font-size: 22vw; }
  .acesso { padding: 12px 4px 0; }
  .acesso__titulo { font-size: 15vw; margin-bottom: 28px; }
  .flor { width: 56px; }
}

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