/* Footfall IQ — shared UI styles. Mobile-first; end users are on phones. */

:root {
  --ffiq-dark: #013275;
  --ffiq-light: #018BEE;
  --ffiq-light-hover: #0179CF;
  --ffiq-tint: #E6F3FD;
  --bg: #EEF3F9;
  --surface: #FFFFFF;
  --text: #1B2A41;
  --muted: #5B6B82;
  --border: #D3DDEA;
  --danger: #C62828;
  --danger-bg: #FDECEC;
  --success: #1B7F4B;
  --success-bg: #E7F6EE;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(1, 50, 117, .06), 0 8px 24px rgba(1, 50, 117, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
}

a { color: var(--ffiq-light); }
a:hover { color: var(--ffiq-dark); }

/* --- shell --------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 4px solid var(--ffiq-light);
  border-image: linear-gradient(90deg, var(--ffiq-dark), var(--ffiq-light)) 1;
}
.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-header__logo { display: block; height: 36px; width: auto; }
.site-header__aside { font-size: 14px; color: var(--muted); }

.page {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.site-footer {
  background: var(--ffiq-dark);
  color: #C9D6EA;
  font-size: 13px;
}
.site-footer__inner { max-width: 960px; margin: 0 auto; padding: 16px; }
.site-footer strong { color: #fff; }

/* --- cards & type -------------------------------------------------------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card + .card { margin-top: 20px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ffiq-light);
}
h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.25; color: var(--ffiq-dark); }
h2 { margin: 0 0 12px; font-size: 18px; color: var(--ffiq-dark); }
.lead { margin: 0 0 20px; color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.center { text-align: center; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ffiq-tint);
  color: var(--ffiq-dark);
  font-size: 14px;
  font-weight: 600;
}

/* --- forms --------------------------------------------------------------- */

.field { margin: 0 0 16px; }
.field label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 15px; }
.field .hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.input:focus { outline: 3px solid rgba(1, 139, 238, .25); border-color: var(--ffiq-light); }
.input[readonly], .input:disabled { background: #F4F7FB; color: var(--muted); }

.password { position: relative; }
.password .input { padding-right: 72px; }
.password__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ffiq-light);
  font: 600 14px var(--font);
  cursor: pointer;
}
.password__toggle:hover { background: var(--ffiq-tint); }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; font-size: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ffiq-light); }

/* Email / text switch: two radios styled as a sliding toggle. */
.switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 16px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--ffiq-tint);
}
.switch[hidden], .btn[hidden] { display: none; }
.switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.switch__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(1, 50, 117, .18);
  transition: transform .2s ease;
}
.switch:has(input[value="email"]:checked) .switch__thumb { transform: translateX(100%); }
.switch label { position: relative; z-index: 1; margin: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  display: block;
  padding: 9px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
}
.switch input:checked + span { color: var(--ffiq-dark); }
.switch input:focus-visible + span { outline: 3px solid rgba(1, 139, 238, .35); }
@media (prefers-reduced-motion: reduce) { .switch__thumb { transition: none; } }

/* Home-screen prompt (e.g. complete your profile): the whole card is the link. */
.nudge { display: block; border-left: 4px solid var(--ffiq-light); color: var(--text); text-decoration: none; }
.nudge strong { display: block; color: var(--ffiq-dark); }
.nudge strong::after { content: " \203A"; }
.nudge:hover { background: var(--ffiq-tint); color: var(--text); }

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: block;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--ffiq-light);
  color: #fff;
  font: 700 16px var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--ffiq-light-hover); color: #fff; }
.btn:focus-visible { outline: 3px solid rgba(1, 139, 238, .35); outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn + .btn { margin-top: 10px; }

.btn--secondary { background: #fff; color: var(--ffiq-dark); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--ffiq-tint); color: var(--ffiq-dark); }
.btn--link { background: none; color: var(--ffiq-light); padding: 8px; font-weight: 600; }
.btn--link:hover { background: none; color: var(--ffiq-dark); text-decoration: underline; }

/* --- messages ------------------------------------------------------------ */

.alert { margin: 16px 0 0; padding: 12px 14px; border-radius: 8px; font-size: 15px; }
.alert:empty { display: none; }
.alert--error { background: var(--danger-bg); color: var(--danger); }
.alert--success { background: var(--success-bg); color: var(--success); }

/* --- "how it works" steps ------------------------------------------------ */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  margin: 0 0 14px;
  padding-left: 42px;
  color: var(--muted);
  font-size: 15px;
}
.steps li strong { display: block; color: var(--text); }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ffiq-dark);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 28px;
  text-align: center;
}

/* --- pass ---------------------------------------------------------------- */

.pass {
  overflow: hidden;
  padding: 0;
  text-align: center;
}
.pass__top {
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, var(--ffiq-dark), var(--ffiq-light));
  color: #fff;
}
.pass__top h1 { color: #fff; margin: 0 0 4px; }
.pass__top p { margin: 0; opacity: .9; }
.pass__qr { padding: 22px 24px 8px; }
.pass__qr canvas { display: block; width: 220px; height: 220px; margin: 0 auto; }
.pass__body { padding: 8px 24px 24px; }

.status-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
}
.status-icon--error { background: var(--danger-bg); color: var(--danger); }
.status-icon--ok { background: var(--success-bg); color: var(--success); }

.alert--banner { margin: 0 0 16px; }
.site-header__aside .btn { width: auto; white-space: nowrap; }

/* --- co-branding (account holder) ----------------------------------------- */

.site-header__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cobrand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  min-width: 0;
}
.cobrand__logo { display: block; max-height: 30px; max-width: 110px; width: auto; }
.cobrand__name {
  font-weight: 700;
  color: var(--brand, var(--ffiq-dark));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 380px) { .site-header__logo { height: 30px; } .cobrand__for { display: none; } }

.status-icon--info { background: var(--ffiq-tint); color: var(--ffiq-light); }

/* --- offers ---------------------------------------------------------------- */

.offer { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; }
.offer__badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--ffiq-dark);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.offer h2 { margin: 0 0 6px; }
.offer p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.offer__terms { font-size: 13px; }

.venue-title { margin: 0 0 4px; }
.venue-sub { margin: 0 0 18px; color: var(--muted); }

/* --- validation screen (shown to till staff) ------------------------------ */

.valid {
  padding: 26px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0E7A45, #1BA864);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}
.valid h1 { color: #fff; font-size: 24px; margin: 6px 0 10px; }
.valid__tick { font-size: 44px; line-height: 1; }
.valid__offer { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.valid__line { margin: 4px 0; opacity: .95; }
.valid__code {
  display: inline-block;
  margin: 14px 0 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  font: 700 26px/1 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .15em;
}
.valid__clock { font-variant-numeric: tabular-nums; font-size: 15px; opacity: .95; }
.valid__live { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: #fff; animation: pulse 1s infinite; }
.valid--done { background: linear-gradient(135deg, var(--ffiq-dark), var(--ffiq-light)); }
.valid--expired { background: #6B7A90; }
@keyframes pulse { 50% { opacity: .2; transform: scale(.7); } }

/* --- code entry ------------------------------------------------------------ */

.code-input { font: 700 26px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .4em; text-align: center; }

/* --- lists ----------------------------------------------------------------- */

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 15px; }
.list li:first-child { border-top: 0; }
.list .meta { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }

.select { appearance: auto; }

/* --- survey ---------------------------------------------------------------- */

.survey-loc { margin: 0 0 8px; padding: 14px; border-radius: 8px; background: var(--ffiq-tint); }
.survey-loc .small { margin: 0 0 10px; }
.survey-loc .small:last-child { margin: 8px 0 0; }
.q { margin: 20px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--border); }
.q legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; font-weight: 700; }
.opt {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.opt:hover { border-color: var(--ffiq-light); }
.opt[aria-pressed="true"] { border-color: var(--ffiq-light); background: var(--ffiq-tint); font-weight: 600; }
#send { margin-top: 20px; }

/* --- tester station (test.php) --------------------------------------------- */

.tester { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
.tester > section, .tester > .card + .card { margin: 0 0 20px; min-width: 0; }
.tester__qr canvas { width: 260px; max-width: 100%; height: auto; margin: 8px auto 0; display: block; }
.tester__code { margin: 0 0 12px; padding: 18px; }
.tester__invite { margin: 18px 0 24px; padding: 0 0 20px; border-bottom: 1px solid var(--border); }
.tester h2 { font-size: 18px; }
.tester__code .btn { margin-top: 8px; }
@media (min-width: 900px) {
  .page:has(.tester) { max-width: 1100px; }
  .tester { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .tester > section:last-child { grid-column: 1 / -1; }
}

/* Till screen: codes already redeemed by the venue */
.till-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 0 8px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.till-row .pill { margin-left: auto; }
