/* Theme matches the public home page: night sky behind everything (css/sky.css),
   light cards on top, plum / blue / green accents. Each page links sky.css after
   this file and has the <div class="sky"> element right after <body>. */
:root {
  --bg: #f7f6f2;
  --panel: #ffffff;
  --border: #d8ddd9;
  --text: #1e2a2e;
  --muted: #55656b;
  --accent: #5b3a7a;          /* plum */
  --accent-hover: #472c60;
  --accent-light: #ede6f3;
  --accent-2: #1f5f99;        /* sky blue */
  --accent-2-light: #e2edf7;
  --accent-3: #3f7d5c;        /* leaf green */
  --accent-3-light: #e3efe7;
  --ink: #1e2a2e;
  --focus: #0b6bcb;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --success: #12805a;
  --success-bg: #e3f8ee;
  --pending: #8a5a00;
  --pending-bg: #fff6d6;
  --field: #ffffff;           /* text boxes */
  --on-accent: #ffffff;       /* text on plum buttons */
  color-scheme: light;
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

/* Dark mode: same colors the home page uses for its boxes */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141a1c;
    --panel: #1c2427;
    --border: #313d41;
    --text: #eef1ef;
    --muted: #a9b5b9;
    --accent: #c7a8e3;
    --accent-hover: #d9c3ee;
    --accent-light: #2a2034;
    --accent-2: #8fbfe8;
    --accent-2-light: #1b2a38;
    --accent-3: #8fcaa9;
    --accent-3-light: #1f2f27;
    --ink: #eef1ef;
    --focus: #7ab8ff;
    --danger: #ff8a80;
    --danger-bg: #3a1f1f;
    --success: #7fd6a8;
    --success-bg: #1a3226;
    --pending: #e3b84a;
    --pending-bg: #3a2f12;
    --field: #141a1c;
    --on-accent: #141a1c;
  }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #070b1f; /* sky.css draws the full night sky */
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* The menu bar for every page lives in css/site-header.css and js/site-header.js. */

main.container {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 20px;
}

main.container.tight-top {
  margin-top: 8px;
}

.centered-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Boxes, matching the home page cards: colored top edge whose color fades
   down behind the heading. Add .medical (blue) or .fitness (green) for the
   other accent colors. */
.card,
section.info-block {
  --card-accent: var(--accent);
  --card-soft: var(--accent-light);
  border: 1px solid var(--border);
  border-top: 6px solid var(--card-accent);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  background: linear-gradient(to bottom,
      color-mix(in srgb, var(--card-accent) 30%, var(--panel)) 0,
      var(--card-soft) 2.5rem,
      var(--panel) 5.5rem) var(--panel);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.card.medical { --card-accent: var(--accent-2); --card-soft: var(--accent-2-light); }
.card.fitness { --card-accent: var(--accent-3); --card-soft: var(--accent-3-light); }

.card h1,
.card h2 {
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--ink);
}

.card p {
  line-height: 1.6;
}

.card.narrow {
  width: 100%;
  max-width: 380px;
}

h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

h2 {
  font-size: 1.3rem;
  margin: 0 0 12px;
}

.count-badge {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

p.subtitle {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 16px;
}

label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  margin-top: 16px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: var(--field);
  color: var(--text);
}

select {
  font: inherit;
  font-size: 15px;
  padding: 6px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
}

input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  background: #a9b4c4;
  cursor: not-allowed;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger);
  filter: brightness(0.9);
}

.danger-zone {
  border-color: var(--danger);
}

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

button.secondary:hover {
  background: var(--accent-light);
}

.actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
}

.message {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  display: none;
}

.message.error {
  display: block;
  background: var(--danger-bg);
  color: var(--danger);
}

.message.success {
  display: block;
  background: var(--success-bg);
  color: var(--success);
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dropzone-browse {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

.dropzone:hover {
  border-color: var(--accent);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.attachment-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attachment-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  font-size: 13px;
}

.attachment-list .file-size {
  color: var(--muted);
  margin-left: 8px;
}

.attachment-list .remove-file {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Group headings inside a table (Admins page: Active / Pending members) */
tr.group-row th {
  padding: 18px 8px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

tbody tr.group-row:first-child th {
  padding-top: 10px;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.active {
  background: var(--success-bg);
  color: var(--success);
}

.status-pill.pending {
  background: var(--pending-bg);
  color: var(--pending);
}

/* Inner boxes, matching the home page's resource tiles */
.subsection {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 20px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

fieldset.subsection {
  min-width: 0;
}

.subsection legend {
  float: left; /* keeps the title inside the box, like the h3 titles */
  width: 100%;
  padding: 0;
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.subsection legend + * {
  clear: both;
}

/* Pill-shaped radio choices (Profile > Appearance) */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.choice-row label.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px 8px 12px;
  border: 2px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.choice-row label.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.choice-row input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.subsection h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

/* Admins page: member list on the left, everything else on the right. */
main.container.admin-layout {
  max-width: 1280px;
  display: grid;
  /* right column ~32% of the width */
  grid-template-columns: minmax(0, 68fr) minmax(0, 32fr);
  gap: 20px;
  align-items: start;
}

.admin-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.admin-layout .invite-form {
  flex-wrap: wrap;
}

.admin-layout .invite-form > div {
  flex: 1 1 160px;
}

.table-scroll {
  overflow-x: auto;
}

@media (max-width: 760px) {
  main.container.admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.subsection .invite-form {
  margin-top: 12px;
}

.invite-form {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  align-items: flex-end;
}

.invite-form>div {
  flex: 1;
}

.invite-form label {
  margin-top: 0;
}

.invite-form select {
  width: 100%;
  max-width: 100%;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  background: var(--field);
  color: var(--text);
  resize: vertical;
}

textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.toggle-row label {
  margin: 0;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

a.button-link {
  display: inline-block;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

a.button-link:hover {
  background: var(--accent-hover);
}

.actions.open-buttons {
  flex-wrap: wrap;
}

a.button-link.disabled {
  background: #a9b4c4;
  cursor: not-allowed;
}

/* ---------- Public pages that use this stylesheet (About, Join) ----------
   The home page and treatment page carry their own styles inline. */

/* Page title sitting directly on the night sky */
.mini-hero {
  padding: 48px 20px 28px;
  text-align: center;
  color: var(--night-ink, #f1eefa);
}

.mini-hero .icon-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: #c7a8e3;
  color: #141a1c;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.mini-hero .icon-badge svg {
  width: 28px;
  height: 28px;
}

.mini-hero h1 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: clamp(26px, 5vw, 38px);
  margin: 0;
  color: inherit;
}

main.wide {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px;
}

main.wide.tight-top {
  padding-top: 8px;
}

section.info-block {
  margin-bottom: 28px;
}

section.info-block h2 {
  font-size: 1.6rem;
  margin: 0 0 14px;
  color: var(--ink);
}

section.info-block p {
  line-height: 1.6;
  color: var(--text);
}

.meeting-card {
  background: var(--accent-light);
  border-radius: 10px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.meeting-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.meeting-item div strong {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 4px;
}

.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--badge-bg, var(--accent));
  color: var(--on-accent);
  flex-shrink: 0;
}

.icon-badge svg {
  width: 19px;
  height: 19px;
}

.icon-badge.on-tint {
  background: var(--panel);
  color: var(--badge-fg, var(--accent));
}

footer.site-footer {
  text-align: center;
  padding: 28px 20px 40px;
  color: var(--night-muted, #c3bfdc);
  font-size: 14px;
  border-top: 1px solid var(--night-line, rgba(255, 255, 255, 0.14));
}

footer.site-footer a {
  color: var(--night-link, #b7dcf0);
}

/* ---------- Directory ---------- */

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.member-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-light);
  display: block;
}

.member-card .avatar {
  margin: 0 auto 12px;
}

.member-card .avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
}

.member-card h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.member-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0;
}

.member-card .bio {
  color: var(--text);
  margin-top: 8px;
  font-size: 13px;
}

.member-card .member-edit-btn {
  margin-top: 12px;
  font-size: 12px;
  padding: 6px 14px;
}

.member-card .invite-btn {
  margin-top: 12px;
  font-size: 12px;
  padding: 6px 12px;
}

/* ---------- Documents ---------- */

.document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.document-row:last-child {
  border-bottom: none;
}

.document-row .doc-name {
  font-weight: 600;
  font-size: 14px;
}

.document-row .doc-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.document-row .doc-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.upload-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

.upload-form input[type="file"] {
  flex: 1;
  min-width: 200px;
}
