/* SPEG Interviews: palette borrowed from groundworkgathering.com */

:root {
  --primary:        #2B6CB0;
  --primary-dark:   #1F558E;
  --primary-light:  #3182CE;
  --accent:         #BE7521;
  --text:           #1A202C;
  --text-muted:     #4A5568;
  --text-faint:     #718096;
  --bg:             #ffffff;
  --bg-soft:        #F7FAFC;
  --bg-soft-2:      #EDF2F7;
  --border:         #CBD5E0;
  --border-soft:    #E2E8F0;
  --green:          #38A169;
  --green-soft:     #C6F6D5;
  --blue-soft:      #BEE3F8;
  --gray-soft:      #E2E8F0;
  --yellow:         #D69E2E;
  --yellow-soft:    #FEFCBF;
  --red:            #C53030;
  --red-soft:       #FED7D7;
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.08);
  --radius:         6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Domine', Georgia, serif; color: var(--text); margin: 0 0 0.6em; line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.8em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  font: inherit;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}
button:hover, .btn:hover { background: var(--primary-dark); }
button:disabled { background: var(--text-faint); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-soft-2); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #9B2C2C; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.875rem; }

input[type=text], input[type=email], input[type=url], select, textarea {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  width: 100%;
  max-width: 360px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: -1px;
  border-color: var(--primary-light);
}
label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-muted); font-size: 0.95rem; }

.container { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; }
.container-narrow { max-width: 540px; }
.container-wide { max-width: none; }

header.app {
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 20px;
}
header.app .row { max-width: 980px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
header.app .brand { font-family: 'Domine', Georgia, serif; font-size: 1.15rem; color: var(--text); }
header.app .who { color: var(--text-muted); font-size: 0.9rem; }
header.app .who button { background: transparent; color: var(--text-muted); border: none; padding: 0 0 0 8px; font-size: 0.9rem; }
header.app .who button:hover { color: var(--primary); text-decoration: underline; background: transparent; }

.card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.banner {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.banner-warn { background: var(--yellow-soft); border: 1px solid #FAF089; color: #744210; }
.banner-info { background: #EBF8FF; border: 1px solid var(--blue-soft); color: #2C5282; }
.banner-error { background: var(--red-soft); border: 1px solid #FEB2B2; color: #742A2A; }
.banner-success { background: var(--green-soft); border: 1px solid #9AE6B4; color: #22543D; }
.banner-actions { margin-left: auto; display: flex; gap: 8px; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 0.875rem; }

.msg { padding: 10px 14px; border-radius: var(--radius); margin-top: 14px; font-size: 0.95rem; }
.msg:empty { display: none; }
.msg-info    { background: #EBF8FF; border: 1px solid var(--blue-soft); color: #2C5282; }
.msg-success { background: var(--green-soft); border: 1px solid #9AE6B4; color: #22543D; }
.msg-error   { background: var(--red-soft); border: 1px solid #FEB2B2; color: #742A2A; }
.center { text-align: center; }
.row-flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-soft-2);
  color: var(--text-muted);
}
.tag-yellow { background: var(--yellow-soft); color: #744210; }
.tag-red    { background: var(--red-soft);    color: #742A2A; }
.tag-green  { background: var(--green-soft);  color: #22543D; }

/* Slot grid (used on /elder and /book) */
.grid-wrap { overflow-x: auto; padding-bottom: 8px; }
.slot-grid {
  display: grid;
  grid-template-columns: 70px repeat(14, minmax(72px, 1fr));
  font-size: 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  min-width: 1100px;
}
.slot-grid .col-head, .slot-grid .row-head {
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 6px 4px;
  text-align: center;
  font-weight: 600;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  z-index: 1;
}
.slot-grid .col-head { top: 0; }
.slot-grid .row-head { left: 0; background: var(--bg-soft); font-size: 0.75rem; }
.slot-grid .corner { background: var(--bg-soft); border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; left: 0; z-index: 2; }
.slot-grid .cell {
  padding: 4px 2px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
  cursor: pointer;
  user-select: none;
  min-height: 28px;
  background: #fff;
  color: var(--text-faint);
  font-size: 0.7rem;
  transition: background 0.1s ease;
}
.slot-grid .cell:hover { background: var(--bg-soft-2); }
.slot-grid .cell.empty { cursor: default; color: transparent; }
.slot-grid .cell.empty:hover { background: #fff; }
.slot-grid .cell.open    { background: var(--green-soft); color: #22543D; font-weight: 600; }
.slot-grid .cell.booked  { background: var(--blue-soft);  color: #2C5282; font-weight: 600; cursor: default; }
.slot-grid .cell.blocked { background: var(--gray-soft);  color: var(--text-faint); cursor: default; }
.slot-grid .cell.available { background: var(--green-soft); color: #22543D; font-weight: 600; }
.slot-grid .cell.unavailable { background: #fff; color: transparent; cursor: default; }
.slot-grid .cell.unavailable:hover { background: #fff; }

.legend { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.legend .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 4px; border: 1px solid var(--border-soft); }
.legend .sw-open    { background: var(--green-soft); }
.legend .sw-booked  { background: var(--blue-soft); }
.legend .sw-blocked { background: var(--gray-soft); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26,32,44,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-md);
}
.modal h2 { margin-top: 0; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer.app {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
  padding: 30px 20px 50px;
}
