/* Nina Memories — paleta tirada da logo: creme, marrom café e verde oliva */
:root {
  --bg: #F4ECE1;
  --paper: #FBF7F1;
  --ink: #3E2A1E;
  --brown: #8A5A3B;
  --brown-d: #6E4429;
  --brown-l: #EADCCB;
  --olive: #6F745A;
  --olive-l: #E6E6D8;
  --line: #E4D5C2;
  --muted: #8C7A6B;
  --danger: #A8432F;
  --surface: #fff;          /* campos e "papel" das fotos */
  --ink-soft: #5b463a;
  --on-brand: #fff;         /* texto sobre o marrom */
  --on-olive: #fff;
  --olive-ink: #4b4f3a;
  --hi: #E9E2CF;            /* coluna de pedidos novos */
  --mini-border: #d5bfa5;
  --topbar: rgba(244, 236, 225, .92);
  --bar: rgba(251, 247, 241, .96);
  --scrim: rgba(42, 28, 18, .55);
  /* cores dos gráficos, validadas para daltonismo e contraste (dataviz) */
  --chart-sales: #8A4316;
  --chart-exp: #7A9424;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(62, 42, 30, .06), 0 8px 24px rgba(62, 42, 30, .07);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Parisienne', cursive;
  --sans: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Tema escuro (só o painel liga, em Configurações → Aparência): café torrado, creme e caramelo */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A130E;
  --paper: #2B2019;
  --surface: #352820;
  --ink: #F2E7DA;
  --ink-soft: #DCCAB7;
  --brown: #D4A276;
  --brown-d: #E9C59F;
  --brown-l: #241A13;
  --olive: #AEB38D;
  --olive-l: #2D2F22;
  --line: #45352A;
  --muted: #AE9A88;
  --danger: #E8907A;
  --on-brand: #1A130E;
  --on-olive: #1A130E;
  --olive-ink: #D3D7B9;
  --hi: #2A2818;
  --mini-border: #5A4636;
  --topbar: rgba(26, 19, 14, .9);
  --bar: rgba(43, 32, 25, .96);
  --scrim: rgba(0, 0, 0, .6);
  --chart-sales: #A65A22;
  --chart-exp: #859E31;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* números "normais" (a Cormorant usa números antigos, que deixam NM0001 parecido com NMooo1);
   !important porque o atalho `font:` dos botões e campos zera esta propriedade */
* { font-variant-numeric: lining-nums !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: .2em 0 .35em; color: var(--brown-d); }
h1 { font-size: clamp(30px, 7vw, 40px); }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
p { margin: .4em 0 .8em; }
a { color: var(--brown); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.pad { padding: 40px 16px; }
.script { font-family: var(--script); color: var(--brown); font-size: 24px; margin: 0; }
.script.big { font-size: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--olive); font-weight: 700; margin: 0; }

.container { max-width: 760px; margin: 0 auto; padding: 16px 16px 32px; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--topbar); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brown-d); }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.brand span { font-family: var(--serif); font-size: 22px; letter-spacing: .04em; }
.brand i { font-family: var(--script); font-style: normal; color: var(--brown); font-size: 20px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--brown); background: transparent;
  color: var(--brown); font: 700 18px var(--serif); cursor: pointer;
}

.stepper { display: flex; justify-content: center; gap: 6px; padding: 12px 16px 0; max-width: 760px; margin: 0 auto; }
.step { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex: 1; justify-content: center; }
.step span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--line); font-weight: 700; font-size: 12px; background: var(--paper);
}
.step.current { color: var(--brown-d); font-weight: 700; }
.step.current span { background: var(--brown); border-color: var(--brown); color: var(--on-brand); }
.step.done span { background: var(--olive); border-color: var(--olive); color: var(--on-olive); }
@media (max-width: 480px) { .step:not(.current) { font-size: 0; flex: none; } .step.current { flex: 1; } }

/* ---------- componentes ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--brown);
  background: var(--brown); color: var(--on-brand); font: 700 16px var(--sans); cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--brown-d); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--brown); }
.btn.ghost:hover { background: var(--brown-l); }
/* botões que abrem o WhatsApp: verde da marca, para o cliente reconhecer na hora */
.btn.wa { background: #25D366; border-color: #25D366; color: #fff; }
.btn.wa:hover { background: #1EBE5A; border-color: #1EBE5A; }
.btn.ghost.danger { border-color: var(--danger); color: var(--danger); }
.btn.link { background: none; border: none; color: var(--brown); padding: 0 6px; min-height: 36px; text-decoration: underline; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.btn svg .f { fill: currentColor; stroke: none; }

/* "Voltar / Continuar": vem logo abaixo do conteúdo e só gruda no rodapé quando a página é maior que a tela */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5;
  margin: 20px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  /* mesma cor do fundo: abaixo do conteúdo some na página; grudada no rodapé, cobre o que rola por trás */
  background: color-mix(in srgb, var(--bg) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}

.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--brown-l); border-top-color: var(--brown); animation: spin .8s linear infinite; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; margin: 0; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { background: var(--olive-l); color: var(--olive-ink); border-radius: 12px; padding: 10px 14px; font-size: 14px; }

.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); animation: up .2s ease-out; }
.toast.error { background: var(--danger); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

.modal-wrap { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 20px; padding: 20px; width: min(100%, 460px); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(100%, 860px); }
.crop-canvas { width: 100%; aspect-ratio: 1; border-radius: 6px; background: var(--brown-l); cursor: grab; display: block; margin: 8px 0; }
.crop-canvas:active { cursor: grabbing; }
.zoom-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; color: var(--brown); font-weight: 700; font-size: 20px; }
.zoom-row input { flex: 1; accent-color: var(--brown); }

/* ---------- tutorial ---------- */
.intro { text-align: center; padding-top: 8px; }
.hero-logo { width: min(220px, 56vw); border-radius: 50%; margin: 0 auto 6px; box-shadow: var(--shadow); }
.slide { margin: 18px 0; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; user-select: none; }
.slide p:not(.eyebrow) { max-width: 420px; color: var(--ink-soft); }
.slide-icon { width: 84px; height: 84px; border-radius: 50%; background: var(--olive-l); display: grid; place-items: center; margin-bottom: 10px; }
.slide-icon svg { width: 46px; height: 46px; fill: none; stroke: var(--brown); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.slide-icon svg .f { fill: var(--brown); stroke: none; }
.slide-icon.sm { width: 48px; height: 48px; flex: none; margin: 0; }
.slide-icon.sm svg { width: 28px; height: 28px; }
.dots { display: flex; gap: 8px; margin-top: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: none; background: var(--line); padding: 0; cursor: pointer; }
.dot.on { background: var(--brown); width: 26px; border-radius: 6px; }
.how { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 14px; }
.how li { display: flex; gap: 12px; align-items: flex-start; }
.how p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- pacotes ---------- */
.packages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
@media (max-width: 600px) { .packages { grid-template-columns: 1fr; } }
.package {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; font: inherit; color: inherit; text-align: center; transition: border-color .15s, transform .15s;
}
.package:hover { transform: translateY(-2px); }
.package.selected { border: 2px solid var(--brown); background: var(--surface); }
.package.selected::after { content: '✓'; position: absolute; top: 10px; right: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--brown); color: var(--on-brand); font-size: 14px; display: grid; place-items: center; }
.badge { position: absolute; top: -11px; background: var(--olive); color: var(--on-olive); font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.pkg-name { font-family: var(--serif); font-size: 26px; color: var(--brown-d); font-weight: 600; }
.pkg-qtd { color: var(--muted); }
.pkg-qtd b { font-size: 22px; color: var(--ink); }
.pkg-mini { display: grid; grid-template-columns: repeat(6, 12px); gap: 4px; justify-content: center; margin: 4px 0; }
.pkg-mini i { width: 12px; height: 12px; border-radius: 2px; background: var(--brown-l); border: 1px solid var(--mini-border); }
.pkg-price { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--brown); }
.pkg-save { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--olive); background: var(--olive-l); padding: 3px 12px; border-radius: 999px; }
.pkg-save.soft { color: var(--muted); background: transparent; }

/* ---------- fotos ---------- */
.progress { padding: 14px 18px; margin: 14px 0; }
.bar { height: 8px; border-radius: 99px; background: var(--brown-l); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--olive), var(--brown)); border-radius: 99px; transition: width .3s; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.btn.big { min-height: 84px; border-radius: var(--radius); flex-direction: column; gap: 4px; font-size: 15px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 12px; }
.photo { position: relative; background: var(--surface); padding: 8px 8px 6px; border-radius: 6px; box-shadow: var(--shadow); }
.photo-img { padding: 0; border: none; background: none; cursor: pointer; display: block; width: 100%; }
.photo-img img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.photo.empty { display: grid; place-items: center; aspect-ratio: 1; background: transparent; border: 2px dashed var(--line); box-shadow: none; color: var(--line); font-family: var(--serif); font-size: 22px; }
.remove { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--ink); color: var(--paper); font-size: 18px; line-height: 1; cursor: pointer; }
.warn { position: absolute; left: 12px; top: 12px; background: rgba(168, 67, 47, .92); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.qty { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--brown); background: none; color: var(--brown); font-size: 18px; cursor: pointer; }
.qty button:disabled { opacity: .3; }
.qty span { font-weight: 700; }

/* quantos pacotes iguais no pedido */
.pkg-count { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; margin-bottom: 18px; scroll-margin-bottom: 96px; }
.pkg-count p { margin: 2px 0 0; }
.qty.big { gap: 14px; margin: 0; }
.qty.big button { width: 44px; height: 44px; font-size: 22px; }
.qty.big span { font-family: var(--serif); font-size: 30px; min-width: 28px; text-align: center; }
.pkg-count-total { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.pkg-count-total b { font-family: var(--serif); font-size: 26px; color: var(--brown); }
.more-pkg { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- formulário ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.form .wide { grid-column: 1 / -1; }
.form h3 { margin-top: 10px; }
@media (max-width: 520px) { .form { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: 16px var(--sans); color: var(--ink); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(138, 90, 59, .15); }
.field .err { color: var(--danger); min-height: 18px; font-weight: 600; font-size: 12px; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }

/* ---------- pagamento ---------- */
.summary { margin: 14px 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; align-items: center; }
.thumbs img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; }
.thumbs small { font-weight: 700; color: var(--muted); margin-left: -2px; }
.total { border-top: 1px solid var(--line); padding-top: 10px; font-size: 18px; }
.total b { font-family: var(--serif); font-size: 28px; color: var(--brown); }
.tabs { display: flex; background: var(--brown-l); border-radius: 999px; padding: 4px; margin: 16px 0 12px; }
.tab { flex: 1; border: none; background: none; border-radius: 999px; min-height: 42px; font: 700 15px var(--sans); color: var(--brown-d); cursor: pointer; }
.tab.on { background: var(--paper); box-shadow: var(--shadow); }
.pay-box { margin-bottom: 16px; }
.pix { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pix-qr { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.pix-qr.demo { display: grid; place-items: center; color: var(--muted); font-family: var(--serif); font-size: 20px; }
.copy-row { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.copy-row input { flex: 1; min-width: 0; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; font: 13px monospace; color: var(--muted); background: var(--surface); }
.waiting { color: var(--olive); font-weight: 700; }

.success { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.check { width: 72px; height: 72px; border-radius: 50%; background: var(--olive); color: var(--on-olive); font-size: 36px; display: grid; place-items: center; }
.success .btn { width: min(100%, 320px); }

/* entrega: retirar em mãos × enviar para o endereço */
.delivery { border: 0; padding: 0; margin: 6px 0 4px; min-width: 0; }
.delivery legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.delivery p { margin: 8px 0 0; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--brown-l); border-radius: 999px; padding: 4px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 6px 12px; border-radius: 999px; font: 700 15px/1.2 var(--sans); color: var(--brown-d); transition: background .15s, box-shadow .15s; }
.choice input:checked + span { background: var(--brown); color: var(--on-brand); box-shadow: var(--shadow); }
.choice input:focus-visible + span { outline: 3px solid var(--olive); outline-offset: 2px; }
.addr-fields { display: contents; }
