/* Neutral, mobile-first. The only brand token is --brand (set from brand/config.json). */
:root { --ink: #16181d; --muted: #5b6270; --line: #d7dbe2; --bg: #f3f4f6; --card: #fff; --err: #b42318; --radius: 14px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); }

.card { max-width: 460px; margin: 0 auto; padding: 0 20px max(28px, env(safe-area-inset-bottom)); min-height: 100svh; background: var(--card); overflow: hidden; }
@media (min-width: 520px) { body { padding: 40px 16px; } .card { min-height: 0; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 30px rgba(0,0,0,.08); padding: 0 32px 32px; } }

/* Logo band: the logo is artwork on black, so it sits on a matching full-width band. */
.hero { background: var(--hero); margin: 0 -20px; padding: max(18px, env(safe-area-inset-top)) 20px 18px; text-align: center; }
@media (min-width: 520px) { .hero { margin: 0 -32px; padding: 22px 32px; } }
.hero .logo-img { display: block; margin: 0 auto; height: 132px; width: auto; max-width: 80%; }
.center { text-align: center; }

.head { text-align: center; margin: 22px 0 24px; }
.logo-text { display: inline-block; font-weight: 800; letter-spacing: .02em; font-size: 22px; color: #fff; background: var(--brand); padding: 6px 14px; border-radius: 8px; }
.logo-img { max-height: 132px; max-width: 80%; }
h1 { font-size: 30px; line-height: 1.15; margin: 18px 0 6px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0; font-size: 17px; }

form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.label { font-weight: 600; font-size: 15px; }
input[type=text], input[type=email], input[type=tel] {
  width: 100%; font-size: 17px; /* >=16px stops iOS zooming on focus */ padding: 13px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); -webkit-appearance: none; appearance: none;
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.has-error input { border-color: var(--err); }
.error { color: var(--err); font-size: 14px; }
.banner { background: #fef3f2; color: var(--err); border-radius: 10px; padding: 10px 12px; margin: 0 0 16px; font-size: 15px; }

.consent { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; padding: 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; cursor: pointer; }
.consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); }
.optional { color: var(--muted); font-style: normal; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-block; width: 100%; border: 0; border-radius: 10px; padding: 15px 18px; font: inherit; font-size: 18px; font-weight: 700; color: #fff; background: var(--brand); cursor: pointer; text-decoration: none; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: default; }
.note { color: var(--muted); font-size: 13px; margin: 0; text-align: center; }

.tick { width: 76px; height: 76px; margin: 36px auto 4px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; }
.thanks-msg { font-size: 22px; line-height: 1.4; font-weight: 600; margin: 20px auto 8px; max-width: 26ch; text-wrap: balance; }
.tick svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* Tablet QR display */
.qr-body { background: var(--hero); color: #fff; padding: 0; }
.qr-screen { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6vmin; padding: 3vmin 4vmin; text-align: center; }
.qr-head { display: flex; flex-direction: column; align-items: center; gap: 1.2vmin; }
.qr-logo.logo-text { font-size: clamp(22px, 5vmin, 56px); padding: .25em .6em; border-radius: .35em; }
.qr-logo.logo-img { height: 17vmin; width: auto; max-width: 60vw; }
.qr-event { font-size: clamp(15px, 2.6vmin, 30px); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #cdbfb3; }
.qr-title { font-size: clamp(26px, 5.4vmin, 68px); margin: 0 0 1vmin; max-width: 18ch; }
.qr-box { width: min(52vmin, 86vw); aspect-ratio: 1; background: #fff; border-radius: 2.4vmin; padding: 1.6vmin; flex: none; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-hint { font-size: clamp(16px, 2.7vmin, 32px); color: #e8e1db; margin: 1vmin 0 0; max-width: 32ch; }
.qr-url { font-size: clamp(13px, 1.9vmin, 22px); color: #a89a8f; margin: 0; font-family: ui-monospace, Menlo, monospace; }
/* Wide screens without slides: copy on the left, QR on the right. */
@media screen and (min-aspect-ratio: 5/4) {
  .qr-screen:not(.with-slides) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr auto auto auto auto 1fr;
    grid-template-areas: "." "head" "title" "hint" "url" "."; column-gap: 6vw; row-gap: 2vh; align-items: center; justify-items: center; padding: 5vh 6vw; }
  .qr-screen:not(.with-slides) .qr-head { grid-area: head; }
  .qr-screen:not(.with-slides) .qr-logo.logo-img { height: 22vh; }
  .qr-screen:not(.with-slides) .qr-title { grid-area: title; font-size: clamp(26px, 5.2vh, 64px); }
  .qr-screen:not(.with-slides) .qr-hint { grid-area: hint; font-size: clamp(16px, 2.8vh, 30px); }
  .qr-screen:not(.with-slides) .qr-url { grid-area: url; }
  .qr-screen:not(.with-slides) .qr-box { grid-column: 2; grid-row: 1 / -1; width: min(84vh, 48vw); }
}

/* ── Product slideshow ── slides stack in one box and cross-fade; the QR is never overlapped. */
.slides { position: relative; }
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .9s ease-in-out; background: var(--hero); }
.slide.on { opacity: 1; z-index: 2; }
.slide.prev { opacity: 1; z-index: 1; transition: none; }   /* stays solid under the incoming slide: no dark dip */
.slide-img { background: #fff; border-radius: 2.4vmin; display: grid; place-items: center; overflow: hidden; padding: 2.5vmin; min-height: 0; }
.slide-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.slide-img.placeholder { background: radial-gradient(circle at 50% 42%, #2b2019 0%, #000 72%); border: 1px solid #2a211b; }
.slide-img .slide-logo.logo-img { height: 72%; width: auto; max-width: 90%; }
.slide figcaption strong { display: block; font-size: clamp(18px, 3.6vmin, 44px); line-height: 1.15; }
.slide figcaption span { display: block; font-size: clamp(14px, 2.3vmin, 26px); color: #e8e1db; margin-top: .4em; }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }

/* Portrait / narrow: one column — logo, title, QR (big), hint, a compact slide strip, URL. */
.with-slides .showcase, .with-slides .scan { display: contents; }
.with-slides .qr-head { order: 1; } .with-slides .qr-title { order: 2; } .with-slides .qr-box { order: 3; }
.with-slides .qr-hint { order: 4; } .with-slides .slides { order: 5; } .with-slides .qr-url { order: 6; }
.with-slides .qr-logo.logo-img { height: 9vmin; }
.with-slides { gap: 1vmin; }
.with-slides .qr-box { width: min(48vmin, 86vw); }
.with-slides .slides { width: min(88vw, 82vmin); height: 17vh; margin: .6vmin 0; }
.with-slides .slide { display: grid; grid-template-columns: 17vh 1fr; gap: 3vmin; align-items: center; text-align: left; }
.with-slides .slide-img { height: 17vh; }

/* Landscape tablet: slideshow on the left (with the logo), QR column on the right. */
@media screen and (min-aspect-ratio: 5/4) {
  .qr-screen.with-slides { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); column-gap: 4vw;
    align-items: stretch; padding: 4vh 4vw; height: 100svh; min-height: 0; }
  .with-slides .showcase { display: flex; flex-direction: column; gap: 2.4vh; min-width: 0; min-height: 0; }
  .with-slides .scan { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6vh; }
  .with-slides .qr-head { flex-direction: row; justify-content: center; gap: 2.4vw; }
  .with-slides .qr-logo.logo-img { height: 13vh; }
  .with-slides .qr-title { font-size: clamp(24px, 4.4vh, 56px); max-width: 16ch; margin: 0; }
  .with-slides .qr-box { width: min(58vh, 42vw); }
  .with-slides .qr-hint { font-size: clamp(15px, 2.4vh, 28px); max-width: 28ch; }
  .with-slides .slides { flex: 1; width: auto; height: auto; min-height: 0; margin: 0; }
  .with-slides .slide { display: flex; flex-direction: column; gap: 2vh; text-align: center; }
  .with-slides .slide-img { flex: 1; height: auto; }
}

/* Subtle credit line, pinned to the bottom edge; the layouts keep enough bottom padding that it never touches the QR. */
.qr-footer { position: fixed; left: 0; right: 0; bottom: max(1vh, env(safe-area-inset-bottom)); text-align: center; font-size: clamp(11px, 1.5vmin, 16px); letter-spacing: .06em; color: #8a7c71; pointer-events: none; }
.qr-screen { padding-bottom: max(5vh, 34px); }
.qr-screen.with-slides { padding-bottom: max(5.5vh, 36px); }
.qr-fs { position: fixed; right: 12px; bottom: 12px; font: inherit; font-size: 14px; border: 1px solid #3a2e27; background: transparent; color: #a89a8f; border-radius: 8px; padding: 6px 10px; z-index: 5; }
:fullscreen .qr-fs { display: none; }
@media print {
  .qr-fs, .slides { display: none !important; }
  .qr-footer { position: static; color: #777; font-size: 9pt; margin-top: 4mm; }
  @page { size: A4 portrait; margin: 12mm; }
  .qr-body { background: #fff; color: #000; }
  .qr-screen, .qr-screen.with-slides { display: flex; flex-direction: column; min-height: auto; padding: 0; gap: 5mm; }
  .qr-logo.logo-img, .with-slides .qr-logo.logo-img { height: 45mm; }
  .qr-event { color: #4A362A; font-size: 16pt; }
  .qr-box, .with-slides .qr-box { width: 120mm; padding: 0; border-radius: 0; }
  .qr-title { font-size: 30pt; } .qr-hint { font-size: 14pt; color: #333; } .qr-url { font-size: 11pt; color: #555; }
  .logo-img, .logo-text { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Admin */
.admin { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
body:has(.admin) { padding: 0; }
.admin-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; }
.admin h1 { margin: 2px 0 0; font-size: 26px; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.btn-inline { width: auto; font-size: 16px; padding: 11px 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.stat .n { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 13px; }
.admin h2 { font-size: 16px; margin: 24px 0 8px; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eceef2; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.empty { color: var(--muted); }
.links { margin-top: 24px; font-size: 14px; }
.links .note { text-align: left; }

/* Admin: login/activation reuse .card; Leads page below */
.banner.ok { background: #ecfdf3; color: #067647; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--hero); color: #fff; }
.admin-brand { font-weight: 700; font-size: 15px; }
.logout { display: flex; align-items: center; gap: 10px; margin: 0; }
.logout .who { color: #cdbfb3; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.logout button { font: inherit; font-size: 14px; color: #fff; background: transparent; border: 1px solid #6b5a4f; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.btn-download { display: block; margin: 4px 0 18px; font-size: 18px; }
.btn-download span { font-weight: 500; opacity: .85; font-size: 14px; }
.filters { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: grid; gap: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 0; }
.filter-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filter-form .grow { flex: 1 1 200px; }
.filter-form input { font: inherit; font-size: 16px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; width: 100%; }
.filter-form .clear { font-size: 14px; padding: 10px 4px; }
.muted { color: var(--muted); font-weight: 500; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 14px 0; font-size: 14px; }
@media (max-width: 640px) {
  .stats { gap: 8px; } .stat { padding: 10px; } .stat .n { font-size: 22px; } .stat .k { font-size: 12px; }
  .filter-form label:not(.grow) { flex: 1 1 40%; }
  .filter-form .btn-inline { flex: 1 1 100%; }
  .table-wrap { background: transparent; box-shadow: none; }
  table.leads thead { display: none; }
  table.leads, table.leads tbody, table.leads tr, table.leads td { display: block; width: 100%; }
  table.leads tr { background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); margin-bottom: 10px; padding: 8px 12px; }
  table.leads td { border: 0; padding: 3px 0; white-space: normal; overflow-wrap: anywhere; display: grid; grid-template-columns: 88px 1fr; gap: 8px; }
  table.leads td::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding-top: 2px; }
}
