/* ── Reset & base ─────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-900: #1a3a2a;
  --green-800: #1e4d35;
  --green-700: #2d6a4f;
  --green-600: #40916c;
  --green-400: #74c69d;
  --green-100: #d8f3dc;
  --green-50:  #f0faf3;

  --text:       #1a1a1a;
  --text-muted: #6b7280;
  --border:     #d1d5db;
  --bg:         #ffffff;
  --bg-subtle:  #f9fafb;

  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

/* ── Header / Nav ─────────────────────────────────────────────────────────── */

.site-header {
  background: var(--green-800);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; opacity: 0.9; }

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

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-links a:hover { background: rgba(255,255,255,0.12); color: #fff; }

.nav-new {
  background: var(--green-600) !important;
  color: #fff !important;
  font-weight: 600;
}
.nav-new:hover { background: var(--green-700) !important; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  white-space: nowrap;
}

.nav-name {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
}

.nav-user a {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  text-decoration: none;
}
.nav-user a:hover { color: #fff; }

/* ── Main content ─────────────────────────────────────────────────────────── */

.main {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 64px;
  flex: 1;
}

/* ── Flash messages ───────────────────────────────────────────────────────── */

.flash-container { margin-bottom: 24px; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.flash-success {
  background: var(--green-100);
  color: #166534;
  border: 1px solid var(--green-400);
}

.flash-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-family: var(--font);
  font-weight: 500;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--green-700);
  color: #fff;
  border-color: var(--green-700);
}
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); }

.btn-secondary {
  background: #fff;
  color: var(--green-700);
  border-color: var(--green-700);
}
.btn-secondary:hover { background: var(--green-50); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }

.btn-warning {
  background: #fff;
  color: #b45309;
  border-color: #d97706;
}
.btn-warning:hover { background: #fffbeb; }

.btn-danger {
  background: #fff;
  color: #b91c1c;
  border-color: #ef4444;
}
.btn-danger:hover { background: #fef2f2; }

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* ── Page header ──────────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-footer-link {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── Badges ───────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.badge-spark {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ── Event list ───────────────────────────────────────────────────────────── */

.event-section { margin-bottom: 36px; }

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card {
  display: block;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
}

.event-card:hover {
  border-color: var(--green-600);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.event-card--spontaneous {
  border-color: #fde047;
  background: #fffef0;
}

.event-card--spontaneous:hover {
  border-color: #facc15;
}

.event-card--cancelled {
  opacity: 0.65;
}

.event-card-badges { margin-bottom: 4px; }

.event-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.event-card-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

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

.strikethrough { text-decoration: line-through; }

/* ── Event detail ─────────────────────────────────────────────────────────── */

.detail-page { max-width: 720px; }

.detail-header {
  margin-bottom: 32px;
}

.detail-badges { margin-bottom: 8px; }

.detail-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  line-height: 1.2;
}

.detail-meta {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.detail-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--green-800);
}

.detail-details {
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* RSVP */

.rsvp-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.rsvp-btn {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 20px;
}

.rsvp-btn:hover {
  border-color: var(--green-600);
  background: var(--green-50);
}

.rsvp-btn--active {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-800);
  font-weight: 600;
}

.bringing-section {
  background: var(--green-50);
  border: 1.5px solid var(--green-400);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 8px;
}

.bringing-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.item-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.item-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.item-option--taken {
  opacity: 0.5;
  cursor: default;
}

.item-claimed-by {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.other-item-input {
  margin-top: 8px;
  width: 100%;
}

.hero-confirmation {
  background: var(--green-100);
  border: 1.5px solid var(--green-400);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-weight: 600;
  color: #166534;
  margin-top: 16px;
  font-size: 0.95rem;
}

/* Attendees */

.attendee-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attendee-list li {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attendee-subhead {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 6px;
}

.attendee-list--maybe li { color: var(--text-muted); }
.attendee-more { color: var(--text-muted); font-style: italic; font-size: 0.85rem; }

.hero-badge {
  font-size: 0.75rem;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 999px;
  padding: 2px 8px;
  color: #854d0e;
  font-weight: 600;
}

.items-list { display: flex; flex-direction: column; gap: 6px; }
.items-list li { font-size: 0.9rem; }
.item-unclaimed { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }

.album-list { display: flex; flex-direction: column; gap: 6px; }
.album-list a { font-size: 0.9rem; }

/* Organizer actions */

.organizer-section { background: var(--bg-subtle); border-radius: var(--radius); padding: 20px; }
.organizer-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Form pages ───────────────────────────────────────────────────────────── */

.form-page { max-width: 600px; }

.form-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.form-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  margin-top: -16px;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="time"],
.field input[type="url"],
.field textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="url"],
textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(64,145,108,0.15);
}

textarea { resize: vertical; }

.field-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.required { color: #dc2626; }

.field-group {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.field-group legend {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0 6px;
  color: var(--text);
}

.radio-group { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.sub-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 12px;
}

.checkbox-row { display: flex; gap: 12px; flex-wrap: wrap; }

.check-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  cursor: pointer;
}

.park-picker-wrap { margin-top: 12px; position: relative; }

#parkSearch {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
#parkSearch:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(64,145,108,0.15);
}

.park-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
}

.park-results li {
  padding: 10px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.1s;
}

.park-results li:hover { background: var(--green-50); }

.selected-park {
  font-size: 0.875rem;
  color: var(--green-700);
  margin-top: 8px;
  font-weight: 500;
}

.custom-date-input {
  width: auto;
  display: block;
  margin-bottom: 8px;
}

.removable-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.removable-row input { flex: 1; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ── Auth pages ───────────────────────────────────────────────────────────── */

.auth-page {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.auth-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 8px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

.auth-form { margin-bottom: 20px; }

.auth-switch {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Nominations ──────────────────────────────────────────────────────────── */

.nomination-list { display: flex; flex-direction: column; gap: 10px; }

.nomination-card {
  display: block;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nomination-card:hover {
  border-color: var(--green-600);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.nomination-name { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.nomination-address { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 4px; }
.nomination-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.nomination-reason { font-size: 0.875rem; margin-bottom: 8px; }

.vote-counts { display: flex; gap: 14px; }
.vote-yes { color: #166534; font-weight: 600; font-size: 0.9rem; }
.vote-no  { color: #991b1b; font-weight: 600; font-size: 0.9rem; }

/* Nomination detail */

.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.back-link:hover { color: var(--text); }

.nomination-detail-address { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 6px; }
.nomination-detail-meta    { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 10px; }
.nomination-detail-reason  { font-size: 0.95rem; margin-bottom: 20px; }

.vote-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
}

.vote-yes-big { font-size: 1.5rem; font-weight: 700; color: #166534; }
.vote-no-big  { font-size: 1.5rem; font-weight: 700; color: #991b1b; }

.vote-form .vote-buttons { display: flex; gap: 10px; margin-bottom: 16px; }

.btn-vote {
  font-size: 1rem;
  padding: 10px 24px;
  font-weight: 600;
}

.btn-vote-yes { border-color: #16a34a; color: #166534; }
.btn-vote-yes:hover { background: #f0fdf4; }

.btn-vote-no { border-color: #dc2626; color: #991b1b; }
.btn-vote-no:hover { background: #fef2f2; }

.vote-list { display: flex; flex-direction: column; gap: 10px; }

.vote-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9rem;
}

.vote-icon { font-size: 1rem; }
.vote-voter { font-weight: 600; }
.vote-comment { color: var(--text-muted); }

.already-voted {
  margin-bottom: 24px;
  font-size: 0.9rem;
}

/* ── Misc ─────────────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state p { margin-bottom: 20px; }

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

.error-page {
  text-align: center;
  padding: 80px 24px;
}

.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--green-700);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 12px;
}

.error-message {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── btn-ghost in nav (sign out) ──────────────────────────────────────────── */

.site-header .btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
  padding: 5px 12px;
}

.site-header .btn-ghost:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.55);
}
