/* Deliberately mirrors the field app's step/progress/big-choice patterns
   (tripura_distribution_tracker/frontend/styles.css) and the dashboard's
   brand tokens (dashboard/styles.css), rather than inventing a third look. */

:root {
  --brand: #5B3A29;
  --brand-dark: #402919;
  --bg: #F5E9DC;
  --card-bg: #ffffff;
  --text: #2c2c2a;
  --muted: #6B6B6B;
  --border: #D8C9B8;
  --good: #2E7D32;
  --bad: #C62828;
  --warn: #E58A00;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-dark: #E3B983;
    --bg: #211c17;
    --card-bg: #2b241d;
    --text: #eee8de;
    --muted: #a89f8f;
    --border: #453b30;
  }
}
:root[data-theme="dark"] {
  --brand-dark: #E3B983;
  --bg: #211c17;
  --card-bg: #2b241d;
  --text: #eee8de;
  --muted: #a89f8f;
  --border: #453b30;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
.hidden { display: none !important; }

.app-header {
  background: var(--brand);
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header h1 { font-size: 19px; margin: 0; }

main { padding: 16px; max-width: 560px; margin: 0 auto; padding-bottom: 110px; }

.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(--brand); }
.progress .dot.done { background: var(--good); }

.step { display: none; }
.step.active { display: block; }
.step h2 { font-size: 21px; margin: 0 0 14px; color: var(--brand-dark); }
.step .hint { font-size: 14px; color: var(--muted); margin: -6px 0 16px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: bold; margin-bottom: 6px; font-size: 15px; }
.field .req { color: var(--bad); }
.field .optional { font-weight: normal; color: var(--muted); }

input[type="text"], select, textarea {
  width: 100%;
  padding: 13px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}
textarea { resize: vertical; }

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: bold;
  color: var(--text);
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}
.pill.selected { background: var(--brand); border-color: var(--brand); color: #fff; }

.field-error { color: var(--bad); font-size: 14px; font-weight: bold; margin-top: 8px; }

/* Per-question blocks -- one per segment question: the text, a Yes/Somewhat/No
   big-choice (same visual weight as the field app's own health-check
   Yes/No/NA buttons), and an elaboration box that only appears once the
   answer isn't a plain Yes. */
.question-block { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.question-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.question-text { font-weight: bold; font-size: 15.5px; margin-bottom: 10px; }

.big-choice { display: flex; gap: 10px; }
.big-choice button {
  flex: 1;
  padding: 14px 6px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-weight: bold;
  font-size: 15px;
}
.big-choice button.selected.yes { background: var(--good); border-color: var(--good); color: #fff; }
.big-choice button.selected.somewhat { background: var(--warn); border-color: var(--warn); color: #fff; }
.big-choice button.selected.no { background: var(--bad); border-color: var(--bad); color: #fff; }

.question-comment {
  margin-top: 10px;
  display: none;
}
.question-comment.shown { display: block; }
.question-comment textarea { font-size: 14.5px; padding: 10px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 22px;
}
.thank-you { text-align: center; padding: 40px 22px; }
.thank-you-mark {
  width: 48px; height: 48px; line-height: 48px; border-radius: 50%;
  background: var(--good); color: #fff; font-size: 22px; font-weight: 700;
  margin: 0 auto 16px;
}
.thank-you h2 { font-size: 20px; margin: 0 0 8px; color: var(--brand-dark); }
.thank-you p { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.link-btn {
  background: none; border: none; color: var(--brand-dark);
  font-weight: bold; text-decoration: underline; cursor: pointer; padding: 6px;
}

.submit-error {
  font-size: 14px;
  color: var(--bad);
  font-weight: bold;
  margin-top: 10px;
}

.state-message { text-align: center; padding: 24px 16px; color: var(--muted); font-size: 14px; }
.state-message.error { color: var(--bad); }

.nav-buttons {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  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: 17px;
  font-family: inherit;
}
.btn-back { background: var(--border); color: #333; }
.btn-next { background: var(--brand); color: #fff; }
.btn-submit { background: var(--good); color: #fff; }
.nav-buttons button:disabled { opacity: 0.6; }
