:root {
  /* paleta tirada da logo: verde oliva profundo + ouro metálico */
  --bg: #1a241d;
  --bg-2: #202c24;
  --card: #26352b;
  --card-2: #2f4033;
  --line: rgba(222, 190, 115, 0.17);
  --line-strong: rgba(222, 190, 115, 0.38);
  --text: #f5eedd;
  --muted: #b7c0b0;
  --faint: #829083;
  --gold: #c9a24f;
  --gold-hi: #e8cf8a;
  --gold-ink: #1d1707;
  --metal: linear-gradient(135deg, #9c7a2f 0%, #e9d18b 28%, #c09a45 52%, #f2e2a8 74%, #a88532 100%);
  --ok: #5fc08f;
  --warn: #e3b04b;
  --bad: #e0766b;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --serif: "Bodoni Moda", Didot, Georgia, serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Great Vibes", "Snell Roundhand", cursive;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.muted { color: var(--muted); }
.ic { width: 1.15em; height: 1.15em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* botões: só propriedades nomeadas na transição */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0 1.25rem;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font-weight: 600; font-size: 0.95rem; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 180ms ease, background-position 400ms var(--ease-out), border-color 180ms ease, color 180ms ease, opacity 180ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-gold { background: linear-gradient(110deg, #b88f3c 0%, #ecd590 45%, #c9a24f 70%, #b88f3c 100%) 0 0 / 200% 100%; border-color: var(--gold); color: var(--gold-ink); }
/* borboleta da logo: traço que se desenha uma vez */
.bf { width: 100%; height: auto; color: var(--gold-hi); fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.bf path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1800ms var(--ease-out) forwards; animation-delay: calc(500ms + var(--k, 0) * 140ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .bf path { animation: none; stroke-dashoffset: 0; } }
/* ouro metálico em texto, como na logo */
.metal { background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not ((background-clip: text) or (-webkit-background-clip: text)) { .metal { color: var(--gold-hi); background: none; } }
.btn-sm { min-height: 36px; padding: 0 0.9rem; font-size: 0.85rem; }
.btn-danger { color: var(--bad); border-color: rgba(224, 118, 107, 0.4); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--gold); }
  .btn-gold:hover { background-position: 100% 0; border-color: var(--gold-hi); }
  .btn-danger:hover { border-color: var(--bad); }
}

/* abas em pílula (site e painel) */
.tabs { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tab {
  flex: none; min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 140ms var(--ease-out);
}
.tab:active { transform: scale(0.97); }
.tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .tab:not([aria-selected="true"]):hover { color: var(--text); border-color: var(--line-strong); } }

/* campos */
.field { display: grid; gap: 0.4rem; min-width: 0; }
.field > span { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 0.65rem 0.9rem;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, background-color 180ms ease;
}
.input:focus { outline: none; border-color: var(--gold); background: rgba(255, 255, 255, 0.06); }
textarea.input { min-height: 90px; resize: vertical; }

/* aviso (toast) */
#toasts {
  position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; z-index: 200;
}
.toast {
  max-width: 440px; padding: 0.7rem 1rem; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px -12px #000;
  opacity: 0; transform: translateY(8px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast.in { opacity: 1; transform: none; }
.toast.bad { border-color: var(--bad); }
.toast.ok { border-color: var(--ok); }

.demo-badge {
  position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60; pointer-events: none;
  padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.72rem; color: var(--gold-ink); background: var(--gold-hi); opacity: 0.9;
}

/* entrada por rolagem: só com JS ativo */
html.js .reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
html.js .reveal.in { opacity: 1; transform: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { transform: none; transition: opacity 300ms ease; }
  .btn:active { transform: none; }
  @keyframes rise { from { opacity: 0; } }
}
