/* AppPedido — design system base */
:root {
  --brand: #E4472E;
  --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, white);
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #F2F1ED;
  --line: #E7E5E0;
  --ink: #1F1A17;
  --ink-2: #57534E;
  --ink-3: #8A857E;
  --ok: #15803D;
  --ok-soft: #DCFCE7;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --info: #2563EB;
  --info-soft: #DBEAFE;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(26, 24, 20, .06), 0 1px 3px rgba(26, 24, 20, .04);
  --shadow: 0 8px 24px -8px rgba(26, 24, 20, .14), 0 2px 6px rgba(26, 24, 20, .05);
  --shadow-lg: 0 24px 60px -12px rgba(26, 24, 20, .28);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14.5px; text-decoration: none; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 54px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-2);
  display: inline-grid; place-items: center; color: var(--ink); flex: none;
}
.icon-btn:hover { background: var(--line); }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.hint { font-size: 12.5px; color: var(--ink-3); }

/* Utilidades */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.strong { font-weight: 700; }
.small { font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Toast */
.toasts { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 14px; animation: toastIn .25s var(--ease);
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* Switch */
.switch { position: relative; display: inline-block; vertical-align: middle; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .2s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
