:root {
  --zyrp-blue: #258bcd;
  --zyrp-blue-mid: #185d8d; /* halfway between --zyrp-blue and --zyrp-blue-dark, used for the navbar on public pages */
  --zyrp-blue-dark: #0b2e4d;
  --zyrp-blue-light: #eaf4fb;
  --zyrp-white: #ffffff;
  --zyrp-text: #1c2b3a;
  --zyrp-text-muted: #5b7285;
  --zyrp-border: #d8e6f0;
  --zyrp-success: #2e9e5b;
  --zyrp-success-bg: #e7f6ec;
  --zyrp-danger: #c0392b;
  --zyrp-danger-bg: #fbeae8;
  --zyrp-radius: 10px;
  --zyrp-shadow: 0 2px 16px rgba(11, 46, 77, 0.08);
  --zyrp-max-width: 1140px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Reserve the scrollbar gutter on every page so short pages (e.g. Login) don't
     shift centered content a few pixels relative to longer pages that actually scroll. */
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  color: var(--zyrp-text);
  background: var(--zyrp-white);
  line-height: 1.55;
}

/* Pushes the footer to the bottom of the viewport on short pages (e.g. Login, Contact)
   instead of leaving it stranded mid-page with white space below it. */
main { flex: 1 0 auto; }

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { color: var(--zyrp-blue-dark); font-weight: 700; margin: 0 0 0.5em; line-height: 1.25; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--zyrp-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--zyrp-white);
  border-bottom: 1px solid var(--zyrp-border);
}

.navbar-inner {
  max-width: var(--zyrp-max-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; }
.brand-name { font-weight: 700; color: var(--zyrp-blue-dark); font-size: 1.05rem; }
.brand-name small { display: block; font-weight: 400; color: var(--zyrp-text-muted); font-size: 0.7rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a, .nav-links button.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--zyrp-text);
  font-weight: 600;
  font-size: 0.92rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-links a:hover, .nav-links button.nav-link:hover { background: var(--zyrp-blue-light); text-decoration: none; }
.nav-links a.active { background: var(--zyrp-blue); color: #fff; }

.lang-toggle {
  border: 1px solid var(--zyrp-border);
  background: var(--zyrp-white);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--zyrp-blue-dark);
}

/* Colored navbar on public pages only — Home, Member Area, and Admin (which have their own navy
   .dash-header/hero right below the navbar) keep the plain white navbar. Everything else (Events,
   About, Contact, Login, Signup, etc.) gets this so the navbar isn't a bare white bar with
   nothing else on the page to anchor it visually. */
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) #navbar-root {
  background: var(--zyrp-blue-mid);
}
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .brand-name { color: #fff; }
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .brand-name small { color: rgba(255, 255, 255, 0.7); }
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .nav-links a,
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .nav-links button.nav-link {
  color: #fff;
}
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .nav-links a:hover,
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .nav-links button.nav-link:hover {
  background: rgba(255, 255, 255, 0.14);
}
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .nav-links a.active {
  background: #fff;
  color: var(--zyrp-blue-dark);
}
body:not([data-page="home"]):not([data-page="member"]):not([data-page="admin"]) .lang-toggle {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.lang-toggle:hover { background: var(--zyrp-blue-light); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit; /* <button>/<input> get a browser-default font otherwise, unlike other elements */
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--zyrp-blue); color: #fff; }
.btn-primary:hover { background: #1f78b3; }

.btn-outline { background: transparent; color: var(--zyrp-white); border-color: var(--zyrp-white); }
.btn-outline:hover { background: rgba(255,255,255,0.12); }

.btn-outline-blue { background: transparent; color: var(--zyrp-blue); border-color: var(--zyrp-blue); }
.btn-outline-blue:hover { background: var(--zyrp-blue-light); }

.btn-danger { background: var(--zyrp-danger); color: #fff; }
.btn-danger:hover { background: #a53024; }

.btn-quiet { background: transparent; color: var(--zyrp-text-muted); border-color: var(--zyrp-border); font-weight: 600; }
.btn-quiet:hover { color: var(--zyrp-danger); border-color: var(--zyrp-danger); background: var(--zyrp-danger-bg); }

/* A permanently light/desaturated red pill (vs. .btn-quiet, which only turns red on hover) — for
   destructive actions that should read as "delete" at a glance, without the boldness of .btn-danger. */
.btn-danger-subtle { background: var(--zyrp-danger-bg); color: var(--zyrp-danger); border-color: var(--zyrp-danger-bg); font-weight: 600; }
.btn-danger-subtle:hover { background: #f3d3cf; border-color: #f3d3cf; }

.btn-small { padding: 6px 14px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--zyrp-text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--zyrp-blue-light); color: var(--zyrp-blue); }
.icon-btn-danger:hover { background: var(--zyrp-danger-bg); color: var(--zyrp-danger); }
.icon-btn-row { display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: linear-gradient(160deg, var(--zyrp-blue-dark), var(--zyrp-blue) 130%);
  color: #fff;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--zyrp-max-width);
  margin: 0 auto;
  padding: 64px 24px 130px;
  position: relative;
  z-index: 2;
}
.hero-mark {
  width: min(340px, 62vw);
  height: auto;
  margin-bottom: 28px;
}
.hero h1 { color: #fff; max-width: 720px; }
.hero p.lead { color: rgba(255,255,255,0.88); max-width: 600px; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.skyline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: auto;
  opacity: 0.9;
}

/* ---------- Sections ---------- */

.section { padding: 64px 0; }
.section-alt { background: var(--zyrp-blue-light); }
.section-header { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.section-header p { color: var(--zyrp-text-muted); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.committee-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .committee-grid { grid-template-columns: 1fr; } }
.upcoming-events-grid { grid-template-columns: repeat(2, 1fr); max-width: 700px; }
@media (max-width: 560px) { .upcoming-events-grid { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid var(--zyrp-border);
  border-radius: var(--zyrp-radius);
  padding: 24px;
  box-shadow: var(--zyrp-shadow);
}

.goal-card { text-align: left; }
.goal-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--zyrp-blue-light);
  color: var(--zyrp-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

/* ---------- Stat tiles ---------- */

.stat-tile {
  text-align: center;
  padding: 32px 24px;
}
.stat-number {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--zyrp-blue);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  color: var(--zyrp-blue-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- Collapsible (privacy policy) ---------- */

.disclosure-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--zyrp-blue-dark);
  font-size: 1.1rem;
  padding: 0;
}
.disclosure-toggle .chevron { transition: transform 0.15s ease; display: inline-block; }
.disclosure-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.disclosure-body { margin-top: 20px; }
.disclosure-body h3 { font-size: 1rem; margin-top: 1.4em; }
.disclosure-body p, .disclosure-body li { color: var(--zyrp-text-muted); }
.disclosure-body ul { padding-left: 20px; }

/* ---------- Committee ---------- */

.committee-card { text-align: center; }
.committee-avatar {
  width: 74px; height: 74px;
  border-radius: 50%;
  background: var(--zyrp-blue-dark);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 auto 14px;
  overflow: hidden;
}
.committee-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.committee-role { color: var(--zyrp-blue); font-weight: 600; font-size: 0.88rem; }

/* ---------- Events ---------- */

.event-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.event-tab {
  border: 1px solid var(--zyrp-border);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--zyrp-text);
}
.event-tab.active { background: var(--zyrp-blue-dark); color: #fff; border-color: var(--zyrp-blue-dark); }

.event-card { display: flex; flex-direction: column; gap: 8px; }
.event-card > .badge { align-self: flex-start; white-space: nowrap; }
.event-card-badges { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.event-card-badges .badge { white-space: nowrap; }
.event-card-image {
  display: block;
  width: calc(100% + 48px);
  max-width: calc(100% + 48px);
  margin: -24px -24px 4px -24px;
  height: 260px;
  object-fit: contain;
  background: var(--zyrp-blue-light);
  border-radius: var(--zyrp-radius) var(--zyrp-radius) 0 0;
  cursor: pointer;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 46, 77, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--zyrp-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.event-teaser-note { font-style: italic; font-size: 0.85rem; }
.event-card-subtitle { color: var(--zyrp-blue); font-weight: 600; font-size: 0.9rem; margin-top: -6px; }
.event-date {
  display: inline-block;
  font-weight: 700;
  color: var(--zyrp-blue);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--zyrp-blue-light);
  color: var(--zyrp-blue-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-committee { background: var(--zyrp-blue-dark); color: #fff; }
.badge-pending { background: #fdf3d8; color: #8a6d1d; }
.badge-noshow { background: var(--zyrp-danger-bg); color: var(--zyrp-danger); }

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--zyrp-blue-light);
  color: var(--zyrp-blue-dark);
  font-size: 0.68rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: help;
  vertical-align: middle;
}

.members-only-teaser {
  border: 2px dashed var(--zyrp-border);
  border-radius: var(--zyrp-radius);
  padding: 32px;
  text-align: center;
  color: var(--zyrp-text-muted);
  background: #fbfdff;
}

/* ---------- Forms ---------- */

.form-card {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--zyrp-border);
  border-radius: var(--zyrp-radius);
  box-shadow: var(--zyrp-shadow);
  padding: 36px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* min-width: 0 overrides the grid item's default auto-min-size (its content's min-content width,
   e.g. the "Learning & Development" <select> option) so all three columns stay truly equal-width
   instead of the widest content pushing its own column wider than the other two. */
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.row-3 > .form-group { min-width: 0; }
@media (max-width: 560px) { .row-3 { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.form-group label { font-weight: 600; font-size: 0.88rem; color: var(--zyrp-blue-dark); }
/* A <label> used as a styled file-input trigger (e.g. "Choose Image") should look like the .btn
   it is, not like a form field label — overrides the plain-label rule above. */
.form-group label.btn-primary { color: #fff; font-weight: 700; font-size: 0.95rem; line-height: normal; }
.form-hint { font-size: 0.78rem; color: var(--zyrp-text-muted); }

/* Reserves its grid row's height at all times (rather than display:none, which would let the
   row collapse to the shorter Price row and shift everything below it — e.g. the Create Event
   button — when the fee amount field toggles on/off). */
#fee-amount-group { visibility: hidden; }
#fee-amount-group.fee-amount-visible { visibility: visible; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="tel"], input[type="number"], input[type="url"], input[type="time"], select, textarea {
  border: 1px solid var(--zyrp-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--zyrp-text);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--zyrp-blue);
  box-shadow: 0 0 0 3px rgba(37, 139, 205, 0.15);
}
textarea { resize: vertical; min-height: 90px; }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .checkbox-grid { grid-template-columns: 1fr; } }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.checkbox-row input { width: 16px; height: 16px; }

.yesno { display: flex; gap: 18px; }
.yesno label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.92rem; }

.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.alert-error { background: var(--zyrp-danger-bg); color: var(--zyrp-danger); }
.alert-success { background: var(--zyrp-success-bg); color: var(--zyrp-success); }
.alert-info { background: var(--zyrp-blue-light); color: var(--zyrp-blue-dark); }
.hidden { display: none !important; }

/* ---------- Dashboard layout ---------- */

.dash-header {
  background: var(--zyrp-blue-dark);
  color: #fff;
  padding: 36px 0;
}
.dash-header h1 { color: #fff; margin: 0 0 16px; }
/* .hero-actions is shared with the home hero's button row, which needs a 28px gap below a
   preceding paragraph — that gap doesn't belong when the class is reused here as a plain
   heading-row wrapper (e.g. the admin heading + Mail link). Give the row itself the same
   16px bottom margin as a bare .dash-header h1 gets, so both pages' tabs sit the same
   distance below the heading regardless of whether it's wrapped in this row or not. */
.dash-header .hero-actions { margin: 0 0 16px; }
.dash-header a { color: #fff; }
.dash-header .text-muted { color: rgba(255, 255, 255, 0.75); }
.dash-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.dash-tab {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.dash-tab.active { background: #fff; color: var(--zyrp-blue-dark); }
.dash-panel { display: none; }
.dash-panel.active { display: block; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--zyrp-border); font-size: 0.9rem; }
th { color: var(--zyrp-blue-dark); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--zyrp-border); border-radius: var(--zyrp-radius); }

/* ---------- Footer ---------- */

footer {
  background: var(--zyrp-blue-dark);
  color: rgba(255,255,255,0.85);
  padding: 36px 0;
  margin-top: 40px;
  font-size: 0.88rem;
}
footer a { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 26px; width: auto; opacity: 0.9; }
.footer-credit {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.55);
}
.footer-credit a { color: rgba(255, 255, 255, 0.75); }
.footer-credit a:hover { color: #fff; }

.small-link {
  font-size: 0.8rem;
  color: var(--zyrp-text-muted);
}

.text-muted { color: var(--zyrp-text-muted); }
.mt-0 { margin-top: 0; }
.center { text-align: center; }

/* ---------- Confirm dialog (replaces window.confirm) ---------- */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 46, 77, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.confirm-box {
  background: #fff;
  border-radius: var(--zyrp-radius);
  box-shadow: 0 12px 40px rgba(11, 46, 77, 0.3);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  animation: confirm-pop 0.15s ease;
}
@keyframes confirm-pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.confirm-box p { margin: 0 0 26px; color: var(--zyrp-text); font-size: 0.96rem; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-actions-center { justify-content: center; }
