/* -----------------------------
   Global layout & typography
------------------------------ */

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f6f7fb;
  margin: 0;
  color: #111;
}

.container {
  max-width: 920px;
  margin: 24px auto;
  padding: 0 16px;
}

h1 { margin: 0 0 8px; }
h2 { margin: 0 0 10px; }
h3 { margin: 0 0 8px; }

.sub {
  margin: 0 0 16px;
  color: #444;
  line-height: 1.4;
}

.muted { color: #555; }
.small { font-size: 0.92rem; color: #444; }
.warn { font-weight: 700; color: #8a0b0b; }
.ok { font-weight: 700; color: #0b6b18; }

/* -----------------------------
   Cards & sections
------------------------------ */

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.hint {
  margin-top: 10px;
  color: #555;
  font-size: 0.95rem;
}

/* -----------------------------
   Forms & inputs
------------------------------ */

input[type="file"],
select {
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  font-size: 1rem;
}

select { background: #fff; }

/* -----------------------------
   Grid for questions
------------------------------ */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
}

/* -----------------------------
   Buttons
------------------------------ */

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.btn:hover { opacity: 0.92; }

.btn-secondary { background: #333; }

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

/* -----------------------------
   Status text
------------------------------ */

.status {
  margin: 8px 0;
  font-weight: 600;
}

/* -----------------------------
   Human readable results
------------------------------ */

.results-text {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 14px;
}

/* -----------------------------
   Urgency banners
------------------------------ */

.banner {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
  font-weight: 700;
  line-height: 1.4;
}

.banner-red {
  background: #ffe5e5;
  color: #8a0b0b;
  border: 1px solid #ffb3b3;
}

.banner-yellow {
  background: #fff6d8;
  color: #6b4a00;
  border: 1px solid #ffe3a3;
}

.banner-green {
  background: #e8ffe8;
  color: #0b6b18;
  border: 1px solid #b7f0be;
}

/* -----------------------------
   Better photo request box
------------------------------ */

.better-photo {
  margin-bottom: 12px;
  background: #fff6d8;
  border: 1px solid #ffe3a3;
  border-radius: 12px;
  padding: 12px;
}

.better-photo ul { margin: 6px 0 0 18px; }
.better-photo li { margin-bottom: 6px; }

/* -----------------------------
   Info buttons + modal popup
------------------------------ */

.q {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}

.info-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #111;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}

.info-btn:hover { opacity: 0.92; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modal {
  width: min(640px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.modal-title { font-weight: 800; }

.modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 6px 8px;
  border-radius: 8px;
}

.modal-close:hover { background: rgba(0,0,0,0.06); }

.modal-body {
  padding: 14px;
  line-height: 1.45;
  color: #222;
}

/* -----------------------------
   Accessibility tweaks
------------------------------ */

button:focus,
select:focus,
input:focus {
  outline: 2px solid #6b9cff;
  outline-offset: 2px;
}

/* -----------------------------
   Mobile image input improvements
------------------------------ */

.file-row { margin-bottom: 12px; }
.file-title { font-weight: 700; margin-bottom: 6px; }

/* Human-readable text report formatting */
.text-report {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}