/* Pizza Lover Club pages (/pizza-lover-club/ and /klubkort/). Tokens follow DESIGN.md, as on /bestil/ and /book-et-bord/. */
:root {
  --cream: #fcf9f2;
  --cream-deep: #f1eee7;
  --line: #e0ddd5;
  --white: #ffffff;
  --green: #3d4e43;
  --green-deep: #2d3b2f;
  --gold: #c7af69;
  --gold-rich: #725b27;
  --text: #333333;
  --muted: #5d625d;
  --error: #ba1a1a;
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-rich); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.noscript { padding: 24px 16px; text-align: center; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--green);
}
.top-logo img { height: 36px; width: auto; }
.top-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  color: var(--white); border: 1px solid var(--gold); text-decoration: none;
  font-weight: 600; font-size: 14px;
}
.top-link:hover { background: var(--gold); color: var(--green-deep); }

/* ---------- Layout ---------- */
main { max-width: 640px; margin: 0 auto; padding: 0 16px calc(64px + var(--safe-bottom)); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow { margin: 28px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-rich); }
h1 { margin: 4px 0 8px; font-size: clamp(28px, 7vw, 40px); line-height: 1.1; letter-spacing: -0.02em; color: var(--green-deep); }
h2 { margin: 0 0 12px; font-size: 19px; color: var(--green-deep); }
.lede { margin: 0; font-size: 17px; color: var(--muted); }

.box { margin-top: 20px; padding: 20px 18px; background: var(--white); border-radius: 12px; }
.box > :last-child { margin-bottom: 0; }

/* ---------- How it works ---------- */
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; counter-increment: s; }
.steps li::before {
  content: counter(s); display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: var(--gold); font-size: 14px; font-weight: 700;
}
.steps b { display: block; color: var(--green-deep); }

/* ---------- Stamp grid ---------- */
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 4px 0 0; }
.stamp {
  display: grid; place-items: center; aspect-ratio: 1;
  border: 2px dashed var(--line); border-radius: 50%;
  color: var(--line); font-weight: 700; font-size: 15px;
}
.stamp.on { border: 0; background: var(--green); color: var(--gold); }
.stamp.on svg { width: 58%; height: 58%; }
.stamp.goal { border-color: var(--gold); color: var(--gold-rich); font-size: 20px; }
.count { margin: 12px 0 0; font-weight: 600; color: var(--green-deep); }

/* ---------- Card ---------- */
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head small { color: var(--muted); font-size: 13px; }
.reward {
  margin-top: 20px; padding: 18px; border-radius: 12px;
  background: var(--green); color: var(--white);
}
.reward b { display: block; font-size: 20px; color: var(--gold); }
.reward p { margin: 6px 0 0; }
.qr-box { display: grid; justify-items: center; gap: 8px; margin-top: 20px; padding: 22px 18px; background: var(--white); border-radius: 12px; text-align: center; }
.qr { width: min(280px, 76vw); background: #fff; }
.qr svg { width: 100%; height: auto; }
.code { font-size: 26px; font-weight: 700; letter-spacing: 0.18em; color: var(--green-deep); }
.qr-box p { margin: 0; color: var(--muted); font-size: 14px; }
.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.facts li { padding-left: 18px; position: relative; }
.facts li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* ---------- Form ---------- */
.field { display: grid; gap: 4px; }
.field span { font-size: 14px; font-weight: 600; color: var(--green-deep); }
.field input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
}
.field input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(61, 78, 67, 0.15); }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; }
.consent input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  min-height: 52px; margin-top: 18px; padding: 12px 20px;
  background: var(--green); color: var(--white); border: 0; border-radius: 0;
  font-weight: 700; font-size: 16px; letter-spacing: 0.01em; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--green-deep); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.secondary { background: transparent; color: var(--green-deep); border: 1px solid var(--green); }
.btn.gold { background: var(--gold); color: var(--green-deep); }
.btn.gold:hover:not(:disabled) { background: #b89d52; }
.btn.danger { background: var(--error); }
.btn.danger:hover:not(:disabled) { background: #961414; }
/* "Are you sure?" box, shown in the page instead of the browser's confirm(). */
.ask { margin-top: 16px; padding: 16px 14px; background: var(--cream-deep); border-left: 3px solid var(--error); }
.ask .ask-q { margin: 0; font-size: 17px; font-weight: 700; color: var(--green-deep); }
.ask .fine { margin-top: 4px; }
.ask .btn.danger { margin-top: 14px; }
.ask .btn.secondary { margin-top: 10px; background: var(--white); }
.fine { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.err { margin: 12px 0 0; color: var(--error); font-weight: 600; }
.err:empty { display: none; }
.ok { margin: 0; font-weight: 600; color: var(--green-deep); }
.link { background: none; border: 0; padding: 0; color: var(--gold-rich); text-decoration: underline; font-size: 15px; }

/* ---------- Settings + rules ---------- */
.switch { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.switch input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green); }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
details.box summary { cursor: pointer; font-weight: 700; color: var(--green-deep); }
details.box[open] summary { margin-bottom: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px;
  background: var(--green-deep); color: var(--white); border-radius: var(--radius); font-weight: 600;
  box-shadow: 0 12px 40px rgba(28, 28, 24, 0.2); z-index: 50;
}
.toast.error { background: var(--error); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
