/*
  PromoPlug look: "spaza signage". Bold painted-sign colours on a cool lavender ground,
  chunky sticker buttons with a hard ink shadow, and one signature detail: a WhatsApp-Status-style
  colour ring around a business logo while its special is new to you.
  System fonts only (CSP is font-src 'self' and followers are on prepaid data).
*/
:root {
  --ink: #1E1442;        /* indigo night: text, header, button shadow */
  --bg: #F3F1FB;         /* lavender mist */
  --card: #FFFFFF;
  --line: #E4DFF5;
  --text: var(--ink);
  --muted: #5E5680;
  --brand: #FF5B1F;      /* plug orange: follow and primary actions (ink text on it) */
  --brand-dark: #C2410C; /* orange that's readable as text on white */
  --sun: #FFC531;        /* mielie yellow: flyer buttons, focus */
  --pink: #FF3C8E;       /* status pink: ring partner */
  --link: #5A2FD0;
  --tint: #ECE8FA;       /* chips and soft fills */
  --top: #1E1442;
  --on-top: #FFFFFF;
  --shadow: #1E1442;
  --danger: #C62828;
  --radius: 20px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120A2B;
    --card: #1E1540;
    --line: #342A5E;
    --text: #EEEAFB;
    --muted: #A9A1C8;
    --brand-dark: #FF8A57;
    --link: #B9A3FF;
    --tint: #2A2052;
    --top: #0B0620;
    --shadow: #000000;
    --danger: #FF6B6B;
  }
}

* { box-sizing: border-box; }
/* Classes like .btn set display, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

main { max-width: 640px; margin: 0 auto; padding: 20px 16px; }
h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; margin: .2em 0 .5em; }
h2 { font-size: 1.2rem; line-height: 1.25; font-weight: 750; letter-spacing: -.01em; margin: 1.4em 0 .5em; }
a { color: var(--link); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }

/* ---- Header: the painted sign above the shop ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--top); color: var(--on-top);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; color: var(--on-top); text-decoration: none; }
.brand img { border-radius: 8px; }
.brand .muted { color: rgb(255 255 255 / .7); font-weight: 500; }
.top nav { display: flex; gap: 16px; font-size: .95rem; font-weight: 600; }
.top nav a { color: rgb(255 255 255 / .85); text-decoration: none; }
.top nav a:hover { color: var(--sun); }

.foot { text-align: center; padding: 28px 16px 44px; color: var(--muted); font-size: .9rem; }
.foot a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.warn { color: var(--danger); }
.tag { margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--brand); color: var(--ink); font-size: .75rem; font-weight: 700; vertical-align: middle; }

/* ---- Buttons: stickers with a hard ink shadow; pressing pushes them down ---- */
.btn {
  display: inline-block; border: 0; border-radius: 99px; padding: 11px 20px;
  background: var(--brand); color: #1E1442; font: inherit; font-weight: 750;
  text-decoration: none; cursor: pointer; text-align: center;
  box-shadow: 0 3px 0 var(--shadow);
}
.btn:hover { background: #FF7440; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-big { width: 100%; padding: 15px 20px; font-size: 1.15rem; }
.btn-small { padding: 6px 14px; font-size: .875rem; box-shadow: 0 2px 0 var(--shadow); }
.btn-outline { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 2px currentColor; }
.btn-outline:hover { background: var(--tint); }
.btn-outline:active { transform: none; box-shadow: inset 0 0 0 2px currentColor; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A61E1E; }
.btn-cta { padding: 9px 18px; background: var(--sun); }
.btn-cta:hover { background: #FFD45E; }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }

/* ---- Status ring: a business with a special you haven't read yet ---- */
.ring {
  padding: 2px; border: 3px solid transparent; border-radius: 14px;
  background: linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from 200deg, var(--brand), var(--sun), var(--pink), var(--brand)) border-box;
}
.read-section .ring { background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(var(--line), var(--line)) border-box; }

.hero { padding: 28px 0 12px; }
.hero h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
.hero p { font-size: 1.1rem; max-width: 34em; }

.biz-head { display: flex; gap: 16px; align-items: center; margin: 4px 0 18px; }
.biz-head h1 { margin: 0; }
.biz-head p { margin: 4px 0 0; }
.logo { border-radius: 16px; flex: none; }
.logo.ring { border-radius: 20px; }

/* ---- Flyer card ---- */
.flyer { background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; margin: 0 0 18px; }
.flyer-biz { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--text); text-decoration: none; font-weight: 750; }
.flyer-biz img { border-radius: 10px; }
.flyer-img { display: block; width: 100%; height: auto; background: var(--tint); }
.caption { margin: 14px 14px 0; font-size: 1.05rem; font-weight: 500; }
.flyer-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; }
.flyer-meta .muted { background: var(--tint); padding: 4px 12px; border-radius: 99px; font-size: .85rem; font-weight: 650; }

.follow-box { margin: 18px 0; text-align: center; }
.follow-box .btn { width: 100%; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }

.biz-list, .device-list { list-style: none; margin: 0; padding: 0; }
.biz-list li, .device-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.biz-row { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.biz-row img { border-radius: 12px; flex: none; }
.biz-row > span { display: flex; flex-direction: column; min-width: 0; }
.device-list li { flex-wrap: wrap; }
.device-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; }

.code-box { text-align: center; }
.qr { width: 220px; max-width: 100%; margin: 8px auto; background: #fff; padding: 8px; border-radius: 14px; }
.qr svg { display: block; width: 100%; height: auto; }
.code { font: 800 2.2rem/1 ui-monospace, Consolas, monospace; letter-spacing: .15em; margin: 10px 0; }
.row { display: flex; gap: 8px; }
.row input {
  flex: 1; min-width: 0; padding: 10px 12px; font: 600 1.1rem ui-monospace, Consolas, monospace;
  text-transform: uppercase; letter-spacing: .1em; border: 2px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text);
}

.sheet { border: 0; border-radius: 24px; padding: 22px; max-width: 420px; width: calc(100% - 32px); background: var(--card); color: var(--text); }
.sheet::backdrop { background: rgb(18 10 43 / .6); }
.install-hint { text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 4px 0 var(--sun); z-index: 10;
}

.empty, .expired { text-align: center; }
.prose ul { padding-left: 1.2em; }

@media (min-width: 900px) {
  main:has(.flyer-grid) { max-width: 1080px; }
  .flyer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
  .flyer-grid .flyer { margin: 0; }
}

.flyer-read { padding: 0 14px 14px; text-align: right; }
.flyer-read .btn-outline { color: var(--muted); }
.read-section { margin: 8px 0 24px; }
.read-section summary { cursor: pointer; font-weight: 750; padding: 10px 0 16px; color: var(--muted); }
.read-section .flyer { opacity: .85; }

.report { margin: 8px 0 24px; text-align: center; }
.report summary { cursor: pointer; }
.report form { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.report select, .report textarea { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); width: 100%; }

/* Business sign-in pages served by Razor Pages (/biz/auth, /biz/code) */
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 650; }
.form input { font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); }
.form input:focus { outline: none; border-color: var(--brand); }
