/* Clube MilaVeg: mesmo kit de marca do totem (cores, Shrikhand, Archivo Black, padrão e logos) */
@font-face { font-family: 'Shrikhand'; src: url('/brand/fontes/Shrikhand-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Archivo Black'; src: url('/brand/fontes/ArchivoBlack-Regular.ttf') format('truetype'); font-display: swap; }

:root {
  --mila-bread: #e09736;
  --mila-cheese: #fbbc1f;
  --mila-ketchup: #e52629;
  --mila-barbecue: #56231a;
  --mila-mayo: #f6e2c7;
  --mila-dark: #2b0e09;
  --vegan-green: #2ba946;

  --bg: var(--mila-mayo);
  --surface: #fff7ea;
  --ink: var(--mila-dark);
  --muted: #6e4435;
  --line: #e3c9a6;
  --danger: #b8171a;
  --shadow: 4px 4px 0 var(--mila-dark);

  --display: 'Shrikhand', Georgia, serif;
  --text: 'Archivo Narrow', 'Arial Narrow', Arial, sans-serif;
  --strong: 'Archivo Black', 'Arial Black', Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.4; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 18px; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px 22px; border-radius: 999px; border: 3px solid var(--mila-dark); font-family: var(--strong); font-size: 1rem; text-decoration: none; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translate(3px, 3px); box-shadow: none !important; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--mila-cheese); color: var(--mila-dark); box-shadow: var(--shadow); }
.btn-red { background: var(--mila-ketchup); color: #fff; box-shadow: var(--shadow); }
.btn-dark { background: var(--mila-barbecue); color: var(--mila-mayo); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; border-color: transparent; text-decoration: underline; font-family: var(--text); font-weight: 700; min-height: 44px; }
.btn-small { width: auto; min-height: 40px; padding: 6px 16px; font-size: .85rem; box-shadow: 3px 3px 0 var(--mila-dark); }

/* campos */
.lbl { display: grid; gap: 6px; font-weight: 700; color: var(--muted); font-size: .95rem; }
.field { width: 100%; min-height: 54px; padding: 10px 16px; border-radius: 14px; border: 3px solid var(--mila-dark); background: #fff; color: var(--ink); font-size: 1.15rem; font-weight: 700; outline: none; }
.field:focus { box-shadow: 0 0 0 4px rgba(251, 188, 31, .6); }
.pin { letter-spacing: .6em; text-align: center; font-family: var(--strong); font-size: 1.6rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--mila-barbecue); margin-top: 2px; }
.error { background: #fde3e3; color: var(--danger); border: 2px solid var(--danger); border-radius: 12px; padding: 10px 14px; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* tela de entrada */
.hero { position: relative; overflow: hidden; background: var(--mila-barbecue); color: var(--mila-mayo); padding: calc(28px + env(safe-area-inset-top)) 0 64px; text-align: center; }
.hero::before { content: ''; position: absolute; inset: 0; background: url('/brand/padrao-branco.png') center top / 520px auto; opacity: .08; }
.hero > * { position: relative; }
.hero img { width: 150px; height: auto; }
.hero h1 { font-family: var(--display); color: var(--mila-cheese); font-size: clamp(2.6rem, 11vw, 3.6rem); line-height: 1.05; margin-top: 8px; text-shadow: 3px 3px 0 var(--mila-dark); }
.hero p { margin: 10px auto 0; max-width: 340px; font-size: 1.1rem; }
.login-card { position: relative; margin-top: -40px; background: var(--surface); border: 3px solid var(--mila-dark); border-radius: 22px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; }
.login-card h2 { font-family: var(--strong); font-size: 1.25rem; }
.perks-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 30px; text-align: center; }
.perks-strip div { background: var(--surface); border: 3px solid var(--mila-dark); border-radius: 16px; padding: 12px 6px; font-size: .85rem; font-weight: 700; }
.perks-strip b { display: block; font-family: var(--display); font-size: 1.35rem; color: var(--mila-ketchup); font-weight: 400; }

/* cabeçalho logado */
.top { position: sticky; top: 0; z-index: 5; background: var(--mila-barbecue); color: var(--mila-mayo); padding: calc(10px + env(safe-area-inset-top)) 0 10px; border-bottom: 3px solid var(--mila-dark); }
.top .wrap { display: flex; align-items: center; gap: 12px; }
.top img { height: 38px; width: auto; }
.top .hi { flex: 1; font-family: var(--strong); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top button { font-weight: 700; text-decoration: underline; color: var(--mila-mayo); font-size: .9rem; }
.sub-noacc { margin: 0; padding: 10px 12px; border-radius: 12px; background: #e3f4e1; border: 2px solid #2f8a3a; color: #1d4d22; font-size: .95rem; line-height: 1.35; }
/* idioma: botões no topo da tela de entrada e menu compacto no cabeçalho do app */
.langs { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.langs button { font: 700 .85rem var(--strong); color: var(--mila-mayo); background: rgba(0,0,0,.18); border: 2px solid rgba(255,255,255,.25); border-radius: 999px; padding: 5px 11px; cursor: pointer; }
.langs button.on { background: var(--mila-cheese); color: var(--mila-dark); border-color: var(--mila-dark); }
.hero .langs img { display: none; }
.lang-select { font: 700 .85rem var(--strong); color: var(--mila-mayo); background: rgba(0,0,0,.2); border: 2px solid rgba(255,255,255,.3); border-radius: 999px; padding: 4px 6px; cursor: pointer; }
.lang-select option { color: #222; }
main { padding: 18px 0 calc(110px + env(safe-area-inset-bottom)); }
main .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.card > *, .sim > * { min-width: 0; }
.title { font-family: var(--display); font-size: clamp(1.7rem, 8.5vw, 2.1rem); line-height: 1.08; color: var(--mila-barbecue); overflow-wrap: anywhere; }
.title.red { color: var(--mila-ketchup); }

/* navegação de baixo */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 3px solid var(--mila-dark); padding-bottom: env(safe-area-inset-bottom); }
.tabs .wrap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 4px; }
.tabs button { display: grid; justify-items: center; gap: 2px; padding: 10px 0 8px; font-family: var(--strong); font-size: .72rem; color: var(--muted); }
.tabs button img { width: 30px; height: 30px; object-fit: contain; filter: grayscale(1) opacity(.55); }
.tabs button.on { color: var(--mila-dark); }
.tabs button.on img { filter: none; transform: scale(1.12); }

/* cartões */
.card { background: var(--surface); border: 3px solid var(--mila-dark); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; }
.card h3 { font-family: var(--strong); font-size: 1.1rem; }
.card.dark { background: var(--mila-barbecue); color: var(--mila-mayo); }
.card.cheese { background: var(--mila-cheese); }
.card.red { background: var(--mila-ketchup); color: #fff; }

.balance { position: relative; overflow: hidden; }
.balance::after { content: ''; position: absolute; inset: 0; background: url('/brand/padrao-branco.png') center / 420px auto; opacity: .07; pointer-events: none; }
.balance .label { font-weight: 700; opacity: .9; }
.balance .big { font-family: var(--display); font-size: clamp(2.8rem, 14vw, 3.8rem); line-height: 1; color: var(--mila-cheese); text-shadow: 3px 3px 0 var(--mila-dark); }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.chip { background: rgba(255, 247, 234, .12); border: 2px solid rgba(246, 226, 199, .35); border-radius: 14px; padding: 8px 10px; }
.chip small { display: block; font-size: .78rem; opacity: .85; font-weight: 700; }
.chip b { font-family: var(--strong); font-size: 1rem; }
.howto { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.howto img { width: 46px; flex: none; }

/* MilaVale */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.step { background: #fff; border: 3px solid var(--mila-dark); border-radius: 14px; text-align: center; padding: 8px 2px; min-width: 0; }
.step b { display: block; font-family: var(--display); font-size: clamp(1.05rem, 5vw, 1.5rem); color: var(--mila-ketchup); font-weight: 400; line-height: 1.1; }
.step small { font-weight: 700; color: var(--muted); }
.amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.amounts button { min-height: 50px; font-size: .85rem; padding: 0 2px; border: 3px solid var(--mila-dark); border-radius: 14px; background: #fff; font-family: var(--strong); }
.amounts button.on { background: var(--mila-cheese); box-shadow: 3px 3px 0 var(--mila-dark); }
.sim { background: #fff; border: 3px dashed var(--mila-dark); border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.sim .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sim .val { font-family: var(--display); font-size: clamp(1.8rem, 9vw, 2.4rem); color: var(--vegan-green); line-height: 1; text-shadow: 2px 2px 0 var(--mila-dark); }
input[type=range] { width: 100%; accent-color: var(--mila-ketchup); height: 32px; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .92rem; }
.vale { display: grid; gap: 8px; padding: 14px; border: 3px solid var(--mila-dark); border-radius: 18px; background: #fff; }
.vale .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vale .now { font-family: var(--strong); font-size: 1.3rem; color: var(--vegan-green); }
.bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; border: 2px solid var(--mila-dark); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mila-cheese), var(--mila-ketchup)); }
.tag { display: inline-block; font-family: var(--strong); font-size: .72rem; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--mila-dark); background: var(--mila-cheese); }
.tag.green { background: var(--vegan-green); color: #fff; }
.tag.gray { background: var(--line); }
.pix { text-align: center; }
.pix img { width: min(100%, 280px); border: 3px solid var(--mila-dark); border-radius: 16px; background: #fff; }
.code { font-family: monospace; font-size: .8rem; word-break: break-all; background: #fff; border: 2px dashed var(--mila-dark); border-radius: 12px; padding: 10px; max-height: 84px; overflow: auto; text-align: left; }

/* planos */
.plan { position: relative; overflow: visible; }
.plan .mascot { position: absolute; top: -14px; right: 4px; width: 104px; height: 104px; object-fit: contain; pointer-events: none; }
.plan .plan-head { display: grid; gap: 4px; padding-right: 100px; min-height: 84px; align-content: center; min-width: 0; }
.plan .plan-head .name { font-size: clamp(1.45rem, 7vw, 1.9rem); overflow-wrap: anywhere; }
.plan .plan-head .price { font-size: clamp(1.6rem, 8vw, 2.3rem); white-space: nowrap; }
.plan .ribbon { z-index: 2; }
.plan-mine { position: relative; padding-left: 92px; }
.mascot-sm { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 74px; height: 74px; object-fit: contain; }
.gift-from { background: #fff2c4; border: 2px dashed var(--mila-dark); border-radius: 12px; padding: 8px 10px; font-size: .92rem; }
.gift-sent { opacity: .75; }
.invite-banner { position: relative; margin-top: -40px; margin-bottom: 14px; background: var(--mila-cheese); border: 3px solid var(--mila-dark); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 1rem; }
.invite-banner + .login-card { margin-top: 0; }
.ladder { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ladder li { background: #fff; border: 2px solid var(--mila-dark); border-radius: 12px; padding: 8px 10px; display: grid; gap: 2px; font-size: .88rem; }
.ladder li b { font-family: var(--strong); font-size: .85rem; }
.ladder li.on { background: var(--vegan-green); color: #fff; }
.row-prog { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.code-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 2px dashed var(--mila-dark); border-radius: 12px; padding: 8px 12px; }
.ref-code { font-family: var(--strong); font-size: 1.3rem; letter-spacing: .12em; }
.stamps { display: grid; gap: 8px; }
.stamp { aspect-ratio: 1; display: grid; place-items: center; border: 3px dashed var(--line); border-radius: 50%; font-family: var(--strong); color: var(--line); background: #fff; }
.stamp.on { border: 3px solid var(--mila-dark); background: var(--mila-cheese); }
.stamp img { width: 70%; height: 70%; object-fit: contain; }
.voucher { background: #fff2c4; border-style: dashed; }
.voucher.urgent { background: var(--mila-ketchup); color: #fff; border-style: solid; }
.voucher.urgent .small { color: #fff; }
.stars { display: flex; gap: 6px; }
.stars button { font-size: 2.1rem; line-height: 1; color: var(--line); padding: 2px; text-shadow: 1px 1px 0 var(--mila-dark); }
.stars.big button { font-size: 2.8rem; }
.stars button.on { color: var(--mila-cheese); }
.stars-mini { color: var(--mila-bread); letter-spacing: .05em; }
.chips-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tagchip { border: 2px solid var(--mila-dark); border-radius: 999px; padding: 6px 14px; font-weight: 700; background: #fff; }
.tagchip.on { background: var(--mila-cheese); }
.review-done { background: #e9f8ec; }
textarea.field { min-height: 96px; resize: vertical; font-weight: 400; font-size: 1rem; }
.win-code { font-family: var(--strong); font-size: 2rem; letter-spacing: .25em; text-align: center; background: var(--mila-cheese); color: var(--mila-dark); border: 3px solid var(--mila-dark); border-radius: 14px; padding: 8px; }
.queue-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; counter-reset: q; }
.queue-list li { counter-increment: q; display: grid; justify-items: center; gap: 2px; text-align: center; font-size: .85rem; background: #fff; border: 2px solid var(--mila-dark); border-radius: 12px; padding: 6px 2px; position: relative; }
.queue-list li::before { content: counter(q) 'º'; position: absolute; top: -9px; left: -6px; background: var(--mila-ketchup); color: #fff; font-family: var(--strong); font-size: .72rem; border-radius: 999px; padding: 1px 6px; border: 2px solid var(--mila-dark); }
.queue-list img { width: 44px; height: 44px; object-fit: contain; }
.queue-list .q-none { font-size: 1.9rem; line-height: 44px; }
.plan .price { font-family: var(--display); font-size: 2.3rem; line-height: 1; color: var(--mila-ketchup); }
.plan .price small { font-family: var(--text); font-size: 1rem; color: var(--muted); font-weight: 700; }
.plan.dark .price { color: var(--mila-cheese); }
.plan.dark .price small { color: var(--mila-mayo); }
.plan .name { font-family: var(--display); font-size: 1.9rem; line-height: 1; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li::before { content: ''; width: 20px; height: 20px; flex: none; margin-top: 1px; background: url('/brand/icones/sim-branco.png') center / contain no-repeat, var(--vegan-green); border-radius: 50%; border: 2px solid var(--mila-dark); }
.plan .ribbon { position: absolute; top: -14px; right: 16px; }
.back { display: flex; justify-content: center; gap: 8px; text-align: center; }

/* histórico */
.hist { display: grid; gap: 10px; }
.hitem { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 3px solid var(--mila-dark); border-radius: 16px; padding: 10px 12px; }
.hitem img { width: 44px; height: 44px; object-fit: contain; }
.hitem b { font-family: var(--strong); font-size: .95rem; }
.hitem small { display: block; color: var(--muted); }
.hitem .amt { text-align: right; font-family: var(--strong); }
.hitem .amt small { font-family: var(--text); font-weight: 700; color: var(--vegan-green); }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; background: var(--mila-dark); color: var(--mila-mayo); padding: 12px 20px; border-radius: 999px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--mila-ketchup); animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
