/* Begin questionnaire prototype — clean, simple, mobile-first. */
:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f9fafb;
  --card: #ffffff;
  --accent: #1d4ed8;
  --accent-dark: #1e40af;
  --danger: #b91c1c;
  --warn-bg: #fffbeb;
  --warn-line: #f59e0b;
  --ok-bg: #ecfdf5;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* Header / progress */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.site-header .inner {
  max-width: 680px;
  margin: 0 auto;
}
.brand {
  font-weight: 700;
  font-size: 18px;
}
.progress-label {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.progress-track {
  margin-top: 6px;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.25s ease;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 20px;
}
.card h1, .card h2 { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 21px; }
.lede { color: var(--muted); }

/* Forms */
.field { margin: 16px 0; }
.field label, .field legend {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint {
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
input[type="text"], input[type="email"], input[type="date"], input[type="tel"], select {
  width: 100%;
  padding: 11px 12px;
  font-size: 17px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
@media (max-width: 520px) { .row { flex-direction: column; gap: 0; } }

.error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 4px;
  display: none;
}
.error.show { display: block; }

/* Radios & checkboxes */
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  cursor: pointer;
  background: #fff;
}
.choice:hover { border-color: var(--accent); }
.choice input { margin-top: 4px; flex-shrink: 0; width: 18px; height: 18px; }
.choice .choice-body { flex: 1; }
.choice .choice-note { font-size: 14px; color: var(--muted); }
.choice.grant-all {
  background: #eff6ff;
  border-color: #bfdbfe;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-link {
  background: none; border: none; color: var(--accent);
  font-size: 15px; cursor: pointer; padding: 4px 0; text-decoration: underline;
}
.btn-row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 140px; }

/* Lists / review tables */
.person-list { list-style: none; padding: 0; margin: 12px 0; }
.person-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  background: #fff;
}
.person-list .p-name { font-weight: 700; }
.person-list .p-meta { font-size: 14px; color: var(--muted); }
.person-list .p-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.order-badge {
  display: inline-block;
  background: #eff6ff; color: var(--accent-dark);
  font-size: 13px; font-weight: 700;
  border-radius: 12px; padding: 1px 10px; margin-right: 8px;
}
.mini-btn {
  font-size: 14px; padding: 5px 12px; border-radius: 6px;
  border: 1px solid #cbd5e1; background: #fff; cursor: pointer;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Advisories / callouts */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
  background: #f8fafc;
}
.callout.warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.callout .callout-title { font-weight: 700; margin-bottom: 4px; }
.caution { color: #92400e; font-size: 15px; }

/* Review sections */
.review-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0;
  background: #fff;
}
.review-section h3 { margin: 0 0 8px; font-size: 17px; }
.review-section .edit-link { float: right; font-size: 14px; }
.review-kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 15px; }
.review-kv dt { color: var(--muted); }
.review-kv dd { margin: 0; }
@media (max-width: 520px) { .review-kv { grid-template-columns: 1fr; } .review-kv dt { margin-top: 8px; } }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 18px 16px 28px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.site-footer a { color: var(--accent); }
.site-footer .footer-actions { margin-bottom: 10px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  background: #111827; color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
}
.toast.show { opacity: 1; }

/* Misc */
.resume-link-box {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  padding: 12px;
  word-break: break-all;
  font-family: ui-monospace, monospace;
  font-size: 14px;
  margin: 12px 0;
}
.doc-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin: 8px 0; background: #fff;
}
.doc-row .doc-name { font-weight: 600; }
.doc-row .doc-file { font-size: 13px; color: var(--muted); font-family: ui-monospace, monospace; }
.mock-tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  background: #fef3c7; color: #92400e; border-radius: 4px;
  padding: 1px 8px; margin-left: 8px; vertical-align: middle;
}
.browsewrap {
  font-size: 14px; color: var(--muted); margin-top: 16px;
}
.browsewrap a { color: var(--accent); }
.hidden { display: none !important; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 6px 0 6px 28px; position: relative; }
.checklist li::before { content: "☐"; position: absolute; left: 0; }
ul.plain { padding-left: 20px; }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 3px solid #bfdbfe; border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: -4px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Production additions: header save button + readonly link input. */
.site-header .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.site-header .brand { margin-right: auto; }
.progress-label, .progress-track { flex-basis: 100%; }
.link-input {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  word-break: break-all;
}
