/* Um Doce Até o Diploma: tokens e componentes compartilhados
   Paleta extraída da arte da cliente: papel creme, caramelo, cacau e um toque de morango. */
:root {
  --cream: #f7ecdf;
  --paper: #fbf5ee;
  --sand: #efdcc5;
  --latte: #e3c7a7;
  --caramel: #b98a63;
  --cocoa: #8a5c45;
  --choc: #5b3522;
  --espresso: #3a2116;
  --berry: #e3867b;
  --berry-soft: #f6d3cc;
  --honey: #d6a24a;
  --leaf: #6f8a55;
  --muted: #a8968a;

  --ink: var(--espresso);
  --ink-soft: #6e5141;
  --line: rgba(91, 53, 34, 0.14);
  --surface: #fffaf4;
  --shadow-sm: 0 1px 2px rgba(58, 33, 22, 0.08), 0 2px 8px rgba(58, 33, 22, 0.06);
  --shadow: 0 2px 6px rgba(58, 33, 22, 0.08), 0 14px 34px -12px rgba(58, 33, 22, 0.28);
  --radius: 18px;
  --radius-sm: 12px;

  --f-script: 'Caveat', 'Segoe Script', cursive;
  --f-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --f-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.script { font-family: var(--f-script); font-weight: 700; letter-spacing: 0.01em; }
.eyebrow { font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--cocoa); font-weight: 500; }

/* Botões */
.btn {
  --bg: var(--choc); --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0.7em 1.3em;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bg); color: var(--fg);
  font-family: var(--f-display); font-weight: 500; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  box-shadow: 0 6px 16px -8px rgba(58, 33, 22, 0.6);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(58, 33, 22, 0.7); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--ghost { --bg: transparent; --fg: var(--choc); box-shadow: inset 0 0 0 1.5px var(--choc); }
.btn--ghost:hover { --bg: rgba(91, 53, 34, 0.06); }
.btn--soft { --bg: var(--sand); --fg: var(--choc); box-shadow: none; }
.btn--berry { --bg: var(--berry); --fg: #fff; }
.btn--wa { --bg: #25a35a; --fg: #fff; }
.btn--sm { min-height: 36px; padding: 0.4em 0.9em; font-size: 0.9rem; }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: var(--choc);
}
.icon-btn:hover { background: rgba(91, 53, 34, 0.08); }
svg.i { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Formulários */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: 0.88rem; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 0.7em 0.95em;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--caramel); box-shadow: 0 0 0 4px rgba(185, 138, 99, 0.2); }
.input[aria-invalid='true'] { border-color: var(--berry); }
.hint { font-size: 0.82rem; color: var(--ink-soft); }
.err { font-size: 0.82rem; color: #b44d42; min-height: 1em; }

/* Stepper de quantidade */
.stepper { display: inline-flex; align-items: center; background: var(--sand); border-radius: 999px; padding: 3px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); cursor: pointer; font-size: 1.15rem; line-height: 1; color: var(--choc); box-shadow: var(--shadow-sm); }
.stepper button:hover { background: #fff; }
.stepper output, .stepper input { min-width: 36px; width: 44px; text-align: center; font-weight: 800; border: 0; background: transparent; }
.stepper input::-webkit-inner-spin-button { display: none; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 0.35em 0.85em; border-radius: 999px; font-size: 0.85rem; font-weight: 700; background: var(--sand); color: var(--choc); border: 0; cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--choc); color: var(--paper); }
.badge { display: inline-block; padding: 0.2em 0.6em; border-radius: 999px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; background: var(--berry-soft); color: #9a3f35; }

/* Modal / drawer */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(58, 33, 22, 0.42); backdrop-filter: blur(3px); }
.modal { width: min(520px, calc(100vw - 32px)); background: var(--paper); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 600; }
dialog[open] .modal { animation: pop 0.35s var(--ease); }
@keyframes pop { from { transform: translateY(14px) scale(0.98); opacity: 0; } }

/* Toast */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--espresso); color: var(--paper); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 700; animation: pop 0.3s var(--ease); transition: opacity 0.3s, transform 0.3s; }
.toast--err { background: #a5463c; }
.toast.out { opacity: 0; transform: translateY(8px); }

.demo-ribbon { background: var(--choc); color: var(--sand); text-align: center; font-size: 0.82rem; padding: 6px 16px; }
.demo-ribbon a { color: #fff; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
