:root {
  --fundo: #f6f4f0;
  --texto: #380e0e;
  --vinho: #4c1015;
  --suave: #6f5a57;
  --linha: #e2dbd2;
  --cartao: #fffdfa;
  --ok: #2f5d3a;
  --ok-fundo: #e7efe6;
  --alerta: #8a1c1c;
  --alerta-fundo: #f6e4e1;
  --aviso-fundo: #f3ecdf;
  --r: 2px;
  --toque: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 300 17px/1.5 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--vinho); }
h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
strong, b { font-weight: 400; }
[hidden] { display: none !important; }

/* Marca */
.marca { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--vinho); }
.marca img { width: 36px; height: 36px; }
.marca span { font-weight: 300; letter-spacing: .38em; font-size: .85rem; text-transform: uppercase; white-space: nowrap; }
.marca-grande { flex-direction: column; gap: .4rem; }
.marca-grande img { width: 84px; height: 84px; }
.marca-grande span { font-size: 1.05rem; letter-spacing: .45em; margin-right: -.45em; }

.sobre { font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--suave); }

/* Layout */
.conteiner { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.estreito { max-width: 560px; }
.topo {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--fundo) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linha);
}
.topo .conteiner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }

/* Botões e campos */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--toque); padding: 0 1.4em;
  border: 1px solid var(--vinho); border-radius: var(--r);
  background: var(--vinho); color: #fff;
  font: 400 .95rem 'Jost', sans-serif; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: opacity .15s;
}
.botao:hover { opacity: .9; }
.botao:disabled { opacity: .5; cursor: default; }
.botao.vazado { background: transparent; color: var(--vinho); }
.botao.leve { background: transparent; border-color: var(--linha); color: var(--texto); text-transform: none; letter-spacing: 0; }
.botao.pequeno { min-height: 36px; padding: 0 .9em; font-size: .78rem; }
.botao.largo { width: 100%; }

label { display: block; font-size: .85rem; letter-spacing: .06em; color: var(--suave); margin-bottom: .35rem; }
input, select, textarea {
  width: 100%; min-height: var(--toque);
  padding: .6rem .8rem;
  border: 1px solid var(--linha); border-radius: var(--r);
  background: #fff; color: var(--texto);
  font: 300 1.05rem 'Jost', sans-serif;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .botao:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--vinho); outline-offset: 1px;
}
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--vinho); flex: none; margin: 0; }
.campo { margin-bottom: 1rem; }
.linha-campos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.opcional { font-size: .75rem; color: var(--suave); letter-spacing: 0; }
.marcacao { display: flex; gap: .75rem; align-items: flex-start; font-size: .95rem; color: var(--texto); letter-spacing: 0; cursor: pointer; }
.marcacao input { margin-top: .15rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px; padding: 0 1rem;
  border: 1px solid var(--linha); border-radius: var(--r);
  background: #fff; color: var(--texto);
  font: 300 .95rem 'Jost', sans-serif; cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--vinho); border-color: var(--vinho); color: #fff; }

.msg { padding: .8rem 1rem; border-radius: var(--r); font-size: .95rem; margin: 0 0 1rem; }
.msg.erro { background: var(--alerta-fundo); color: var(--alerta); }
.msg.ok { background: var(--ok-fundo); color: var(--ok); }
.msg.aviso { background: var(--aviso-fundo); color: var(--texto); }

.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--r); }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 32px 16px; }
.login form { width: 100%; max-width: 380px; }
.login .marca-grande { display: flex; margin: 0 auto 2rem; width: max-content; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }

/* Gráficos */
.grafico-dica { position: absolute; z-index: 5; background: var(--texto); color: #fff; padding: 8px 10px; font-size: .82rem; line-height: 1.4; border-radius: var(--r); pointer-events: none; white-space: nowrap; box-shadow: 0 8px 20px -10px rgba(0,0,0,.45); }
.grafico-dica b { font-weight: 400; }

/* Topo marsala das áreas internas */
.topo.escuro { background: var(--vinho); border-bottom-color: var(--vinho); color: var(--fundo); backdrop-filter: none; }
.topo.escuro .marca { color: var(--fundo); }

/* Aviso rápido */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; background: var(--texto); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: .95rem; max-width: calc(100vw - 32px); box-shadow: 0 6px 18px -8px rgba(0,0,0,.4); }
.toast.erro { background: var(--alerta); }
