/* Base compartilhada: tokens, reset e componentes usados no cardápio e no painel. */

:root {
  --font-text: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-display: 'Unbounded', 'Geist', system-ui, sans-serif;
  --display-weight: 600;
  --display-stretch: 100%;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --cut: 10px;

  /* Tema padrão (modelo Aurora). O motor de tema reescreve estes valores. */
  --bg: #070912; --bg-2: #0d111d; --bg-3: #151a29;
  --text: #eef1fb; --text-2: #a7aec6; --text-3: #7e869e;
  --line: rgba(226,232,255,.09); --line-2: rgba(226,232,255,.18);
  --accent: #1a5cf0; --accent-hover: #2f6dff; --accent-ink: #ffffff; --accent-text: #7ea4ff;
  --accent-soft: rgba(47,109,255,.16); --accent-line: rgba(47,109,255,.5);
  --glow-1: #2f6dff; --glow-2: #8b3dff; --glyph-1: #2fe0ff; --glyph-2: #9b45ff;
  --amb-op: .2;
  --ok: #34d399; --warn: #fbbf4d; --danger: #ff6b78;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  scroll-padding-top: 76px;
}
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pular {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--r-s); font-weight: 600;
  transition: top .2s var(--ease);
}
.pular:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-s { width: 16px; height: 16px; }
.ic-l { width: 24px; height: 24px; }
.glifo { width: 22px; height: 12px; flex: none; }
.marca-future { width: 22px; height: 16px; flex: none; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; }

/* ---------- Botões ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 10px;
  font-weight: 600; font-size: 15px; line-height: 1.2;
  white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease), opacity .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: not-allowed; opacity: .55; }
.btn[disabled]:active { transform: none; }

/* O chanfro: canto inferior direito cortado, a assinatura da Future, sempre na cor da casa. */
.btn-acc { isolation: isolate; color: var(--accent-ink); background: transparent; border-radius: 0; }
.btn-acc::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent);
  border-radius: 9px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  transition: background-color .2s var(--ease);
}
.btn-acc:hover::before { background: var(--accent-hover); }
.btn-acc[disabled] { opacity: 1; color: var(--text-3); }
.btn-acc[disabled]::before { background: var(--bg-3); }

.btn-linha { border: 1px solid var(--line-2); background: transparent; }
.btn-linha:hover { border-color: var(--text-3); background: var(--accent-soft); }
.btn-suave { background: var(--bg-3); }
.btn-suave:hover { background: var(--accent-soft); }
.btn-txt { min-height: 40px; padding: 0 8px; color: var(--accent-text); }
.btn-txt:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-p { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-bloco { width: 100%; }

.btn-ico {
  width: 44px; height: 44px; padding: 0; border-radius: 12px;
  display: inline-grid; place-items: center;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.btn-ico:hover { background: var(--accent-soft); }
.btn-ico:active { transform: scale(.96); }

/* ---------- Formulários ---------- */
.campo { display: grid; gap: 6px; min-width: 0; }
.campo > span, .rotulo { font-size: 13px; font-weight: 600; color: var(--text-2); }
.campo small, .dica { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.entrada, .campo input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.campo select, .campo textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--text); font-size: 16px; line-height: 1.35;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.campo textarea { min-height: 84px; resize: vertical; }
.campo select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.entrada:focus, .campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.campo input::placeholder, .campo textarea::placeholder, .entrada::placeholder { color: var(--text-3); opacity: 1; }
.campo.erro input, .campo.erro select, .campo.erro textarea { border-color: var(--danger); }
.msg-erro { color: var(--danger); font-size: 13px; font-weight: 500; }

/* Controle segmentado (rádios como botões). */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { position: relative; flex: 1 1 0; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg-3);
  font-weight: 600; font-size: 14px; text-align: center; color: var(--text-2);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* Interruptor. */
.chave { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.chave input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chave i {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 99px;
  background: var(--line-2); transition: background-color .2s var(--ease);
}
.chave i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .22s var(--ease);
}
.chave input:checked + i { background: var(--accent); }
.chave input:checked + i::after { transform: translateX(18px); }
.chave input:focus-visible + i { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* Contador de quantidade. */
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-3); }
.qtd button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--accent-text); transition: background-color .2s var(--ease); }
.qtd button:hover { background: var(--accent-soft); }
.qtd button[disabled] { color: var(--text-3); cursor: not-allowed; background: none; }
.qtd output { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.qtd-p button { width: 34px; height: 34px; }
.qtd-p output { min-width: 22px; font-size: 14px; }

/* ---------- Aviso rápido ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90;
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: min(440px, calc(100vw - 32px));
  padding: 10px 10px 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  font-weight: 500; font-size: 14px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .22s var(--ease), transform .3s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .ic { color: var(--ok); }
.toast button { margin-left: auto; padding: 8px 12px; border-radius: 8px; font-weight: 600; color: var(--bg); background: color-mix(in srgb, var(--bg) 14%, transparent); }
.toast button:hover { background: color-mix(in srgb, var(--bg) 22%, transparent); }

/* ---------- Toque: alvos de 44 px ---------- */
@media (pointer: coarse) {
  .btn-txt { min-height: 44px; }
}

/* ---------- Movimento reduzido: tudo no estado final, nada animando ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
}

/* Aba escondida: pausa tudo. */
body.pausado *, body.pausado *::before, body.pausado *::after { animation-play-state: paused !important; }
