/* Scan Me Single — Organic design system tokens + app styles (Direction 1a, "Soft cards") */
@import url('https://fonts.googleapis.com/css2?family=Caprasimo:wght@400&family=Figtree:wght@400;600;700&display=swap');

:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-accent-2: #7a8a5e;
  --color-divider: rgba(32, 30, 29, 0.16);

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-400: #f6a06b;
  --color-accent-500: #d67f48;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;
  --color-accent-900: #402310;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-400: #aebf92;
  --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;
  --color-accent-2-900: #272e1b;

  --font-heading: "Caprasimo", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;

  --shadow-sm: 0 1px 2px rgba(46, 43, 37, 0.14);
  --shadow-md: 0 3px 10px rgba(46, 43, 37, 0.16);
  --shadow-lg: 0 12px 32px rgba(46, 43, 37, 0.22);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
}
p { margin: 0; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: rgba(198, 113, 57, 0.3); }
input::placeholder, textarea::placeholder { color: var(--color-neutral-600); opacity: 1; }
[hidden] { display: none !important; }
.washed { filter: saturate(0.6) contrast(0.85) brightness(1.1) opacity(0.94); }

/* ---------- Layout ---------- */
.page {
  max-width: 430px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.confirm {
  max-width: 430px;
  margin: 0 auto;
  padding: calc(36px + env(safe-area-inset-top)) 24px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; }
.wordmark { font-family: var(--font-heading); font-size: 19px; line-height: 1.2; }
.tag {
  display: inline-flex; align-items: center;
  font-size: 12px; line-height: 1.5;
  padding: 4px 12px; border-radius: 999px;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-sage { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }

/* ---------- Hero ---------- */
.hero { display: flex; flex-direction: column; gap: 14px; padding: 8px 2px 0; }
.hero h1 { font-size: 36px; text-wrap: balance; }
.hero p { font-size: 16px; line-height: 1.55; text-wrap: pretty; }
.avatar {
  border-radius: 50%; flex: none;
  object-fit: cover; background-size: cover; background-position: center;
}
.avatar-placeholder {
  background: repeating-linear-gradient(45deg, var(--color-neutral-300) 0 6px, var(--color-neutral-200) 6px 12px);
}
.avatar-104 { width: 104px; height: 104px; }
.avatar-76 { width: 76px; height: 76px; }
.avatar-60 { width: 60px; height: 60px; }

/* ---------- How it works ---------- */
.steps {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px; border-radius: 28px;
  background: var(--color-accent-2-100);
}
.step { display: flex; gap: 12px; align-items: center; }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent-2-700); color: var(--color-neutral-100);
  font-weight: 700; font-size: 13px; line-height: 1;
}
.step-label { font-size: 15px; color: var(--color-accent-2-900); }

/* ---------- Cards ---------- */
.card {
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 20px 24px; border-radius: 32px;
  background: var(--color-surface);
}
.card.tight { gap: 14px; }
.card.gap-16 { gap: 16px; }
.card.gap-20 { gap: 20px; }
.card h3 { font-size: 22px; }
.helper { font-size: 14px; line-height: 1.5; color: var(--color-neutral-800); }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 14px; font-weight: 600; line-height: 1.4; }
.error { font-size: 13px; font-weight: 600; color: var(--color-accent-700); }

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px; /* keeps iOS from zooming on focus */
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  caret-color: var(--color-accent);
  -webkit-appearance: none;
  appearance: none;
}
.input, .select {
  min-height: 50px; padding: 12px 18px; border-radius: 999px; line-height: 1.5;
}
.input.h48 { min-height: 48px; }
.textarea {
  min-height: 100px; padding: 14px 18px; line-height: 1.45;
  border-radius: 24px; resize: vertical; display: block;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--color-accent); outline: none; }

.select-wrap { position: relative; }
.select { padding-right: 44px; cursor: pointer; }
.select.is-empty { color: var(--color-neutral-600); }
.select option { color: var(--color-text); }
.select-wrap svg { position: absolute; right: 18px; top: 16px; pointer-events: none; }

/* Pill choices (Yes/No and contact method) */
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; gap: 8px; }
.seg .choice { flex: 1; min-height: 44px; font-size: 15px; }
.choice {
  min-height: 50px; border-radius: 999px;
  border: 1px solid var(--color-divider);
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  cursor: pointer; padding: 0 8px;
}
.choice[aria-pressed="true"] { background: var(--color-accent); color: var(--color-bg); }

/* ---------- Photo tile ---------- */
.photo-tile { position: relative; display: block; cursor: pointer; }
.photo-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.photo-empty {
  height: 180px; border-radius: 28px;
  background: var(--color-bg);
  border: 2px dashed var(--color-neutral-400);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.photo-tile:hover .photo-empty { border-color: var(--color-accent); }
.photo-tile:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 28px; }
.camera-circle {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent-100); color: var(--color-accent-700);
}
.photo-empty .t1 { font-weight: 600; font-size: 16px; }
.photo-empty .t2 { font-size: 13px; color: var(--color-neutral-700); }
.photo-filled { position: relative; height: 280px; border-radius: 28px; overflow: hidden; }
.photo-filled .img { width: 100%; height: 100%; background-size: cover; background-position: center; }
.photo-filled .pill {
  position: absolute; right: 12px; bottom: 12px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--color-bg); font-weight: 600; font-size: 13px; line-height: 1.4;
}

/* ---------- Buttons ---------- */
.submit-area { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; cursor: pointer;
  font-family: var(--font-heading); font-weight: 400; line-height: 1.2;
  text-decoration: none;
}
.btn-primary { border: 0; background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border: 1px solid var(--color-divider); background: transparent; color: var(--color-text); }
.btn-secondary:hover { background: var(--color-neutral-300); }
.btn-submit { min-height: 58px; font-size: 20px; width: 100%; }
.btn-edit { min-height: 52px; font-size: 17px; width: 100%; }
.btn-50 { min-height: 50px; font-size: 15px; }
.footnote { font-size: 13px; text-align: center; color: var(--color-neutral-700); }

/* ---------- Confirmation ---------- */
.check-circle {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent-2-200); color: var(--color-accent-2-800);
}
.confirm h1 { font-size: 40px; }
.confirm .lead { font-size: 16px; line-height: 1.55; }
.confirm .muted { font-size: 15px; line-height: 1.5; color: var(--color-neutral-700); }
.summary {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 28px; background: var(--color-surface);
}
.summary .who { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.summary .who .n { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary .who .s { font-size: 13px; color: var(--color-neutral-700); }

/* ---------- Setup ---------- */
.heading-block { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.heading-block h2 { font-size: 32px; }
.heading-block p { font-size: 15px; line-height: 1.5; color: var(--color-neutral-800); }
.qr-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 26px 20px; border-radius: 32px;
  background: var(--color-neutral-100); box-shadow: var(--shadow-sm);
}
.qr-card .title { font-family: var(--font-heading); font-size: 24px; line-height: 1.2; }
.qr-box { width: 200px; height: 200px; color: var(--color-text); }
.qr-box svg { display: block; width: 100%; height: 100%; }
.qr-url {
  font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--color-neutral-700);
  word-break: break-all; text-align: center;
}
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-row { display: flex; gap: 16px; align-items: center; }
.profile-row .avatar-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; }
.stack-6 { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.toggle-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.toggle-text { display: flex; flex-direction: column; gap: 3px; }
.toggle-text .t { font-weight: 600; font-size: 15px; line-height: 1.4; }
.toggle-text .d { font-size: 13px; line-height: 1.4; color: var(--color-neutral-700); }
.switch {
  flex: none; width: 54px; height: 32px; padding: 3px;
  border: 0; border-radius: 999px; cursor: pointer;
  display: flex; justify-content: flex-start;
  background: var(--color-neutral-400);
}
.switch[aria-checked="true"] { justify-content: flex-end; background: var(--color-accent); }
.switch .knob {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-neutral-100); box-shadow: var(--shadow-sm);
}
