/* Calculadora 1.0 — base compartilhada (Sistema Argila)
   SSOT da identidade: black-friday-2026/identidade-visual/SISTEMA-B-ARGILA.md

   Regra desta base: a tela de cálculo CABE NUMA TELA SÓ, sem rolar (celular de 667px de altura
   em diante). O corpo (campos + botão) tem altura natural; o "herói" (foto/título) ocupa o que sobra.
   Cada versão só define tokens de cor e o herói. */

:root {
  --linho: #F4EFE6;
  --papel: #FBF8F1;
  --argila: #C96442;
  --argila-clara: #E8C4AE;
  --salvia: #617C5F;
  --cacau: #2E2320;
  --creme: #FFF5DC;
  --brasa: #A5402E; /* urgência apenas — nunca usada aqui */

  --f-titulo: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-texto: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --ease-mola: cubic-bezier(.2, .9, .3, 1.25);
  --ease-suave: cubic-bezier(.22, .61, .36, 1);

  /* tokens de tema (cada versão sobrescreve) */
  --pg: var(--linho);
  --painel: var(--papel);
  --tx: var(--cacau);
  --tx-suave: rgba(46, 35, 32, .68);
  --linha: rgba(46, 35, 32, .14);
  --campo-bg: #fff;
  --campo-borda: rgba(46, 35, 32, .16);
  --chip-bg: var(--argila-clara);
  --chip-tx: var(--cacau);
  --btn-bg: var(--argila);
  --btn-tx: var(--creme);
  --btn-sombra: 0 10px 22px -10px rgba(201, 100, 66, .9);
  --acc: var(--argila);
  --erro-bg: rgba(232, 196, 174, .5);
  --formula-bg: var(--argila-clara);
  --gota: var(--argila);
  --gota-num: var(--creme);
  --gota-brilho: rgba(232, 196, 174, .6);
  --foco: var(--cacau);
  --pad-x: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--pg); }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--pg);
  color: var(--tx);
  font-family: var(--f-texto);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }

/* -------------------------------------------------------------- estrutura */

.pagina {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  min-height: 600px;
  margin: 0 auto;
  padding: var(--pg-pad, 0);
  overflow-x: clip;
}
.cartao {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cartao-bg, transparent);
  border-radius: var(--cartao-raio, 0);
  box-shadow: var(--cartao-sombra, none);
}
.hero { position: relative; flex: 1 1 0; min-height: 0; }
.corpo { position: relative; z-index: 2; flex: none; padding: 16px var(--pad-x) 16px; background: var(--painel); }

/* tela de leitura (Sobre o cálculo) é a única que pode rolar */
body.estado-sobre .pagina { height: auto; min-height: 100dvh; }
body.estado-sobre .hero { display: none; }
body.estado-sobre .corpo { margin-top: 0; border-radius: var(--cartao-raio, 0); padding-top: 26px; padding-bottom: 28px; }

/* ------------------------------------------------------------------ texto */

.rotulo { font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; line-height: 1.35; }
.rotulo--traco { display: flex; align-items: center; gap: 10px; color: var(--tx-suave); }
.rotulo--traco::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--acc); flex: none; }

.titulo {
  font-family: var(--f-titulo);
  font-weight: 600;
  font-size: var(--t-size, 28px);
  line-height: 1.06;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.titulo em { font-style: italic; color: var(--acc); }

.nome { font-family: var(--f-titulo); font-weight: 600; line-height: 1.05; letter-spacing: -.005em; }
.cargo { font-size: 13.5px; line-height: 1.25; }

.redes { display: flex; gap: 2px; }
.redes a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; transition: background-color .2s var(--ease-suave), transform .2s var(--ease-suave); }
.redes a:hover, .redes a:focus-visible { background: rgba(255, 245, 220, .2); transform: translateY(-2px); }
.redes img { width: 17px; height: 17px; }
.redes--escuras img { filter: brightness(0) opacity(.72); }
.redes--escuras a:hover, .redes--escuras a:focus-visible { background: rgba(46, 35, 32, .08); }

/* ------------------------------------------------------------------ campos */

.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.item-input { display: flex; flex-direction: column; justify-content: flex-end; }
.item-input label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 500; line-height: 1.25; }

.campo {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--campo-bg);
  border: 1.5px solid var(--campo-borda);
  border-radius: 14px;
  padding: 3px 4px 3px 12px;
  transition: border-color .2s var(--ease-suave), box-shadow .2s var(--ease-suave), background-color .2s;
}
.campo:focus-within, .campo.tem-erro { border-color: var(--acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 22%, transparent); }

input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font-family: var(--f-texto);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--tx);
  outline: none;
  font-variant-numeric: lining-nums tabular-nums;
  caret-color: var(--acc);
  -moz-appearance: textfield;
  appearance: textfield;
}
input::placeholder { color: color-mix(in srgb, var(--tx) 30%, transparent); font-weight: 400; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.unidade { flex: none; min-width: 44px; text-align: center; padding: 9px 8px; border-radius: 10px; background: var(--chip-bg); color: var(--chip-tx); font-weight: 600; font-size: 14px; letter-spacing: .02em; }

.erro { margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: var(--erro-bg); border-left: 4px solid var(--acc); font-size: 14px; font-weight: 500; }
.erro:empty { display: none; }

/* ------------------------------------------------------------------ botões */

.area-botoes { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 14px; }
button { cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }

.btn-grande {
  width: 100%;
  padding: 15px 24px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-tx);
  font-weight: 600;
  font-size: 18px;
  box-shadow: var(--btn-sombra);
  transition: transform .2s var(--ease-suave), box-shadow .2s var(--ease-suave), filter .2s;
}
.btn-grande:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-grande:active { transform: scale(.985); }

.btn-pequeno {
  padding: 9px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--tx);
  font-weight: 500;
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--acc);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: background-color .2s;
}
.btn-pequeno:hover { background: color-mix(in srgb, var(--acc) 12%, transparent); }

.btn-contorno {
  padding: 13px 28px;
  border-radius: 999px;
  border: 1.5px solid var(--tx);
  background: transparent;
  color: var(--tx);
  font-weight: 600;
  font-size: 16px;
  transition: background-color .2s, color .2s, transform .2s var(--ease-suave);
}
.btn-contorno:hover { background: var(--tx); color: var(--painel-inv, var(--linho)); transform: translateY(-2px); }

button:focus-visible, a:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; }

/* --------------------------------------------------------------- resultado */

#area-resultado, #area-sobre-calculo { display: none; }
#area-resultado > *, #area-sobre-calculo > * { animation: sobe .55s var(--ease-suave) both; }
#area-resultado > :nth-child(2), #area-sobre-calculo > :nth-child(2) { animation-delay: .08s; }
#area-resultado > :nth-child(3) { animation-delay: .16s; }
#area-resultado > :nth-child(4) { animation-delay: .24s; }

#area-resultado { text-align: center; }
#area-resultado .rotulo { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--tx-suave); }
#area-resultado .rotulo::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--acc); }

#area-gota { display: flex; justify-content: center; margin: 12px 0 4px; }
#div-gota { position: relative; width: 168px; transform-origin: 50% 0; animation: gota-pinga .9s var(--ease-mola) both; }
.gota-forma { width: 100%; height: auto; filter: drop-shadow(0 3px 3px rgba(46, 35, 32, .22)) drop-shadow(0 14px 16px color-mix(in srgb, var(--gota) 30%, transparent)); }
.gota-forma .g-corpo { fill: var(--gota); }
.gota-forma .g-brilho { stroke: var(--gota-brilho); }
#conteudo-interno-gota { position: absolute; left: 0; right: 0; top: 47%; color: var(--gota-num); line-height: 1; }
#num-gotas-arredondado { font-family: var(--f-titulo); font-weight: 600; font-size: 62px; line-height: .95; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.un { margin-top: 5px; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }

#resultado-detalhado { margin-top: 10px; font-size: 16px; line-height: 1.5; }
#resultado-detalhado b { font-weight: 600; }
#resultado-detalhado i { color: var(--tx-suave); font-style: normal; font-size: 14px; }
#area-resultado .area-botoes { margin-top: 14px; }

.folha { position: absolute; z-index: 3; filter: drop-shadow(0 3px 3px rgba(46, 35, 32, .25)); pointer-events: none; }

/* --------------------------------------------------------- sobre o cálculo */

#area-sobre-calculo p { margin-top: 12px; font-size: 15.5px; }
#area-sobre-calculo .titulo-sobre { margin-top: 8px; font-family: var(--f-titulo); font-weight: 600; font-size: 25px; line-height: 1.1; }
.formula { margin-top: 14px !important; padding: 14px 16px; border-radius: 16px; background: var(--formula-bg); border-left: 4px solid var(--acc); font-weight: 600; font-size: 16px !important; line-height: 1.4; }
.legenda { color: var(--tx-suave); }
.assinatura-texto { font-family: var(--f-titulo); font-style: italic; font-size: 17px !important; color: var(--acc); font-weight: 600; }
.assinatura-cargo { font-family: var(--f-texto); font-style: normal; font-weight: 400; color: var(--tx); font-size: 14.5px; }
.rodape { margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--tx-suave); }
.rodape a { color: inherit; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ motion */

@keyframes sobe { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes arco-abre { from { opacity: 0; transform: scaleY(.6); } to { opacity: 1; transform: none; } }
@keyframes foto-entra { from { opacity: 0; transform: translate(-50%, 22px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes foto-fade { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes folha-a { from { opacity: 0; transform: rotate(-95deg) scale(.5); } to { opacity: 1; transform: rotate(-58deg) scale(1); } }
@keyframes gota-pinga {
  0% { opacity: 0; transform: translateY(-40px) scale(.6, .75); }
  55% { opacity: 1; transform: translateY(6px) scale(1.04, .96); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* A gota do resultado é a recompensa da ferramenta: continua para todo mundo (celular com "reduzir movimento"
     ou economia de bateria também), só que sem deslocamento, apenas surge e cresce um pouco. */
  #div-gota { animation: gota-suave .7s var(--ease-suave) both !important; }
}
@keyframes gota-suave { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ telas menores / maiores */

@media (max-height: 700px) {
  .campos { margin-top: 10px; }
  .item-input label { font-size: 13px; }
  .btn-grande { padding: 13px 24px; font-size: 17px; }
  .area-botoes { margin-top: 10px; }
  input { font-size: 24px; }
  #div-gota { width: 140px; }
  #num-gotas-arredondado { font-size: 52px; }
}
@media (max-width: 360px) {
  :root { --pad-x: 16px; }
  .campos { gap: 8px; }
  input { font-size: 22px; }
}
@media (min-width: 720px) {
  .pagina { height: min(calc(100dvh - 64px), 840px); margin-top: 32px; min-height: 620px; }
}
