:root {
  --primary:    #1e5631;
  --primary-lt: #2a7a45;
  --primary-dk: #163f24;
  --primary-bg: #e8f5e9;
  --danger:     #c0392b;
  --warning:    #e67e22;
  --grey-100:   #f5f5f5;
  --grey-200:   #eeeeee;
  --grey-300:   #e0e0e0;
  --grey-500:   #9e9e9e;
  --grey-700:   #616161;
  --grey-900:   #212121;
  --radius:     10px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f9f9f9;
  color: var(--grey-900);
  padding-bottom: 40px;
}

/* ── Header ─────────────────────────────────────── */
.app-header {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.app-logo { height: 36px; width: auto; }
.app-title { font-size: 1.05rem; font-weight: 600; flex: 1; }
.app-step  { font-size: 0.8rem; opacity: .8; white-space: nowrap; }

/* ── Progress bar ────────────────────────────────── */
.progress-bar-wrap {
  height: 5px;
  background: var(--grey-200);
}
.progress-bar {
  height: 100%;
  background: var(--primary-lt);
  transition: width .3s ease;
}

/* ── Safety banner ───────────────────────────────── */
.safety-banner {
  margin: 14px 14px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid #c00;
}
.safety-line {
  padding: 11px 14px;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
}
.safety-red   { background: #c00; color: #fff; }
.safety-amber { background: #e67e22; color: #fff; }
.safety-green { background: #1e5631; color: #fff; }
.safety-green a { color: #ade8bc; }

/* ── Pages ───────────────────────────────────────── */
.page { padding: 14px 14px 0; }

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.page-intro {
  font-size: 0.9rem;
  color: var(--grey-700);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── Form elements ───────────────────────────────── */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--grey-900);
}
.req { color: var(--danger); }
.helper {
  font-size: 0.78rem;
  color: var(--grey-500);
  margin-top: 4px;
}

input[type=text],
input[type=email],
input[type=tel],
textarea,
select {
  width: 100%;
  padding: 13px 12px;
  font-size: 1rem;
  border: 2px solid var(--grey-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--grey-900);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 120px; }

/* ── Choice buttons ──────────────────────────────── */
.btn-group-choice {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.choice-btn {
  flex: 1;
  min-width: 80px;
  padding: 14px 8px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--grey-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--grey-700);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.choice-btn.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}
.choice-btn:active { transform: scale(.97); }

/* ── Multi-entry (third parties / witnesses) ─────── */
.section-label {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--grey-500);
  margin-bottom: 10px;
}
.multi-entry {
  background: #fff;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.multi-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--grey-100);
  border-bottom: 1px solid var(--grey-300);
}
.multi-entry-title { font-weight: 700; font-size: 0.92rem; color: var(--primary); }
.remove-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--danger);
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.multi-entry .form-group { padding: 0 14px; }
.multi-entry .form-group:first-of-type { padding-top: 12px; }
.multi-entry .form-group:last-of-type { padding-bottom: 14px; }

/* ── Photo prompts ───────────────────────────────── */
.photo-prompt {
  background: #fff;
  border: 2px solid var(--grey-300);
  border-radius: var(--radius);
  margin-bottom: 14px;
  padding: 14px;
}
.photo-prompt.has-photo { border-color: var(--primary-lt); }
.photo-prompt-label { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.photo-prompt-hint { font-size: 0.8rem; color: var(--grey-500); margin-bottom: 10px; }

.photo-captures { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.photo-thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}
.photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.photo-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 20px;
  text-align: center;
  padding: 0;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 22px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-lt); border-color: var(--primary-lt); }
.btn-outline  { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-sm       { padding: 9px 16px; font-size: 0.88rem; }
.btn-lg       { padding: 15px 28px; font-size: 1.05rem; }
.btn-block    { width: 100%; }

.btn-camera {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn-camera input[type=file] { display: none; }
.btn-camera:active { transform: scale(.97); }

/* ── Page navigation ─────────────────────────────── */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-bottom: 16px;
}

/* ── Upload progress ─────────────────────────────── */
.upload-label { font-size: 0.9rem; color: var(--grey-700); margin-bottom: 6px; }
.upload-bar-wrap {
  height: 10px;
  background: var(--grey-200);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 14px;
}
.upload-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 5px;
  transition: width .2s ease;
  width: 0%;
}

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 14px;
  line-height: 1.4;
}
.alert-error { background: #fdecea; color: #b71c1c; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: var(--primary-dk); border: 1px solid #a5d6a7; }

/* ── Checkbox label ──────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-weight: 400;
}
.checkbox-label input[type=checkbox] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2px solid var(--grey-300);
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  cursor: pointer;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.checkbox-label input[type=checkbox]:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8l3.5 3.5L13 5' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px;
  background-repeat: no-repeat;
  background-position: center;
}

/* ── Success screen ──────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 40px 24px;
}
.success-icon { font-size: 4rem; margin-bottom: 16px; }
.success-screen h2 { color: var(--primary); margin-bottom: 10px; font-size: 1.5rem; }
.success-screen p { color: var(--grey-700); line-height: 1.6; margin-bottom: 8px; }

/* ── Auth / login ─────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--grey-100);
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  border-top: 4px solid var(--primary);
}
.auth-logo { display: block; max-width: 180px; margin: 0 auto 20px; }
.auth-card h1 { text-align: center; font-size: 1.4rem; color: var(--primary); margin-bottom: 4px; }
.auth-card p  { text-align: center; color: var(--grey-500); margin-bottom: 20px; font-size: 0.9rem; }
.btn-block { display: block; width: 100%; }
