/* IDP Onboarding - clean, professional, card-based UI. Light/dark aware. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e2e5ea;
  --text: #1c2128;
  --text-muted: #5b6472;
  --brand: #2952cc;
  --brand-hover: #1f3fa3;
  --success: #1c7a3e;
  --success-bg: #e8f5ec;
  --warn: #9a6300;
  --warn-bg: #fdf3dd;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --focus-ring: rgba(41, 82, 204, 0.35);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f26;
    --surface-2: #20232b;
    --border: #2c313c;
    --text: #e7e9ee;
    --text-muted: #9aa3b2;
    --brand: #6d8ef2;
    --brand-hover: #8ba4f5;
    --success: #4fce7f;
    --success-bg: #163a24;
    --warn: #e3b341;
    --warn-bg: #3a2f10;
    --danger: #f2837b;
    --danger-bg: #3a1c1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

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

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-sub {
  font-weight: 400;
  color: var(--text-muted);
}
.site-nav a {
  margin-left: 18px;
  font-weight: 500;
  color: var(--text-muted);
}
.site-nav a:hover { color: var(--brand); }

main.content {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

h1 { font-size: 1.5rem; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.page-subtitle { color: var(--text-muted); margin: 0 0 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card + .card { margin-top: 20px; }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.banner {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-weight: 500;
}
.banner-admin {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
}
.banner-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.banner-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 10px 0;
}
.progress-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 6px 0 0 6px;
  transition: width 0.3s ease;
}
.progress-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.task-list { list-style: none; margin: 0; padding: 0; }
.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: none; }
.task-info { display: flex; align-items: center; gap: 12px; }
.task-title { font-weight: 600; }
.task-desc { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-complete { background: var(--success-bg); color: var(--success); }
.badge-in_progress { background: var(--warn-bg); color: var(--warn); }
.badge-processing { background: var(--warn-bg); color: var(--warn); }
.badge-not_started { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-manual { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-consider { background: var(--danger-bg); color: var(--danger); }
.badge-suspended { background: var(--danger-bg); color: var(--danger); }
.badge-demo { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); font-size: 0.72rem; }

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; text-decoration: none; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn[disabled], .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; }
.hint { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="tel"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checkbox-field input { width: auto; margin-top: 3px; }
.checkbox-field label { font-weight: 500; margin-bottom: 0; }

.error-list {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.error-list ul { margin: 4px 0 0; padding-left: 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.02em; }
tr:last-child td { border-bottom: none; }

.doc-text p { margin: 0 0 14px; }
.doc-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.signed-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.kv-list { margin: 0; }
.kv-list dt { color: var(--text-muted); font-size: 0.82rem; margin-top: 10px; }
.kv-list dd { margin: 2px 0 0; font-weight: 500; }

/* Quest "donor pass" card - drug-screen task detail */
.donor-pass {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 4px;
}
.donor-pass-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.donor-pass-id { font-weight: 700; }
.donor-pass-sub { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }
.donor-pass-expires {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.donor-pass-expires-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn);
  font-weight: 600;
}
.donor-pass-instructions {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 0.92rem;
}

/* Print stylesheet for executed documents */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: none; }
  main.content { max-width: 100%; padding: 0; }
}
