/* Evolv Gate Setup — sun-readable, one-handed, portrait-first.
   Hard rules: pure white bg, near-black text, >=18px body, no light-gray text,
   56px+ tap targets, orange #F4633A for branding/progress only. */

:root {
  --ink: #111111;
  --accent: #F4633A;
  --yes: #1a7f37;
  --no: #c62828;
  --warn-bg: #ffe1a8;
  --warn-border: #b45309;
  --line: #111111;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.4;
}

.hidden { display: none !important; }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }

h1 { font-size: 26px; font-weight: 800; margin: 16px 0 20px; }
h2 { font-size: 21px; font-weight: 800; margin: 0; }

/* ---------- Branding ---------- */
.brand { margin: 8px 0 24px; }
.brand-mark {
  color: var(--accent);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 1px;
}
.brand-sub { font-weight: 600; font-size: 18px; margin-top: 2px; }

/* ---------- Gate list ---------- */
.gate-list { display: flex; flex-direction: column; gap: 14px; }
.btn-gate {
  width: 100%;
  min-height: 64px;
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
}
.btn-gate:active { background: #eee; }
.btn-gate .gate-status { display: block; font-size: 16px; font-weight: 800; margin-top: 6px; }
.btn-gate.gate-submitted { border-color: var(--yes); }
.btn-gate.gate-submitted .gate-status { color: var(--yes); }
.btn-gate.gate-inprogress { border-color: var(--warn-border); }
.btn-gate.gate-inprogress .gate-status { color: var(--warn-border); }

.admin-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin-top: 32px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
}

/* ---------- Generic buttons ---------- */
.btn-primary, .btn-secondary, .btn-submit {
  width: 100%;
  min-height: 60px;
  border-radius: 12px;
  font-size: 21px;
  font-weight: 800;
  cursor: pointer;
  padding: 12px 16px;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  margin-top: 20px;
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
  margin-top: 20px;
}
.btn-submit {
  background: var(--accent);
  color: #fff;
  border: 3px solid var(--accent);
}
.btn-submit:disabled { opacity: 0.999; } /* never dim — glare kills dimmed UI */

.back-link {
  background: none;
  border: none;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  padding: 14px 8px 14px 0;
  min-height: 56px;
  cursor: pointer;
}

/* ---------- Text input ---------- */
.field-label { display: block; font-size: 19px; font-weight: 800; margin: 12px 0 8px; }
.text-input {
  width: 100%;
  min-height: 60px;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.text-input::placeholder { color: #555; font-weight: 500; }
textarea.text-input { min-height: 120px; resize: vertical; font-weight: 600; }
.input-error { color: var(--no); font-weight: 800; margin: 8px 0 0; }

/* ---------- Sticky top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 3px solid var(--ink);
  padding: 10px 16px 0;
}
.topbar-main {
  max-width: 528px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}
.topbar-back {
  flex: none;
  width: 44px;
  min-height: 56px;
  font-size: 38px;
  font-weight: 900;
  background: #fff;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  text-align: left;
}
.topbar-info { flex: 1; min-width: 0; }
.topbar-gate {
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-progress { font-size: 16px; font-weight: 700; }
.save-pill {
  font-size: 15px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  white-space: nowrap;
}
.save-pill.saved { color: var(--yes); border-color: var(--yes); }
.save-pill.saving { color: var(--ink); border-color: var(--ink); }
.save-pill.offline { color: #fff; background: var(--no); border-color: var(--no); }
.progress-track { height: 8px; background: #ddd; margin: 0 -16px; }
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s;
}

/* ---------- Sections ---------- */
.cl-section {
  border: 3px solid var(--ink);
  border-radius: 14px;
  margin: 18px 0;
  overflow: hidden;
}
.cl-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 3px solid var(--ink);
  background: #fff;
}
.cl-section-num {
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.cl-item { padding: 16px; border-bottom: 2px solid #bbb; }
.cl-item:last-child { border-bottom: none; }
.cl-item.missing { outline: 4px solid var(--no); outline-offset: -4px; background: #fdecec; }
.cl-question { font-size: 19px; font-weight: 800; margin: 0 0 12px; }

/* ---------- YES / NO toggles ---------- */
.yn { display: flex; gap: 12px; }
.yn button {
  flex: 1;
  min-height: 60px;
  font-size: 21px;
  font-weight: 900;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
}
.yn button.on-yes { background: var(--yes); border-color: var(--yes); color: #fff; }
.yn button.on-no { background: var(--no); border-color: var(--no); color: #fff; }

/* ---------- Steppers ---------- */
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 64px;
  height: 64px;
  flex: none;
  font-size: 34px;
  font-weight: 900;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}
.stepper button:active { background: #eee; }
.stepper-value {
  flex: 1;
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  min-height: 44px;
}
.stepper-value.unset { color: #555; font-weight: 700; }

/* ---------- Standing reminders ---------- */
.cl-note {
  background: var(--warn-bg);
  border: 3px solid var(--warn-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 17px;
  margin: 0 0 12px;
}
.photo-hint { font-size: 16px; font-weight: 600; margin: -6px 0 10px; }

/* ---------- Warnings ---------- */
.inline-warning {
  margin-top: 12px;
  background: var(--warn-bg);
  border: 3px solid var(--warn-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 18px;
}

/* ---------- Photos ---------- */
.photo-cat { padding: 16px; border-bottom: 2px solid #bbb; }
.photo-cat:last-child { border-bottom: none; }
.photo-cat.missing { outline: 4px solid var(--no); outline-offset: -4px; background: #fdecec; }
.photo-req { font-size: 16px; font-weight: 700; margin: 4px 0 12px; }
.photo-req.met { color: var(--yes); }
.btn-photo {
  width: 100%;
  min-height: 60px;
  font-size: 20px;
  font-weight: 800;
  border: 3px dashed var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.photo-thumb { position: relative; }
.photo-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid var(--ink);
  display: block;
}
.photo-thumb.uploading img { opacity: 0.4; }
.photo-del {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--no);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
}
.photo-del.confirm { width: auto; padding: 0 10px; border-radius: 22px; font-size: 15px; }
.photo-uploading-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
}

/* ---------- Submit area ---------- */
.submit-area { margin-top: 28px; }
.submit-blocked {
  background: #fdecec;
  border: 3px solid var(--no);
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  color: var(--no);
  margin: 0 0 14px;
}

/* ---------- Resume / summary / confirm ---------- */
.resume-card {
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-weight: 700;
}
.resume-icon { font-size: 32px; }

.submitted-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--yes);
  color: #fff;
  border-radius: 14px;
  padding: 18px;
  margin: 8px 0 20px;
}
.submitted-check { font-size: 36px; font-weight: 900; }
.submitted-title { font-size: 22px; font-weight: 900; }
.submitted-sub { font-size: 17px; font-weight: 700; }

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 2px solid #bbb;
  font-size: 18px;
}
.summary-row .q { font-weight: 700; }
.summary-row .a { font-weight: 900; white-space: nowrap; }
.summary-row .a.yes { color: var(--yes); }
.summary-row .a.no { color: var(--no); }
.summary-section-title { font-size: 19px; font-weight: 900; margin: 22px 0 4px; }

.confirm-wrap { text-align: center; padding-top: 40px; }
.confirm-check {
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--yes);
  color: #fff;
  font-size: 56px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-note { font-weight: 600; }
.confirm-flags {
  text-align: left;
  background: var(--warn-bg);
  border: 3px solid var(--warn-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  margin-top: 16px;
}
.confirm-flags ul { margin: 8px 0 0; padding-left: 20px; }

.loading-text { font-size: 20px; font-weight: 700; text-align: center; padding: 60px 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  z-index: 100;
}
