/* Large text and big tap targets throughout — field staff use a wide range
   of phones, often with small/low-res screens, and are not tech-savvy. */

* { box-sizing: border-box; }

:root {
  --brown: #5B3A29;
  --brown-dark: #402919;
  --cream: #F5E9DC;
  --green: #2E7D32;
  --red: #C62828;
  --amber: #E58A00;
  --grey: #6B6B6B;
  --border: #D8C9B8;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }

.app-header {
  background: var(--brown);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header h1 { font-size: 20px; margin: 0; }
.pending-badge {
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 15px;
  font-weight: bold;
}
.pending-badge.hidden { display: none; }

.update-banner {
  background: var(--green);
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  font-weight: bold;
}
.update-banner button {
  margin-left: 10px;
  background: #fff;
  color: var(--green);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: bold;
}

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

.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.progress .dot {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
}
.progress .dot.active { background: var(--brown); }
.progress .dot.done { background: var(--green); }

.step { display: none; }
.step.active { display: block; }

.step h2 { font-size: 22px; margin: 0 0 16px; color: var(--brown-dark); }

.field { margin-bottom: 18px; }
.field.hidden { display: none; }
.field label { display: block; font-weight: bold; margin-bottom: 6px; }
.field .hint { font-size: 14px; color: var(--grey); margin-top: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-weight: bold; }
.checkbox-label input[type="checkbox"] { width: 22px; height: 22px; }

input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.age-inputs { display: flex; gap: 14px; }
.age-input-group { flex: 1; display: flex; align-items: center; gap: 8px; }
.age-input-group input[type="number"] { width: auto; flex: 1; }
.age-input-group span { font-size: 14px; color: var(--grey); white-space: nowrap; }

.big-choice { display: flex; gap: 10px; }
.big-choice button {
  flex: 1;
  padding: 16px 8px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fff;
  font-weight: bold;
  font-size: 17px;
}
.big-choice button.selected.yes { background: var(--green); border-color: var(--green); color: #fff; }
.big-choice button.selected.no { background: var(--red); border-color: var(--red); color: #fff; }
.big-choice button.selected.na { background: var(--grey); border-color: var(--grey); color: #fff; }

.photo-card {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: center;
  background: #fff;
}
.photo-card img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; margin: 10px auto 0; }
.photo-card .capture-btn {
  display: inline-block;
  background: var(--brown);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  border: none;
  font-weight: bold;
  font-size: 17px;
}
.photo-card.filled { border-style: solid; border-color: var(--green); }
.photo-card .retake { margin-top: 10px; background: none; border: none; color: var(--brown); text-decoration: underline; font-size: 15px; }

.nav-buttons {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 2px solid var(--border);
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.nav-buttons button {
  flex: 1;
  padding: 16px;
  border-radius: 10px;
  border: none;
  font-weight: bold;
  font-size: 18px;
}
.btn-back { background: var(--border); color: #333; }
.btn-next { background: var(--brown); color: #fff; }
.btn-submit { background: var(--green); color: #fff; }
button:disabled { opacity: 0.5; }

.error-banner {
  background: #FDECEA;
  border: 2px solid var(--red);
  color: var(--red);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: bold;
}
.error-banner.hidden { display: none; }

.toast {
  position: fixed;
  bottom: 90px; left: 16px; right: 16px;
  max-width: 528px;
  margin: 0 auto;
  background: var(--brown-dark);
  color: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  z-index: 20;
}
.toast.hidden { display: none; }

.list-item {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.list-item .title { font-weight: bold; font-size: 17px; }
.list-item .status { font-size: 15px; margin-top: 6px; font-weight: bold; }
.status-pending { color: var(--amber); }
.status-synced { color: var(--green); }
.status-failed { color: var(--red); }
.list-item .ai-summary { font-size: 15px; margin-top: 8px; color: #333; }
.list-item .retry-btn {
  margin-top: 10px;
  background: var(--brown);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: bold;
}
.list-item .receipt-btn {
  margin-top: 10px;
  margin-right: 8px;
  background: #fff;
  color: var(--brown);
  border: 2px solid var(--brown);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: bold;
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid var(--brown);
  background: #fff;
  color: var(--brown);
  font-weight: bold;
}
.tabs button.active { background: var(--brown); color: #fff; }

.help-link {
  display: block;
  text-align: center;
  margin-top: 24px;
  color: var(--grey);
  font-size: 14px;
  text-decoration: underline;
  background: none;
  border: none;
  width: 100%;
}
