:root {
  --bg: #faf9f6;
  --ink: #1f2a28;
  --muted: #6b756f;
  --line: #e6e3db;
  --accent: #1f6f5c;
  --accent-dark: #17564a;
  --accent-soft: #eaf2ef;
  --req: #b23b3b;
  --field: #ffffff;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* slim progress bar (only chrome) */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: transparent; z-index: 50; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

/* layout */
.wrap { max-width: 620px; margin: 0 auto; padding: 40px 20px 120px; }
.head { margin-bottom: 8px; }
.head h1 { font-size: 1.2rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.nophi { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }

/* sections */
.section { margin-top: 44px; }
.section:first-of-type { margin-top: 28px; }
.section-title {
  font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

/* question */
.q { margin-bottom: 34px; }
.tag {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; margin-bottom: 7px;
}
.tag.req { color: var(--req); }
.tag.req::before { content: "•"; margin-right: 4px; }
.tag.opt { color: var(--muted); font-weight: 600; opacity: .7; }
.q-text { display: block; font-size: 1.06rem; font-weight: 500; margin: 0 0 5px; line-height: 1.4; }
.q-help { font-size: .85rem; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }

/* inputs */
.q-field textarea, .q-field input[type=text], .q-field input[type=number] {
  width: 100%; font-family: var(--font); font-size: 16px; padding: 14px 16px; min-height: 50px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--ink);
}
.q-field textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.q-field textarea:focus, .q-field input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; gap: 12px; align-items: center; min-height: 50px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  font-size: 1rem; background: var(--field); transition: border-color .12s, background .12s;
}
.opt:hover { border-color: #cfd6d2; }
.opt.checked { border-color: var(--accent); background: var(--accent-soft); }
.opt input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin: 0; }
.other-row { margin-top: 10px; }
.other-row input { width: 100%; font-size: 16px; padding: 13px 16px; min-height: 50px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.other-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* buttons (secure section) */
.btn {
  appearance: none; border: none; cursor: pointer; font-family: var(--font);
  font-size: .95rem; font-weight: 600; border-radius: var(--radius); padding: 12px 18px;
  min-height: 46px; background: var(--accent); color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--accent-soft); color: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.small { font-size: .9rem; }

/* secure control */
.q.secure .q-text::after { content: " 🔒"; }
.sec-modes { display: flex; flex-direction: column; gap: 10px; }
.sec-field { display: none; gap: 10px; margin-top: 10px; }
.sec-field.show { display: flex; flex-direction: column; }
.sec-field input { flex: 1; font-size: 16px; padding: 13px 16px; min-height: 50px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.sec-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sec-status { font-size: .85rem; color: var(--accent-dark); margin-top: 10px; display: none; }
.sec-status.show { display: block; }

/* save toast */
.savebar {
  position: fixed; bottom: 16px; right: 16px; z-index: 60;
  font-size: .82rem; font-weight: 600; padding: 8px 14px; border-radius: 99px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  box-shadow: 0 4px 14px rgba(31,42,40,.1);
}
.savebar.saving { color: var(--muted); }
.savebar.saved { color: var(--accent); }

/* desktop: a touch more air */
@media (min-width: 720px) {
  .wrap { padding-top: 56px; }
  .sec-modes { flex-direction: row; flex-wrap: wrap; }
  .sec-field.show { flex-direction: row; }
  .sec-field .btn { flex: none; }
}
