/* Visitor sign-in kiosk. Brand tokens are set on :root by kiosk.js from config/brands.json */
:root {
  --dark: #333; --accent: #333; --on-accent: #fff; --text: #222; --muted: #666; --surface: #f2f2f2; --bg: #fff;
  --font-h: -apple-system, system-ui, 'Helvetica Neue', sans-serif;
  --font-b: -apple-system, system-ui, 'Helvetica Neue', sans-serif;
  --radius: 4px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-b);
  -webkit-user-select: none; user-select: none; overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Screens ---------- */
.screen { display: none; }
.screen.active { display: block; animation: in .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#shell { min-height: 100vh; display: flex; flex-direction: column; }
#shell > .screen.active { flex: 1; }

.content { max-width: 860px; margin: 0 auto; padding: 40px 40px 32px; }
.content.center { text-align: center; }

/* ---------- Choose business (neutral, before any brand applies) ---------- */
#s-choose { min-height: 100vh; background: #f5f5f4; }
#s-choose.active { display: flex; align-items: center; justify-content: center; }
.choose-wrap { width: 100%; max-width: 1000px; padding: calc(40px + var(--safe-t)) 32px calc(40px + var(--safe-b)); text-align: center; font-family: -apple-system, system-ui, 'Helvetica Neue', sans-serif; color: #1c1c1c; }
.neutral-title { font-size: 56px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.5px; }
.neutral-sub { font-size: 24px; color: #555; margin: 0 0 40px; }
.neutral-foot { font-size: 16px; color: #777; margin-top: 32px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.tile {
  position: relative; border: 0; border-radius: 6px; min-height: 300px; padding: 40px 32px 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08); transition: transform .12s;
  overflow: hidden;
}
.tile:active { transform: scale(.98); }
.tile .tile-logo { height: 72px; max-width: 80%; display: flex; align-items: center; justify-content: center; }
.tile .tile-logo img { max-height: 72px; max-width: 100%; display: block; }
.tile .tile-desc { font-size: 18px; line-height: 1.4; }
/* Each tile is drawn entirely in its own brand */
.tile[data-id="strabe"] { background: #fff; color: #4A4A4A; font-family: 'Montserrat', sans-serif; }
.tile[data-id="strabe"] .tile-logo, .tile[data-id="strabe"] .tile-logo img { height: 150px; max-height: 150px; }
.tile[data-id="strabe"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: #B8FF2B; }
.tile[data-id="bendcraft"] { background: #fff; color: #1A1F2E; font-family: 'Helvetica Neue', 'Inter', sans-serif; }
.tile[data-id="bendcraft"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: #FF6B35; }
.tile[data-id="bendcraft"] .tile-desc { color: #4A5568; }

.logo-ph {
  display: inline-flex; align-items: center; justify-content: center; padding: 14px 22px;
  border: 2px dashed currentColor; border-radius: 4px; font: 600 16px/1.2 var(--font-b); opacity: .85;
}

/* ---------- Branded header / footer ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(18px + var(--safe-t)) 32px 18px; position: relative;
}
.logo-slot { height: 48px; display: flex; align-items: center; }
.logo-slot img { height: 48px; width: auto; display: block; }
.ghost { background: transparent; border: 2px solid currentColor; border-radius: var(--radius); padding: 10px 18px; min-height: 48px; font-weight: 600; font-size: 16px; color: inherit; }
.foot { padding: 14px 32px calc(14px + var(--safe-b)); font-size: 13px; color: var(--muted); text-align: center; }

body[data-brand="strabe"] .bar { background: #fff; color: var(--dark); padding-top: calc(14px + var(--safe-t)); padding-bottom: 14px; border-bottom: 1px solid var(--surface); box-shadow: inset 10px 0 0 var(--accent); }
body[data-brand="strabe"] .logo-slot, body[data-brand="strabe"] .logo-slot img { height: 88px; }
body[data-brand="bendcraft"] .bar { background: #fff; color: var(--dark); border-top: 6px solid var(--accent); border-bottom: 1px solid var(--surface); }

/* ---------- Type ---------- */
.h1 { font-family: var(--font-h); font-weight: 700; font-size: 44px; line-height: 1.15; margin: 8px 0 12px; letter-spacing: -0.3px; }
body[data-brand="strabe"] .h1::after { content: ""; display: block; width: 64px; height: 5px; background: var(--accent); margin-top: 12px; }
body[data-brand="strabe"] .center .h1::after { margin-left: auto; margin-right: auto; }
body[data-brand="bendcraft"] .h1 { letter-spacing: -0.5px; }
.lead { font-size: 22px; color: var(--muted); margin: 0 0 28px; line-height: 1.5; }
.hint { font-size: 16px; color: var(--muted); margin: 4px 0 0; }
.privacy { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 20px; }

/* ---------- Buttons ---------- */
.btn { min-height: 64px; padding: 0 36px; font-size: 21px; font-weight: 600; border-radius: var(--radius); border: 0; }
.btn:disabled { opacity: .5; }
.actions { display: flex; gap: 16px; justify-content: flex-end; margin-top: 32px; flex-wrap: wrap; }
.center .actions { justify-content: center; }

body[data-brand="strabe"] .primary { background: var(--dark); color: #fff; box-shadow: inset 8px 0 0 var(--accent); }
body[data-brand="strabe"] .secondary { background: #fff; color: var(--dark); border: 2px solid var(--dark); }
body[data-brand="bendcraft"] .primary { background: var(--accent); color: #fff; font-weight: 700; }
body[data-brand="bendcraft"] .primary:active { background: #FF8C42; }
body[data-brand="bendcraft"] .secondary { background: transparent; color: var(--dark); border: 2px solid var(--accent); }
body[data-brand="bendcraft"] .secondary:active { background: #FFF5F0; }

.big-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 20px; }
.big { min-height: 240px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; }
.big:active { transform: scale(.98); }
.big-label { font-family: var(--font-h); font-weight: 700; font-size: 44px; }
.big-sub { font-size: 20px; opacity: .85; }
body[data-brand="strabe"] .big.primary { box-shadow: inset 10px 0 0 var(--accent); }

:focus-visible { outline: 3px solid var(--dark); outline-offset: 3px; }
body[data-brand="bendcraft"] :focus-visible { outline-color: var(--accent); }

/* ---------- Form ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 8px; }
.center .steps { justify-content: center; }
.steps span { width: 48px; height: 6px; border-radius: 3px; background: var(--surface); }
.steps span.on { background: var(--dark); }
.steps span.done { background: var(--muted); }
body[data-brand="bendcraft"] .steps span.on { background: var(--accent); }
body[data-brand="strabe"] .steps span.on { background: var(--dark); box-shadow: inset 0 -2px 0 var(--accent); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: block; margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-size: 17px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field.narrow { max-width: 320px; }
.field input, .search {
  width: 100%; height: 64px; padding: 0 18px; font: 400 22px var(--font-b); color: var(--text);
  background: #fff; border: 2px solid #c9ccd1; border-radius: var(--radius); -webkit-appearance: none; appearance: none;
}
.field input:focus, .search:focus { outline: none; border-color: var(--dark); box-shadow: 0 0 0 3px var(--surface); }
body[data-brand="bendcraft"] .field input:focus, body[data-brand="bendcraft"] .search:focus { border-color: var(--accent); }
.field input.invalid { border-color: #c62828; background: #fff7f7; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { min-height: 56px; padding: 0 24px; font-size: 19px; font-weight: 600; border-radius: 28px; border: 2px solid #c9ccd1; background: #fff; color: var(--text); }
.chip[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
body[data-brand="strabe"] .chip[aria-pressed="true"] { box-shadow: inset 0 -4px 0 var(--accent); }
body[data-brand="bendcraft"] .chip[aria-pressed="true"] { border-color: var(--accent); }
.chips.invalid .chip { border-color: #c62828; }

.check { display: flex; gap: 16px; align-items: flex-start; font-size: 18px; line-height: 1.5; padding: 18px; background: var(--surface); border-radius: var(--radius); margin-top: 8px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: 0 0 36px; height: 36px; border: 2px solid var(--dark); border-radius: 4px; background: #fff; display: grid; place-items: center; }
.check input:checked + .box { background: var(--dark); }
.check input:checked + .box::after { content: ""; width: 10px; height: 18px; border: solid #fff; border-width: 0 4px 4px 0; transform: translateY(-2px) rotate(45deg); }
body[data-brand="strabe"] .check input:checked + .box::after { border-color: var(--accent); }
.check.invalid .box { border-color: #c62828; }

/* ---------- Camera ---------- */
.camera { position: relative; width: min(560px, 100%); aspect-ratio: 4 / 3; margin: 0 auto; border-radius: 6px; overflow: hidden; background: #111; }
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.camera img { transform: none; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font: 700 140px var(--font-h); color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.5); }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 32px; color: #fff; font-size: 20px; line-height: 1.5; text-align: center; }
.flash { animation: flash .35s; }
@keyframes flash { from { filter: brightness(3); } to { filter: none; } }

/* ---------- Done ---------- */
.tick { width: 120px; height: 120px; border-radius: 50%; margin: 24px auto 8px; background: var(--dark); position: relative; }
.tick::after { content: ""; position: absolute; left: 44px; top: 24px; width: 26px; height: 52px; border: solid #fff; border-width: 0 10px 10px 0; transform: rotate(45deg); }
body[data-brand="strabe"] .tick::after { border-color: var(--accent); }
body[data-brand="bendcraft"] .tick { background: var(--accent); }

/* ---------- Sign-out list ---------- */
.search { margin-bottom: 20px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.people button {
  width: 100%; min-height: 84px; text-align: left; padding: 14px 20px; background: #fff; border: 2px solid var(--surface);
  border-radius: var(--radius); display: flex; flex-direction: column; justify-content: center; color: var(--text);
}
.people button:active { border-color: var(--dark); }
.people .n { font-size: 21px; font-weight: 600; }
.people .c { font-size: 15px; color: var(--muted); margin-top: 2px; }
body[data-brand="strabe"] .people button { box-shadow: inset 5px 0 0 var(--dark); }
body[data-brand="bendcraft"] .people button { box-shadow: inset 5px 0 0 var(--accent); }
.empty { font-size: 19px; color: var(--muted); text-align: center; padding: 40px 0; line-height: 1.5; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 10; padding: 24px; }
.modal-card { background: #fff; border-radius: 6px; padding: 32px; width: min(560px, 100%); }
.modal-card h2 { font: 700 30px var(--font-h); margin: 0 0 8px; }
.modal-card p { font-size: 19px; color: var(--muted); margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(32px + var(--safe-b)); transform: translateX(-50%); background: #1c1c1c; color: #fff; padding: 16px 24px; border-radius: 6px; font-size: 18px; z-index: 20; max-width: 90vw; }
.busy { pointer-events: none; opacity: .6; }

/* ---------- Portrait iPad / small ---------- */
@media (max-width: 760px) {
  .tiles, .big-choices, .people { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .content { padding: 28px 20px; }
  .neutral-title { font-size: 42px; }
  .h1 { font-size: 34px; }
  .tile { min-height: 200px; }
  .big { min-height: 160px; }
}

/* Host name suggestions */
.suggest { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 20px; }
.suggest .chip { background: var(--surface); border-color: transparent; }
.suggest .chip:active { border-color: var(--dark); }
