:root {
  --orange: #f08a24;
  --orange-dark: #c96a0c;
  --ink: #1f1f1f;
  --grey: #5f6368;
  --line: #d9d9d9;
  --bg: #f5f5f4;
  --card: #ffffff;
  --green: #1e7b34;
  --green-bg: #e3f4e7;
  --amber: #8a5a00;
  --amber-bg: #fff1d1;
  --red: #b3261e;
  --red-bg: #fde3e1;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

.top {
  background: #fff;
  border-bottom: 4px solid var(--orange);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  text-align: center;
}
.logo { height: 56px; width: auto; }

.env-banner, .offline-banner {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 6px 16px;
}
.env-banner { background: #3a3a3a; color: #fff; }
.offline-banner { background: var(--amber-bg); color: var(--amber); }

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

h1 { font-size: 22px; margin: 4px 0 4px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
.sub { color: var(--grey); margin: 0 0 16px; }
.loading { text-align: center; color: var(--grey); padding: 40px 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

label { display: block; font-weight: 600; margin: 14px 0 6px; }
label .opt { font-weight: 400; color: var(--grey); }
.hint { color: var(--grey); font-size: 14px; margin: 4px 0 0; }

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], select, textarea {
  width: 100%;
  min-height: 48px;
  font: inherit;
  font-size: 16px; /* stops iPhone zooming in */
  padding: 10px 12px;
  border: 1px solid #b9b9b9;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(240, 138, 36, .45); border-color: var(--orange); }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--red); background: #fffafa; }
.field-error { color: var(--red); font-size: 14px; margin: 4px 0 0; }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label {
  flex: 1 1 0;
  margin: 0;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid #b9b9b9; border-radius: 10px; background: #fff; font-weight: 600;
  padding: 8px;
}
.radio-row input { width: 20px; height: 20px; accent-color: var(--orange); }
.radio-row label:has(input:checked) { border-color: var(--orange); background: #fff4e8; }

.photo-input { border: 2px dashed #b9b9b9; border-radius: 10px; padding: 12px; background: #fafafa; }
.photo-input.has-photo { border-style: solid; border-color: var(--green); background: var(--green-bg); }
.photo-input input[type=file] { width: 100%; font-size: 16px; }
.photo-input img { display: block; max-width: 100%; max-height: 180px; margin-top: 10px; border-radius: 8px; }

.btn {
  display: block; width: 100%;
  min-height: 52px;
  margin-top: 20px;
  font: inherit; font-weight: 700; font-size: 17px;
  border: 0; border-radius: 10px;
  background: var(--orange); color: #1f1f1f;
  cursor: pointer;
}
.btn:active { background: var(--orange-dark); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; border: 1px solid #b9b9b9; color: var(--ink); }
.btn.small { display: inline-block; width: auto; min-height: 40px; margin: 0; padding: 0 14px; font-size: 15px; }
.link { background: none; border: 0; color: var(--ink); text-decoration: underline; font: inherit; padding: 12px 0; cursor: pointer; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1; min-height: 48px; font: inherit; font-weight: 700;
  border: 1px solid #b9b9b9; border-radius: 10px; background: #fff; cursor: pointer;
}
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; border-color: var(--ink); }

.msg { border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-weight: 500; }
.msg.error { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.msg.info { background: #eef2f7; color: #24364d; }

.steps { display: flex; gap: 6px; margin: 0 0 12px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--orange); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: 0; }

.ticket { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ticket h3 { margin: 0 0 2px; font-size: 17px; }
.ticket p { margin: 0; color: var(--grey); font-size: 14px; }
.ticket-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.pill { display: inline-block; white-space: nowrap; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.grey { background: #ececec; color: #444; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.empty { text-align: center; color: var(--grey); padding: 16px 0; }
.footer-actions { display: flex; justify-content: space-between; margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
