:root {
  /* Theme matched to École Saint-Jean-de-la-Croix
     (teal #349db7 primary, magenta #e42382 accent, Nunito/Open Sans). */
  --bg: #f3f8fb;
  --card: #ffffff;
  --ink: #21323a;
  --muted: #66787f;
  --accent: #349db7;
  --accent-dark: #2c87a0;
  --accent-2: #e42382;
  --accent-ink: #ffffff;
  --accent-disabled: #a9d3dd;
  --ok: #15803d;
  --full: #b91c1c;
  --border: #e5e7eb;
  --radius: 14px;
  --font-head: "Nunito", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  font-family: var(--font-head);
}

.topbar {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--accent-ink);
  padding: calc(env(safe-area-inset-top) + 22px) 20px 22px;
  text-align: center;
}

.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 6px 0 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.info-panel[hidden] {
  display: none;
}

.info-panel {
  width: calc(100% - 32px);
  max-width: 608px;
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fdeaf3;
  border: 1px solid #f6c2dd;
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.info-panel p {
  margin: 0;
  font-size: 0.92rem;
  color: #8a1d5c;
}

.info-panel .info-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.content {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.status {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

.activity {
  margin-bottom: 24px;
}

.activity-head {
  margin-bottom: 10px;
}

.activity-head h2 {
  margin: 0 0 2px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.activity-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.slot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slot-time {
  font-weight: 600;
}

.slot-date {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
}

.seats {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.seats.ok {
  color: var(--ok);
  background: #dcfce7;
}

.seats.full {
  color: var(--full);
  background: #fee2e2;
}

.btn-primary,
.btn-ghost {
  font: inherit;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:disabled {
  background: var(--accent-disabled);
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.signup-btn {
  font: inherit;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.signup-btn:disabled {
  background: var(--accent-disabled);
  cursor: not-allowed;
}

.empty-vol {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Dialog */
dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(92vw, 420px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

#signup-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#signup-form h2 {
  margin: 0;
}

.dialog-slot {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

#signup-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

#signup-form input {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

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

.field-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.link-btn {
  align-self: flex-start;
  margin: -8px 0 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.form-error {
  margin: 0;
  color: var(--full);
  font-size: 0.85rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 10;
}

/* --- Admin panel --------------------------------------------------------- */

.admin-login {
  max-width: 360px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-login h2 {
  margin: 0;
}

.admin-login label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-login input {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

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

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--ink);
}

.admin-bar-actions {
  display: flex;
  gap: 8px;
}

.vol-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.vol-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.vol-list a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

.vol-nocontact {
  color: var(--muted);
}

/* Admin seat badges: staffing health (empty = red, partial = orange, full = green). */
.seats.seat-empty {
  color: var(--full);
  background: #fee2e2;
}

.seats.seat-partial {
  color: #b45309;
  background: #ffedd5;
}

.seats.seat-complete {
  color: var(--ok);
  background: #dcfce7;
}
