:root {
  --navy: #f5ead2;
  --royal: #8db8ff;
  --gold: #d6ad63;
  --gold-soft: rgba(214, 173, 99, 0.2);
  --ink: #f7f1e7;
  --muted: #b9c3d3;
  --surface: rgba(13, 21, 32, 0.84);
  --surface-strong: rgba(20, 32, 48, 0.92);
  --line: rgba(246, 228, 183, 0.16);
  --success: #76d39f;
  --danger: #ff8b8f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(214, 173, 99, 0.22), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(80, 135, 214, 0.22), transparent 30%),
    linear-gradient(180deg, #07101d 0%, #0b1727 48%, #12100e 100%);
  font-family: Georgia, "Times New Roman", serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(10, 18, 29, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand-mark { display: flex; flex-direction: column; gap: 0.15rem; }
.brand-kicker, .eyebrow {
  font-family: "Segoe UI", Tahoma, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--royal);
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.site-nav a, .nav-button, .secondary-link { color: var(--navy); font-weight: 600; }
.site-nav a:hover, .nav-button:hover, .secondary-link:hover { color: var(--gold); }
.nav-button { border: 0; background: transparent; cursor: pointer; padding: 0; }
.nav-badge-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.6rem;
}
.nav-count-badge {
  position: absolute;
  top: -0.9rem;
  right: -0.85rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--danger);
  color: #180f0f;
  border: 2px solid rgba(10, 18, 29, 0.92);
  font-size: 0.72rem;
  line-height: 1.05rem;
  text-align: center;
  font-weight: 800;
}

.page-frame { display: grid; gap: 1.5rem; }

.hero-panel, .card-panel {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1.5rem;
  padding: 2rem;
}

.hero-dashboard {
  position: relative;
  overflow: hidden;
  min-height: 28rem;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(6, 13, 23, 0.94) 0%, rgba(6, 13, 23, 0.74) 42%, rgba(6, 13, 23, 0.42) 100%),
    url("../images/dark-ministry-hero.png") center / cover no-repeat;
}

.hero-dashboard .hero-copy,
.hero-dashboard .hero-stats {
  position: relative;
  z-index: 1;
}

.hero-dashboard .hero-copy {
  max-width: 42rem;
}

.hero-signin { min-height: 72vh; align-items: center; }

.hero-copy h1, .page-card h1 {
  margin: 0.2rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.95;
  color: var(--navy);
}

.lede, .muted-copy, .content-list p, .member-card p, .meta-copy {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--muted);
  line-height: 1.6;
}

.feature-list {
  margin: 1.4rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.65rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card, .signin-card, .member-card {
  padding: 1.25rem;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid rgba(214, 173, 99, 0.32);
}

.stat-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.5rem;
  color: var(--navy);
}

.stat-label {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-panel { padding: 1.5rem; }
.card-header-block h2, .page-card h1 { margin: 0.2rem 0 0.5rem; color: var(--navy); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.wide-card { grid-column: 1 / -1; }
.content-list, .member-grid { display: grid; gap: 0.9rem; }

.list-row, .member-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.list-row h3, .member-card h3 { margin: 0 0 0.3rem; color: var(--ink); }

.pill-tag {
  display: inline-flex;
  align-items: center;
  height: fit-content;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(214, 173, 99, 0.28), rgba(141, 184, 255, 0.16));
  color: #f5d38d;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}
.danger-pill {
  background: rgba(255, 139, 143, 0.14);
  color: var(--danger);
}

.stack-form { display: grid; gap: 0.75rem; }
.stack-form label {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
  color: var(--navy);
}

.stack-form input, .stack-form textarea, .stack-form select, .inline-role-form select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(6, 13, 23, 0.72);
  color: var(--ink);
}

.stack-form input::placeholder, .stack-form textarea::placeholder { color: rgba(185, 195, 211, 0.72); }

.stack-form textarea {
  resize: vertical;
  min-height: 120px;
}

.primary-button, .mini-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
}

.primary-button, .mini-button {
  background: linear-gradient(135deg, #d6ad63, #8f6424);
  color: #100b07;
}

.primary-button { padding: 0.95rem 1.2rem; margin-top: 0.4rem; }
.mini-button { padding: 0.75rem 1rem; }
.action-link { display: inline-flex; align-items: center; justify-content: center; }
.ghost-button, .ghost-link {
  padding: 0.7rem 1rem;
  background: rgba(246, 228, 183, 0.08);
  color: var(--navy);
  border: 1px solid var(--line);
}
.signin-actions {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}
.signup-form {
  margin: 0;
}
.signin-signup-button {
  justify-content: center;
  width: 100%;
  padding: 0.95rem 1.2rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 800;
  font-size: 1rem;
}

.field-error {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--danger);
  font-size: 0.9rem;
}

.alert-card {
  margin: 0.8rem 0 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 600;
}

.error-alert { background: rgba(255, 139, 143, 0.12); color: var(--danger); }
.success-alert { background: rgba(118, 211, 159, 0.12); color: var(--success); }

.page-card { display: grid; gap: 1rem; }
.table-shell { overflow-x: auto; }

.member-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.member-table th, .member-table td {
  padding: 0.95rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.member-table th {
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.member-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.member-profile-card {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(20, 32, 48, 0.76);
  border: 1px solid var(--line);
}
.member-profile-card h2 { margin: 0; color: var(--navy); }
.member-profile-photo,
.member-profile-photo-placeholder {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
}
.member-profile-photo { object-fit: cover; }
.member-profile-photo-placeholder {
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: var(--navy);
  font-size: 1.8rem;
  font-weight: 800;
}

.inline-role-form { display: flex; gap: 0.65rem; align-items: center; }
.member-access-actions { display: grid; gap: 0.65rem; min-width: 15rem; }
.member-access-actions .inline-role-form { align-items: stretch; }
.member-access-actions input[type="datetime-local"] {
  min-width: 11rem;
  padding: 0.72rem 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.secondary-link { display: inline-block; margin-top: 1rem; }
.form-card { background: rgba(20, 32, 48, 0.68); padding: 1rem; border-radius: 24px; }
.row-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rich-row { padding: 1rem; border-radius: 24px; background: rgba(20, 32, 48, 0.72); border: 1px solid var(--line); }
.button-row { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.ghost-link { display: inline-flex; align-items: center; border-radius: 999px; }
.events-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.5rem;
}
.calendar-shell {
  padding: 1.1rem;
  border-radius: 28px;
  background: rgba(20, 32, 48, 0.74);
  border: 1px solid var(--line);
}
.calendar-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.calendar-header h2 {
  margin: 0;
  text-align: center;
  color: var(--navy);
}
.calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: rgba(6, 13, 23, 0.82);
  border: 1px solid var(--line);
  font-size: 1.5rem;
}
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}
.calendar-weekdays {
  margin-bottom: 0.55rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}
.calendar-day {
  min-height: 4.5rem;
  padding: 0.7rem 0.35rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(6, 13, 23, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.calendar-day:hover {
  background: rgba(141, 184, 255, 0.12);
  border-color: rgba(141, 184, 255, 0.55);
  transform: translateY(-1px);
}
.calendar-day-outside {
  background: rgba(6, 13, 23, 0.42);
  color: rgba(247, 241, 231, 0.72);
}
.calendar-day-selected {
  background: rgba(141, 184, 255, 0.18);
  border-color: #8db8ff;
  box-shadow: inset 0 0 0 1px rgba(74, 108, 247, 0.16);
}
.calendar-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #4a6cf7;
}
.selected-events-panel {
  display: grid;
  gap: 1rem;
  align-self: start;
}
.profile-photo-card {
  display: flex;
  justify-content: center;
}
.profile-photo-preview,
.profile-photo-placeholder {
  width: 9rem;
  height: 9rem;
  border-radius: 32px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(6, 13, 23, 0.72);
}
.profile-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--muted);
}
.auth-page-card {
  max-width: 42rem;
  margin: 0 auto;
}
.active-filter {
  background: var(--gold);
  color: #100b07;
}
.two-column-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.checkbox-row { display: flex; gap: 0.65rem; align-items: center; }
.checkbox-row input { width: auto; }
.inset-card { background: rgba(20, 32, 48, 0.72); }
.button-row form { margin: 0; }
.prayer-card { border-width: 1px; border-style: solid; }
.prayer-card-prayed {
  background: linear-gradient(180deg, rgba(39, 94, 65, 0.86), rgba(20, 32, 48, 0.9));
  border-color: rgba(118, 211, 159, 0.28);
}
.prayer-card-unprayed {
  background: linear-gradient(180deg, rgba(112, 78, 26, 0.76), rgba(20, 32, 48, 0.9));
  border-color: rgba(214, 173, 99, 0.3);
}
.prayer-card-urgent {
  background: linear-gradient(180deg, rgba(104, 39, 43, 0.82), rgba(20, 32, 48, 0.9));
  border-color: rgba(255, 139, 143, 0.42);
  box-shadow: 0 18px 42px rgba(255, 139, 143, 0.12);
}
.prayer-card-featured {
  background: linear-gradient(180deg, rgba(31, 72, 126, 0.82), rgba(20, 32, 48, 0.9));
  border-color: rgba(141, 184, 255, 0.36);
  box-shadow: 0 18px 42px rgba(141, 184, 255, 0.1);
}
.priority-copy {
  margin: 0.35rem 0 0;
  color: var(--navy) !important;
  font-weight: 800;
}
.prayer-state-pill {
  display: inline-flex;
  margin-bottom: 0.6rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}
.prayer-state-pill-prayed {
  background: rgba(118, 211, 159, 0.12);
  color: #76d39f;
}
.prayer-state-pill-unprayed {
  background: rgba(214, 173, 99, 0.12);
  color: #f5d38d;
}
.prayer-state-pill-urgent {
  background: rgba(255, 139, 143, 0.14);
  color: #ffb1b4;
}
.prayer-state-pill-featured {
  background: rgba(141, 184, 255, 0.12);
  color: #8db8ff;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
code {
  padding: 0.18rem 0.42rem;
  border-radius: 8px;
  background: rgba(246, 228, 183, 0.1);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

@media (max-width: 900px) {
  .hero-panel, .dashboard-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .site-header, .list-row, .member-card, .inline-role-form, .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .events-layout { grid-template-columns: 1fr; }
  .two-column-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-shell { width: min(100% - 1rem, 1180px); }
  .hero-panel, .card-panel { border-radius: 24px; padding: 1.2rem; }
  .hero-stats { grid-template-columns: 1fr; }
}
