/* Naturaki — estilos partilhados (app do cliente e página da loja)
   Cores tiradas do logótipo: verde folha e laranja terra. */
:root {
  --bg: #f4f6f1; --surface: #ffffff; --fg: #1a2418; --muted: #5f6b5c; --line: #dde3d8;
  --green: #0e5807; --green-2: #1f7a14; --green-soft: #e6f0e2;
  --orange: #c85103; --orange-soft: #fbeadd; --on-green: #f3f8ef;
  --good: #1f7a14; --bad: #b3361a; --warn: #9a5b00;
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10150f; --surface: #192118; --fg: #e9efe5; --muted: #9eab99; --line: #2b3629;
    --green: #2f8a22; --green-2: #3fa52f; --green-soft: #1f2d1c;
    --orange: #e3742a; --orange-soft: #33231a; --on-green: #f3f8ef;
    --good: #6cc75a; --bad: #ef7a5e; --warn: #e0a64a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--green-2); }

.wrap { max-width: 460px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* Botões */
.btn { appearance: none; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 600; font-size: 15px; cursor: pointer;
  background: var(--green); color: var(--on-green); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn:hover { filter: brightness(1.07); }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, .card:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn.orange { background: var(--orange); color: #fff; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { white-space: nowrap; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.linkbtn { background: none; border: 0; padding: 4px; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--green); }
.error { color: var(--bad); font-size: 14px; font-weight: 500; }

/* Cartão */
.card { position: relative; border-radius: 22px; color: var(--on-green); padding: 18px 20px; overflow: hidden; cursor: pointer;
  background: radial-gradient(120% 90% at 100% 0%, #2a8a1c 0%, transparent 60%), linear-gradient(155deg, #0e5807 0%, #0a4205 100%);
  aspect-ratio: 1.586; max-width: 100%; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 18px 34px -20px rgba(8, 50, 4, .8); }
.card > * { position: relative; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-logo { width: 84px; height: 84px; border-radius: 50%; background: #fff; flex: none; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.card-logo img { width: 118%; height: 118%; margin: -9%; display: block; max-width: none; }
.card-kind { text-align: right; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; line-height: 1.4; }
.card-kind b { display: block; font-family: var(--f-display); text-transform: none; letter-spacing: 0; font-size: 17px; opacity: 1; }
.card-pts .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.card-pts .val { font-family: var(--f-display); font-size: 42px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.card-pts .val small { font-family: var(--f-body); font-size: 15px; font-weight: 500; opacity: .8; margin-left: 4px; }
.card-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.card-num { font-family: var(--f-mono); font-size: 14px; letter-spacing: .1em; }
.card-name { font-size: 13px; opacity: .9; }
.card-tap { font-size: 11px; opacity: .8; background: rgba(255,255,255,.14); padding: 5px 9px; border-radius: 99px; white-space: nowrap; }

/* Listas */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .txt { flex: 1; min-width: 0; }
.item .txt b { display: block; font-weight: 600; }
.item .txt small { color: var(--muted); font-size: 13px; display: block; }
.item .ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--green-soft); color: var(--green-2); }
.item .ic.minus { background: var(--orange-soft); color: var(--orange); }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.plus { color: var(--good); } .amt.minus { color: var(--orange); }
.voided { opacity: .5; text-decoration: line-through; }
.empty { padding: 18px 16px; color: var(--muted); font-size: 14px; text-align: center; }

.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }

.promo { background: var(--orange-soft); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.promo .tag { background: var(--orange); color: #fff; font-weight: 700; font-size: 13px; border-radius: 10px; padding: 6px 9px; white-space: nowrap; }
.promo b { display: block; }
.promo small { color: var(--muted); font-size: 13px; }

/* Folha inferior (código, confirmações) */
.sheet-bg { position: fixed; inset: 0; background: rgba(6, 20, 4, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 40; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0;
  padding: 22px max(20px, env(safe-area-inset-left, 0px)) calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px; }
.sheet.centered { align-items: center; text-align: center; }
.code-box { background: #fff; border-radius: 16px; line-height: 0; max-width: 100%; }
.code-box img { width: min(270px, 74vw); height: auto; image-rendering: pixelated; display: block; }
.code-box svg { width: min(320px, 82vw); height: auto; display: block; }
.seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--green); color: var(--on-green); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.kbd { display: inline-block; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 0 6px; font-size: 13px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 99px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--green); animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
