/* =====================
   CSS Variables / Tokens
   ===================== */
:root {
  color-scheme: light;
  --nav-bg: #1e293b;
  --nav-text: #f1f5f9;
  --nav-text-muted: #94a3b8;
  --nav-accent: #f59e0b;

  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-focus: #f59e0b;

  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;

  --color-accent: #f59e0b;
  --color-accent-hover: #d97706;
  --color-accent-light: #fef3c7;

  --color-teal: #0d9488;
  --color-teal-hover: #0f766e;
  --color-teal-light: #ccfbf1;

  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-danger: #ef4444;
  --color-danger-light: #fee2e2;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-info: #0ea5e9;
  --color-info-light: #e0f2fe;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;

  --transition: 150ms ease;
}

/* =====================
   Reset & Base
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--color-teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-teal-hover); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* =====================
   Layout
   ===================== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 760px; }
.container--wide { max-width: 1400px; }
main { flex: 1; }
.page-section { padding: 2.5rem 0; }
.page-header { padding: 2rem 0 1.5rem; border-bottom: 1px solid var(--color-border); margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--color-text); }
.page-header p { color: var(--color-text-secondary); margin-top: .25rem; }

/* =====================
   Navigation
   ===================== */
.navbar {
  background: var(--nav-bg);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.05);
}
.navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 1.5rem;
}
.navbar__brand {
  display: flex;
  align-items: center;
  color: var(--nav-text) !important;
  white-space: nowrap;
}
.navbar__logo {
  display: block;
  height: 42px;
  width: auto;
}
.navbar__links {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
}
.navbar__link {
  color: var(--nav-text-muted) !important;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}
.navbar__link:hover, .navbar__link.active {
  color: var(--nav-text) !important;
  background: rgba(255,255,255,.08);
}
.navbar__actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.navbar__notif {
  position: relative;
  color: var(--nav-text-muted) !important;
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  display: flex;
  align-items: center;
}
.navbar__notif:hover { color: var(--nav-text) !important; background: rgba(255,255,255,.08); }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--color-danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.navbar__user-menu { position: relative; }
.navbar__user-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--nav-text);
  padding: .3rem .75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  display: flex; align-items: center; gap: .4rem;
  transition: background var(--transition);
}
.navbar__user-btn:hover { background: rgba(255,255,255,.18); }
.navbar__dropdown {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
}
.navbar__dropdown.open { display: flex; }
.navbar__dropdown a, .navbar__dropdown button {
  display: block;
  padding: .6rem 1rem;
  color: var(--color-text);
  font-size: .875rem;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}
.navbar__dropdown a:hover, .navbar__dropdown button:hover { background: var(--color-surface-alt); color: var(--color-text); }
.navbar__dropdown hr { border: none; border-top: 1px solid var(--color-border); margin: .25rem 0; }

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-text-muted);
  padding: .4rem .45rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
  line-height: 0;
}
.theme-toggle:hover { color: var(--nav-text); background: rgba(255,255,255,.08); }

/* Create Event quick-access button */
.navbar__create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--color-accent);
  color: #1a0800;
  border-radius: var(--radius-full);
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.navbar__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--nav-text);
  cursor: pointer;
  padding: .4rem;
  margin-left: .25rem;
  align-items: center;
  justify-content: center;
}
.navbar__create-btn:hover {
  background: var(--color-accent-hover);
  color: #1a0800;
  box-shadow: 0 0 0 4px rgba(245,158,11,.3);
  transform: scale(1.08);
}

/* =====================
   Flash Messages
   ===================== */
.messages { list-style: none; padding: .75rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.message {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: .5rem;
  border-left: 4px solid;
}
.message--success { background: var(--color-success-light); border-color: var(--color-success); color: #065f46; }
.message--error { background: var(--color-danger-light); border-color: var(--color-danger); color: #991b1b; }
.message--warning { background: var(--color-warning-light); border-color: var(--color-warning); color: #92400e; }
.message--info { background: var(--color-info-light); border-color: var(--color-info); color: #0c4a6e; }

/* =====================
   Buttons
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--color-accent); color: #1a0800; border-color: var(--color-accent); }
.btn--primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #1a0800; }
.btn--teal { background: var(--color-teal); color: #fff; border-color: var(--color-teal); }
.btn--teal:hover { background: var(--color-teal-hover); border-color: var(--color-teal-hover); color: #fff; }
.btn--outline { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--outline:hover { background: var(--color-surface-alt); color: var(--color-text); }
.btn--danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn--danger:hover { background: #dc2626; color: #fff; }
.btn--warning { background: var(--color-warning); color: #1a0800; border-color: var(--color-warning); }
.btn--warning:hover { background: #d97706; border-color: #d97706; color: #1a0800; }
.btn--ghost { background: transparent; color: var(--color-text-secondary); border-color: transparent; }
.btn--ghost:hover { background: var(--color-surface-alt); color: var(--color-text); }

/* Outline/ghost buttons placed on a dark surface (navbar, profile header) —
   unlike .btn--outline/.btn--ghost above, these don't rely on --color-text
   or --color-surface-alt, which are tuned for light card backgrounds and in
   light theme happen to equal --nav-text exactly, making hover text
   invisible. These use a fixed translucent white overlay instead, so they
   stay readable against the dark background in both site themes. */
.btn--outline-dark { background: transparent; color: var(--nav-text); border-color: rgba(255,255,255,.3); }
.btn--outline-dark:hover { background: rgba(255,255,255,.12); color: var(--nav-text); border-color: rgba(255,255,255,.5); }
.btn--ghost-dark { background: transparent; color: var(--nav-text-muted); border-color: transparent; }
.btn--ghost-dark:hover { background: rgba(255,255,255,.1); color: var(--nav-text); }

.btn--sm { padding: .3rem .75rem; font-size: .8rem; }
.btn--lg { padding: .7rem 1.5rem; font-size: 1rem; }
.btn--block { width: 100%; justify-content: center; }

/* =====================
   Cards
   ===================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__body { padding: 1.25rem 1.5rem; }
.card__header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card__header h2, .card__header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}
.card__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

/* Event Card */
.event-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.event-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.event-card__type-bar {
  height: 4px;
  background: var(--color-accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.event-card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.event-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
.event-card__title a { color: inherit; }
.event-card__title a:hover { color: var(--color-teal); }
.event-card__tagline { font-size: .85rem; color: var(--color-text-secondary); }
.event-card__meta { display: flex; flex-direction: column; gap: .25rem; margin-top: auto; padding-top: .75rem; }
.event-card__meta-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--color-text-muted);
}
.event-card__footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =====================
   Badges / Tags
   ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--amber { background: var(--color-accent-light); color: #92400e; }
.badge--teal { background: var(--color-teal-light); color: #0f766e; }
.badge--slate { background: #f1f5f9; color: #475569; }
.badge--green { background: var(--color-success-light); color: #065f46; }
.badge--red { background: var(--color-danger-light); color: #991b1b; }
.badge--blue { background: var(--color-info-light); color: #0c4a6e; }
.badge--yellow { background: #fef9c3; color: #713f12; }
.badge--gray { background: #f3f4f6; color: #374151; }

.tag {
  display: inline-block;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: .15rem .6rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 500;
}
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }

/* =====================
   Forms
   ===================== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .4rem;
}
.form-label .required { color: var(--color-danger); margin-left: .2rem; }
.form-control {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.form-control::placeholder { color: var(--color-text-muted); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.5rem;
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: .78rem; color: var(--color-text-muted); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--color-danger); margin-top: .3rem; }
.errorlist { list-style: none; }
.errorlist li { font-size: .78rem; color: var(--color-danger); margin-top: .25rem; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-accent); cursor: pointer; }
.form-check label { font-size: .875rem; color: var(--color-text); cursor: pointer; }
.form-section { padding: 1.5rem 0; border-bottom: 1px solid var(--color-border); }
.form-section:last-child { border-bottom: none; }
.form-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--color-text); }

/* Radio score selector */
.score-options { display: flex; gap: .5rem; flex-wrap: wrap; }
.score-option { display: none; }
.score-option + label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  transition: all var(--transition);
}
.score-option + label:hover { border-color: var(--color-accent); color: var(--color-accent); }
.score-option:checked + label { border-color: var(--color-accent); background: var(--color-accent-light); color: var(--color-accent-hover); }

/* =====================
   Grid Layouts
   ===================== */
.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--events { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* =====================
   Hero
   ===================== */
.hero {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 4rem 1.5rem;
  text-align: center;
}
.hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -.03em;
}
.hero__title span { color: var(--nav-accent); }
.hero__subtitle { font-size: 1.125rem; color: var(--nav-text-muted); max-width: 560px; margin: 0 auto 2rem; }
.hero__search {
  display: flex;
  max-width: 540px;
  margin: 0 auto;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero__search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: .75rem 1rem;
  color: var(--nav-text);
  font-size: .95rem;
}
.hero__search input::placeholder { color: var(--nav-text-muted); }
.hero__search button {
  background: var(--color-accent);
  border: none;
  padding: .75rem 1.25rem;
  color: #1a0800;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.hero__search button:hover { background: var(--color-accent-hover); }
.hero__stats { display: flex; justify-content: center; gap: 3rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.1); }
.hero__stat-value { font-size: 2rem; font-weight: 800; color: var(--color-accent); }
.hero__stat-label { font-size: .8rem; color: var(--nav-text-muted); text-transform: uppercase; letter-spacing: .05em; }
/* How it works */
.how-it-works { background: var(--color-surface-alt); border-bottom: 1px solid var(--color-border); }
.how-it-works__label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}
.how-it-works__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.how-it-works__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.how-it-works__card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.how-it-works__bar { height: 4px; flex-shrink: 0; }
.how-it-works__inner {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
}
.how-it-works__step {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-border);
  line-height: 1;
  user-select: none;
}
.how-it-works__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: .25rem;
}
.how-it-works__heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}
.how-it-works__body {
  font-size: .875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  flex: 1;
}
.how-it-works__cta {
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: .75rem;
  transition: color var(--transition);
}
.how-it-works__card:hover .how-it-works__cta { color: var(--color-accent); }

/* =====================
   Filter Bar
   ===================== */
.filter-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-bar__group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.filter-bar__label { font-size: .8rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.filter-pill {
  padding: .3rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.filter-pill:hover { border-color: var(--color-accent); color: var(--color-accent); }
.filter-pill.active { background: var(--color-accent); border-color: var(--color-accent); color: #1a0800; }

/* =====================
   Event Detail Page
   ===================== */
.event-detail__header {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 2.5rem 0;
}
.event-detail__type { color: var(--nav-accent); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem; }
.event-detail__title { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; line-height: 1.2; margin-bottom: .5rem; }
.event-detail__tagline { font-size: 1rem; color: var(--nav-text-muted); }
.event-detail__meta-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-wrap: wrap;
}
.event-detail__meta-item { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--nav-text-muted); }
.event-detail__meta-item strong { color: var(--nav-text); }

.event-detail__content { padding: 2rem 0; }
.event-detail__body { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.event-detail__description h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; padding-top: 1.25rem; }
.event-detail__description p { color: var(--color-text-secondary); line-height: 1.8; margin-bottom: .75rem; }
.event-detail__description ul { padding-left: 1.25rem; }
.event-detail__description li { color: var(--color-text-secondary); margin-bottom: .3rem; }

/* =====================
   Static / Legal content pages
   ===================== */
.legal-content h2 { font-size: 1.15rem; font-weight: 700; margin: 1.75rem 0 .75rem; color: var(--color-text); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 .5rem; color: var(--color-text); }
.legal-content p { color: var(--color-text-secondary); line-height: 1.8; margin-bottom: .85rem; }
.legal-content ul, .legal-content ol { padding-left: 1.4rem; margin-bottom: .85rem; }
.legal-content ul { list-style: disc; }
.legal-content ol { list-style: decimal; }
.legal-content li { color: var(--color-text-secondary); line-height: 1.7; margin-bottom: .4rem; }
.legal-content strong { color: var(--color-text); }
.legal-content a { text-decoration: underline; }

.help-faq { display: flex; flex-direction: column; gap: .75rem; }
.help-faq__item { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem 1.25rem; background: var(--color-surface); }
.help-faq__q { font-weight: 600; color: var(--color-text); margin-bottom: .4rem; }
.help-faq__a { color: var(--color-text-secondary); font-size: .9rem; line-height: 1.7; }

/* Quick-links nav used in the legal/help page sidebar */
.legal-nav { display: flex; flex-direction: column; gap: .15rem; }
.legal-nav a { display: block; padding: .5rem .6rem; border-radius: var(--radius-sm); font-size: .875rem; color: var(--color-text-secondary); }
.legal-nav a:hover { background: var(--color-surface-alt); color: var(--color-text); }
.legal-nav a.active { color: var(--color-accent); font-weight: 600; background: var(--color-accent-light); }

.event-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.event-sidebar .card__body { display: flex; flex-direction: column; gap: .75rem; }
.sidebar-meta-item { display: flex; gap: .75rem; }
.sidebar-meta-item__icon { color: var(--color-text-muted); flex-shrink: 0; margin-top: .1rem; }
.sidebar-meta-item__text strong { display: block; font-size: .75rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.sidebar-meta-item__text span { font-size: .875rem; color: var(--color-text); }

/* =====================
   CFP Section
   ===================== */
.cfp-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--color-surface);
  transition: border-color var(--transition);
}
.cfp-card:hover { border-color: var(--color-accent); }
.cfp-card__title { font-weight: 700; color: var(--color-text); margin-bottom: .25rem; }
.cfp-card__meta { font-size: .82rem; color: var(--color-text-muted); }

/* =====================
   Tables
   ===================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead { background: var(--color-surface-alt); }
th { padding: .75rem 1rem; text-align: left; font-weight: 600; color: var(--color-text-secondary); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; border-bottom: 1px solid var(--color-border); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--color-border); color: var(--color-text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-alt); }

/* =====================
   Review Stars
   ===================== */
.score-display { display: flex; align-items: center; gap: .25rem; }
.score-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}
.score-dot.filled { background: var(--color-accent); }

/* =====================
   Empty State
   ===================== */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--color-text-muted);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--color-text-secondary); margin-bottom: .5rem; }
.empty-state p { font-size: .9rem; max-width: 340px; margin: 0 auto .5rem; }

/* =====================
   Pagination
   ===================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 2rem 0;
}
.page-item a, .page-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}
.page-item a:hover { background: var(--color-surface-alt); color: var(--color-text); }
.page-item.active span { background: var(--color-accent); border-color: var(--color-accent); color: #1a0800; font-weight: 700; }
.page-item.disabled span { opacity: .4; cursor: not-allowed; }

/* =====================
   Auth Pages
   ===================== */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card__header { text-align: center; padding: 2rem 2rem 1.5rem; border-bottom: none; flex-direction: column; gap: .25rem; align-items: center; }
.auth-card .card__header h1 { font-size: 1.5rem; font-weight: 800; }
.auth-card .card__header p { font-size: .875rem; color: var(--color-text-muted); }
.auth-card .card__body { padding: 1.5rem 2rem 2rem; }

/* Google sign-in button */
.btn--google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  width: 100%;
  padding: .625rem 1rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn--google:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-text-muted);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.btn--google svg { flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.1rem 0;
  color: var(--color-text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* =====================
   Profile
   ===================== */
.profile-header {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 2.5rem 0;
}
.profile-header__inner { display: flex; align-items: center; gap: 1.5rem; }
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #1a0800;
  flex-shrink: 0;
}
.profile-header__name { font-size: 1.5rem; font-weight: 800; }
.profile-header__meta { font-size: .875rem; color: var(--nav-text-muted); margin-top: .25rem; }
.profile-header__actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.profile-header__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.3);
  background: transparent;
  color: var(--nav-text);
  cursor: pointer;
  font: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.profile-header__social:hover { background: rgba(255,255,255,.12); border-color: var(--nav-accent); color: var(--nav-text) !important; }
.profile-header__social.share-icon-link--copied { background: rgba(16,185,129,.2); border-color: #10b981; color: #10b981 !important; }
.profile-header__divider { width: 1px; height: 22px; background: rgba(255,255,255,.2); }

/* Expandable "About" text — collapses long bios behind a View more toggle */
.bio-text.is-truncatable { max-height: 4.9em; overflow: hidden; }
.bio-text.is-truncatable.is-expanded { max-height: none; }
.js-bio-toggle {
  background: none;
  border: none;
  padding: .4rem 0 0;
  color: var(--color-teal);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.js-bio-toggle:hover { color: var(--color-teal-hover); }

/* =====================
   Notification Items
   ===================== */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
  text-decoration: none;
  color: var(--color-text);
}
.notif-item:hover { background: var(--color-surface-alt); }
.notif-item.unread { background: #fffbeb; }
.notif-item.unread:hover { background: #fef3c7; }
.notif-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); flex-shrink: 0; margin-top: .45rem; }
.notif-item__dot.read { background: transparent; border: 2px solid var(--color-border); }
.notif-item__title { font-size: .875rem; font-weight: 600; color: var(--color-text); }
.notif-item__msg { font-size: .8rem; color: var(--color-text-muted); margin-top: .15rem; }
.notif-item__time { font-size: .75rem; color: var(--color-text-muted); margin-top: .25rem; }

/* =====================
   Dividers & Utilities
   ===================== */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 1.5rem 0; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* =====================
   Footer
   ===================== */
.footer {
  background: var(--nav-bg);
  color: var(--nav-text-muted);
  padding: 1.75rem 1.5rem;
  font-size: .8rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.07);
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}
.footer__logo { display: block; height: 36px; width: auto; }
.footer__left { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.footer__divider { display: block; width: 1px; height: 20px; background: rgba(255,255,255,.15); margin: 0 1.1rem; flex-shrink: 0; }
.footer__nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.footer__link { color: var(--nav-text-muted); text-decoration: none; transition: color .15s; }
.footer__link:hover { color: var(--nav-accent); }
.footer__center { text-align: center; color: var(--nav-text-muted); white-space: nowrap; }
.footer__right { display: flex; align-items: center; justify-content: flex-end; gap: .9rem; }
.footer__icon-link { color: var(--nav-text-muted); display: flex; align-items: center; transition: color .15s; }
.footer__icon-link:hover { color: var(--nav-accent); }

.share-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.share-icon-link:hover { border-color: var(--color-accent); color: var(--color-accent-hover); background: var(--color-accent-light); }
.share-icon-link--copied { border-color: var(--color-success); color: #065f46; background: var(--color-success-light); }
@media (max-width: 640px) {
  .footer__inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer__center { text-align: left; white-space: normal; }
  .footer__right { justify-content: flex-start; }
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 1024px) {
  .event-detail__body { grid-template-columns: 1fr; }
  .event-sidebar { order: -1; }
}
@media (max-width: 768px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .navbar__toggle { display: flex; }
  .navbar__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
    background: var(--nav-bg);
    padding: .5rem 1.5rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
  }
  .navbar__links.open { display: flex; }
  .navbar__link { padding: .7rem .5rem; }
  .hero__stats { gap: 1.5rem; }
  .hero { padding: 2.5rem 1.5rem; }
  .profile-header__inner { flex-direction: column; align-items: flex-start; }
  .profile-header__actions { margin-left: 0; }
}
@media (max-width: 540px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar__group { width: 100%; }
  .hero__search { flex-direction: column; border-radius: var(--radius); }
  .hero__search button { border-radius: 0 0 var(--radius) var(--radius); }
  .how-it-works__grid { grid-template-columns: 1fr; }
}

/* =====================
   Explore Map
   ===================== */

/* Outer wrapper — full viewport minus navbar */
.explore-map {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Page header — matches the app's standard card__header style */
.explore-map__header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: .875rem 1.5rem;
  flex-shrink: 0;
}
.explore-map__header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 100%;
}
.explore-map__header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: .45rem;
  line-height: 1.2;
}
.explore-map__header-sub {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: .2rem;
}

/* Body: sidebar + map, fills remaining height */
.explore-map__body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* Sidebar */
.explore-map__sidebar {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow: hidden;
}

/* Filters area */
.explore-map__filters {
  padding: .875rem 1rem 0;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.explore-map__filter-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .65rem;
  flex-wrap: wrap;
}
.explore-map__filter-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  min-width: 38px;
}
.explore-map__pills { display: flex; gap: .3rem; flex-wrap: wrap; }
.explore-map__pill {
  padding: .25rem .7rem;
  font-size: .78rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}
.explore-map__pill:hover { border-color: var(--color-accent); color: var(--color-accent); }
.explore-map__pill.active { background: var(--color-accent); border-color: var(--color-accent); color: #1a0800; font-weight: 600; }

.explore-map__filter-count {
  font-size: .73rem;
  color: var(--color-text-muted);
  padding-bottom: .65rem;
}

/* Scrollable event list */
.explore-map__list { flex: 1; overflow-y: auto; }

/* Event card — mirrors event-card pattern with a coloured left bar */
.explore-map__card {
  display: flex;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.explore-map__card:hover { background: var(--color-surface-alt); }
.explore-map__card--active { background: var(--color-accent-light); }

.explore-map__card-bar {
  width: 4px;
  flex-shrink: 0;
}
.explore-map__card-inner {
  padding: .75rem 1rem;
  flex: 1;
  min-width: 0;
}
.explore-map__card-badges {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.explore-map__card-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: .35rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.explore-map__card-meta {
  font-size: .75rem;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin-bottom: .5rem;
}

/* Empty / loading state */
.explore-map__empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: .85rem;
}

/* Map canvas */
.explore-map__canvas { flex: 1; position: relative; z-index: 0; }

/* ── Leaflet popup — matches app card style ─────────── */
.map-popup { overflow: hidden; }
.map-popup__bar { height: 4px; }
.map-popup__body { padding: .875rem 1rem; }
.map-popup__badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .4rem; }
.map-popup__title { font-size: .9rem; font-weight: 700; color: var(--color-text); line-height: 1.3; margin-bottom: .35rem; }
.map-popup__meta { font-size: .775rem; color: var(--color-text-secondary); margin-bottom: .2rem; }

.leaflet-popup-content-wrapper {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 0 !important;
}
.leaflet-popup-content { margin: 0 !important; }
.leaflet-popup-tip { background: var(--color-surface) !important; }
.leaflet-popup-close-button { top: 6px !important; right: 8px !important; color: var(--color-text-muted) !important; font-size: 1.1rem !important; }
.leaflet-attribution-flag { display: none !important; }

@media (max-width: 768px) {
  .explore-map__sidebar { width: 280px; }
}
@media (max-width: 600px) {
  .explore-map__sidebar { display: none; }
}

/* =====================
   Dark Theme
   ===================== */
[data-theme="dark"] {
  color-scheme: dark;

  --nav-bg: #0a0f1a;
  --nav-text: #e2e8f0;
  --nav-text-muted: #64748b;

  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-alt: #162030;
  --color-border: #2d3d52;
  --color-border-focus: #f59e0b;

  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;

  /* Tinted light variants for dark backgrounds */
  --color-accent-light: rgba(245,158,11,.16);
  --color-teal-light: rgba(13,148,136,.16);
  --color-success-light: rgba(16,185,129,.16);
  --color-danger-light: rgba(239,68,68,.16);
  --color-warning-light: rgba(245,158,11,.16);
  --color-info-light: rgba(14,165,233,.16);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 4px 6px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.6), 0 4px 6px rgba(0,0,0,.4);
}

/* Unread notifications — hardcoded amber bg needs dark override */
[data-theme="dark"] .notif-item.unread { background: rgba(245,158,11,.08); }
[data-theme="dark"] .notif-item.unread:hover { background: rgba(245,158,11,.13); }

/* Badges with hardcoded light backgrounds */
[data-theme="dark"] .badge--slate { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .badge--gray  { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .badge--yellow { background: rgba(245,158,11,.16); color: #fcd34d; }

/* Score selector */
[data-theme="dark"] .score-option + label { border-color: #2d3d52; color: #64748b; }
[data-theme="dark"] .score-option + label:hover { border-color: var(--color-accent); color: var(--color-accent); }
[data-theme="dark"] .score-option:checked + label { background: rgba(245,158,11,.16); }

/* Select arrow — lighter stroke on dark bg */
[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* User dropdown needs explicit background since it's outside nav context */
[data-theme="dark"] .navbar__dropdown { background: #1e293b; border-color: #2d3d52; }
[data-theme="dark"] .navbar__dropdown a,
[data-theme="dark"] .navbar__dropdown button { color: #e2e8f0; }
[data-theme="dark"] .navbar__dropdown a:hover,
[data-theme="dark"] .navbar__dropdown button:hover { background: #162030; }
