/* ============================================================
   Family Doc — base styles
   Mobile-first (Android target), B&W-printer-friendly disclaimer,
   warm-dark palette with teal accent.
   ============================================================ */

:root {
  --bg: #0f1f1f;
  --bg-elevated: #1c4242;
  --paper: #f8f4ec;
  --paper-muted: #e8dfc9;
  --ink: #0f1f1f;
  --ink-muted: #4a5a5a;
  --accent: #0f766e;
  --accent-hover: #14b8a6;
  --severity-info: #6b7280;
  --severity-follow-up: #d97706;
  --severity-see-doctor: #dc2626;
  --severity-urgent: #991b1b;
  --radius: 10px;
  --max-width: 720px;
}

* { box-sizing: border-box; }

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

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

h1, h2, h3 {
  margin: 0.5em 0 0.25em;
  color: var(--bg);
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }

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

button, .btn {
  display: inline-block;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--paper-muted);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: white;
}
textarea { min-height: 120px; resize: vertical; }
label { display: block; margin-bottom: 6px; font-weight: 600; }
.field { margin-bottom: 14px; }

/* Severity badges for doc notes */
.severity {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
}
.severity-info { background: var(--severity-info); }
.severity-follow-up { background: var(--severity-follow-up); }
.severity-see-doctor { background: var(--severity-see-doctor); }
.severity-urgent { background: var(--severity-urgent); }

/* Medical disclaimer — required on every user-facing screen per §13 */
.medical-disclaimer {
  margin: 20px auto 0;
  max-width: var(--max-width);
  padding: 12px 16px;
  background: #fef3c7;
  border-top: 3px solid #d97706;
  font-size: 0.85rem;
  color: #451a03;
  text-align: center;
}

/* Cards / list items */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Header bar */
header {
  background: var(--bg);
  color: var(--paper);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header a { color: var(--paper); }
header .brand { font-weight: 700; }

footer {
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.8rem;
  padding: 20px 16px 32px;
}

/* ── Member grid (index.html dashboard) ── */
.member-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
@media (min-width: 500px) {
  .member-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.member-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-name  { font-weight: 700; font-size: 1rem; color: var(--bg); }
.member-role  { font-size: 0.78rem; color: var(--ink-muted); text-transform: capitalize; }

.member-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Small button variant */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Ghost button variant */
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover {
  background: var(--accent);
  color: white;
}

/* Header ghost button (sign out) */
.btn-header-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--paper);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-header-ghost:hover { background: rgba(255,255,255,0.15); }

/* Message / error banners */
.msg-banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.msg-error { background: #fee2e2; color: #7f1d1d; border-left: 3px solid #dc2626; }
.msg-warn  { background: #fef3c7; color: #78350f; border-left: 3px solid #f59e0b; }
.msg-info  { background: #ecfdf5; color: #064e3b; border-left: 3px solid #10b981; }
