/* ── External Response Page Stylesheet ────────────────────── */
/* Standalone, mobile-first design for unauthenticated external  */
/* respondents clicking signed invitation links.                 */

:root {
  --ext-bg: #f8fafc;
  --ext-panel: #ffffff;
  --ext-ink: #0f172a;
  --ext-muted: #64748b;
  --ext-line: #e2e8f0;
  --ext-brand-primary: #2563eb;
  --ext-success: #16a34a;
  --ext-danger: #dc2626;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ext-bg);
  color: var(--ext-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ext-body { min-height: 100vh; display: flex; flex-direction: column; }

.ext-header {
  background: var(--ext-panel);
  border-bottom: 1px solid var(--ext-line);
  padding: 16px 20px;
}
.ext-header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ext-brand-logo { max-height: 40px; max-width: 200px; }
.ext-brand-name { font-size: 18px; font-weight: 600; color: var(--ext-ink); }

.ext-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.ext-card {
  background: var(--ext-panel);
  border: 1px solid var(--ext-line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 28px 28px 32px;
}

.ext-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ext-ink);
}
.ext-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
}
.ext-card p { margin: 0 0 14px; color: var(--ext-ink); }
.ext-card .ext-meta { color: var(--ext-muted); font-size: 14px; }

.ext-fineprint {
  margin: 24px 4px 0;
  text-align: center;
  font-size: 12px;
  color: var(--ext-muted);
}

.ext-flash {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.ext-flash--notice { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.ext-flash--alert  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.ext-form-group { margin-bottom: 18px; }
.ext-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ext-ink);
}
.ext-form-group .ext-help {
  display: block;
  margin-top: 4px;
  color: var(--ext-muted);
  font-size: 13px;
}
.ext-input,
.ext-textarea,
.ext-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ext-line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: var(--ext-ink);
  font-family: inherit;
}
.ext-textarea { min-height: 110px; resize: vertical; }
.ext-input:focus, .ext-textarea:focus, .ext-select:focus {
  outline: none;
  border-color: var(--ext-brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ext-radio-list, .ext-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ext-radio, .ext-checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
  color: var(--ext-ink);
}

.ext-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.ext-btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background-color 0.12s, opacity 0.12s;
}
.ext-btn--primary {
  background: var(--ext-brand-primary);
  color: #fff;
}
.ext-btn--primary:hover { opacity: 0.92; }
.ext-btn--secondary {
  background: #fff;
  color: var(--ext-ink);
  border: 1px solid var(--ext-line);
}
.ext-btn--secondary:hover { background: #f1f5f9; }
.ext-btn--danger {
  background: #fff;
  color: var(--ext-danger);
  border: 1px solid #fca5a5;
}

.ext-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--ext-line);
}
.ext-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.ext-divider {
  border: 0;
  border-top: 1px solid var(--ext-line);
  margin: 20px 0;
}

.ext-callout {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ext-muted);
  margin-bottom: 18px;
}

.ext-success-icon {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--ext-success);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.ext-content {
  font-size: 15px;
  color: var(--ext-ink);
}
.ext-content p:last-child { margin-bottom: 0; }
.ext-content ul, .ext-content ol { margin: 8px 0 14px 22px; }

/* ── Forms runtime ─────────────────────────────────────────── */
/* Shared by /f/:slug (authenticated) and /r/f/:token (public). */
/* Sits inside an .ext-card, on top of an .ext-form-runtime form. */

.ext-form-runtime-header { margin-bottom: 20px; }
.ext-form-runtime-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ext-ink);
}
.ext-form-runtime-header .ext-meta {
  margin: 0;
  color: var(--ext-muted);
  font-size: 14px;
}

.ext-form-runtime { display: block; }
.ext-form-runtime > .ext-section + .ext-section { margin-top: 24px; }

.ext-display {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 14px;
}
.ext-display dt {
  margin: 0;
  color: var(--ext-muted);
  font-weight: 500;
}
.ext-display dd {
  margin: 0;
  color: var(--ext-ink);
  word-break: break-word;
}

.ext-columns { margin-bottom: 18px; }
.ext-columns .ext-col > .ext-form-group:last-child { margin-bottom: 0; }

@media (max-width: 480px) {
  .ext-card { padding: 22px 18px 24px; border-radius: 8px; }
  .ext-main { padding: 16px 12px 40px; }
  .ext-actions .ext-btn { width: 100%; }
}
