:root {
  --bg: #f3f0ea;
  --surface: #ffffff;
  --ink: #16130f;
  --muted: #5f5850;
  --line: #e3ddd3;

  --ok: #0b6b3a;
  --ok-deep: #074d29;
  --ok-soft: #e3f3e8;
  --bad: #b3261e;
  --bad-deep: #861b15;
  --warn: #9a5b00;
  --warn-deep: #6f4100;

  --radius: 22px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

p, h1 { margin: 0; }

.shell {
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Marca ---------- */

.brand {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 4px;
}
.brand__store {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  margin-right: -0.22em;
}
.brand__sep { color: var(--muted); font-size: 1rem; }
.brand__partner {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--muted);
}

main { display: flex; flex-direction: column; gap: 12px; flex: 1; }

/* ---------- Loading ---------- */

.loading {
  flex: 1;
  min-height: 60dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid var(--line);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
.loading__text { font-size: 1.15rem; font-weight: 700; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Faixa de status ---------- */

.hero {
  border-radius: var(--radius);
  padding: 26px 20px 24px;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: pop 0.28s ease-out;
}
.hero--ok { background: linear-gradient(160deg, var(--ok), var(--ok-deep)); }
.hero--bad { background: linear-gradient(160deg, var(--bad), var(--bad-deep)); }
.hero--warn { background: linear-gradient(160deg, var(--warn), var(--warn-deep)); }

.hero__icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 3px solid rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.hero__icon svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero__word {
  font-size: clamp(2.1rem, 11vw, 2.9rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.05;
}
.hero__title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.95;
}

@keyframes pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Cartão de dados ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card--plain { text-align: center; gap: 14px; padding: 24px 20px; }

.field { display: flex; flex-direction: column; gap: 2px; }
.field__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__value { font-size: 1.1rem; font-weight: 700; }
.field__name {
  font-size: clamp(1.5rem, 7.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.discount {
  background: var(--ok-soft);
  border: 2px solid var(--ok);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  color: var(--ok-deep);
}
.discount__kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.discount__pct {
  font-size: clamp(3.6rem, 22vw, 4.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}
.discount__label {
  font-size: 1.25rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.discount__store { font-size: 0.95rem; font-weight: 600; margin-top: 2px; }

.card__note { font-size: 0.9rem; color: var(--muted); text-align: center; }
.card__message { font-size: 1.1rem; font-weight: 600; }
.card__hint { font-size: 0.85rem; color: var(--muted); }

.button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 16px 20px;
  min-height: 52px;
  cursor: pointer;
}
.button:active { transform: translateY(1px); }
.button:focus-visible { outline: 3px solid var(--warn); outline-offset: 3px; }

/* ---------- Rodapé ---------- */

.meta { text-align: center; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.foot { text-align: center; font-size: 0.75rem; color: var(--muted); }
.noscript { text-align: center; padding: 16px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .hero { animation: none; }
  .spinner { animation-duration: 2s; }
}
