/* Theme tokens. --brand / --brand-2 / --on-brand are overridden per campaign
   by applyBranding() in app.js. Defaults are the Vaultbook palette:
   purple #9f1bb8 and pink #f6188f, Montserrat headings, Open Sans body. */
:root {
  --brand: #9f1bb8;
  --brand-2: #f6188f;
  --on-brand: #ffffff;
  --accent: #171717;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #262626;
  --heading: #171717;
  --muted: #737373;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --error: #dc2626;
  --success: #1ebe57;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --font: "Open Sans", Helvetica, Arial, sans-serif;
  --font-heading: Montserrat, Helvetica, Arial, sans-serif;
  --gradient: linear-gradient(90deg, var(--brand-2) 20%, var(--brand));
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Gradient hero band, the card overlaps its bottom edge */
.top {
  width: 100%;
  background: var(--brand);
  background-image: var(--gradient);
  color: var(--on-brand);
  padding: 26px 20px 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.brand-logo { height: 56px; width: auto; }
.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  margin: -40px 16px 24px;
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.screen { display: none; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
  color: var(--heading);
  margin: 0 0 10px;
}
.eyebrow {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  margin: 0 0 8px;
}
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin-top: 20px; }
.error { color: var(--error); font-size: 14px; min-height: 18px; margin: 4px 0; }

.form label { display: block; font-weight: 600; margin: 14px 0 6px; }
.form input[type=text] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
.form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }

/* Primary action: Vaultbook-style uppercase heading font, purple -> pink on hover */
.btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  cursor: pointer;
  transition: background-color .15s ease, filter .15s ease;
}
.btn:hover:not(:disabled) { background: var(--brand-2); filter: brightness(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.link {
  background: none;
  border: 0;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  margin-top: 14px;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}
.link:hover { color: var(--brand-2); }

.small { font-size: 13px; }

/* Running total while choosing */
.tally {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  padding: 12px 0 10px;
  margin: 10px 0 6px;
  border-bottom: 1px solid var(--border);
}
.tally-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.tally-row strong { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--heading); }
.bar { height: 8px; background: var(--border); border-radius: 4px; margin: 8px 0 6px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--brand); background-image: var(--gradient); border-radius: 4px; transition: width .2s ease; }
.bar span.full { background: var(--success); }
.tally .small { margin: 0; min-height: 18px; }

/* Retailer cards with denomination steppers */
.products { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.product {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 14px 6px;
  background: #fff;
  transition: border-color .15s ease;
}
.product.has-picks { border-color: var(--brand); }
.product-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.product-head strong { font-family: var(--font-heading); font-size: 15px; font-weight: 700; color: var(--heading); }
.product-head small { color: var(--muted); font-size: 13px; text-align: right; }
.denoms { display: flex; flex-direction: column; }
.denom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.denom-value { font-weight: 600; font-size: 15px; }
.denom.picked .denom-value { color: var(--brand); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 36px; height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--brand);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s ease, background-color .15s ease;
}
.stepper button:hover:not(:disabled) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.stepper button:disabled { color: var(--border-strong); cursor: not-allowed; }
.stepper .qty { min-width: 28px; text-align: center; font-weight: 700; font-size: 16px; font-family: var(--font-heading); }

.summary {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.summary div {
  display: flex; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.summary div:last-child { border-bottom: 0; }
.summary .total { background: var(--bg); font-weight: 700; font-family: var(--font-heading); }

/* Final stage: one card per voucher */
.vouchers { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.voucher {
  padding: 14px 16px;
  border: 2px dashed var(--brand);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 3%, #fff);
}
.voucher-top { display: flex; justify-content: space-between; align-items: flex-end; }
.voucher-top strong { font-family: var(--font-heading); font-size: 15px; font-weight: 700; color: var(--heading); }
.voucher-value { font-family: var(--font-heading); font-weight: 800; font-size: 18px; color: var(--brand); }
.voucher code {
  display: block;
  font-size: 22px;
  letter-spacing: 2px;
  margin: 10px 0 2px;
  font-weight: 700;
  color: var(--heading);
  word-break: break-all;
}
.voucher .link { margin-top: 4px; }

/* Dark footer strip, like the Vaultbook site footer */
.powered {
  margin-top: auto;
  width: 100%;
  padding: 18px 20px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .02em;
  color: #a3a3a3;
  background: #171717;
}

.demo {
  position: fixed;
  right: 12px; bottom: 12px;
  background: #fff8e1;
  border: 1px solid #e6c46a;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  max-width: 240px;
  z-index: 5;
}
.demo summary { cursor: pointer; font-weight: 600; }
.demo-body { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.demo button {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #c9a94a;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 480px) {
  body { padding-bottom: 56px; } /* keep content clear of the fixed demo panel */
  .top { padding: 22px 16px 56px; }
  .brand-logo { height: 48px; }
  .card { margin: -36px 12px 20px; padding: 22px 18px; }
  .demo { left: 12px; right: 12px; max-width: none; }
  .demo-body { flex-direction: row; flex-wrap: wrap; }
  .demo .stock { width: 100%; }
}

.demo .stock { display: flex; flex-direction: column; gap: 2px; color: #6b6b6b; }
.demo .stock .row { display: flex; flex-wrap: wrap; gap: 0 6px; }
.demo .stock .out { color: #c0392b; font-weight: 600; }
