/*
  COLOR PALETTE
  --green-dark:   #1F4B22  (nav, primary buttons)
  --green-mid:    #2D6A30  (hover, chip active)
  --green-light:  #E8EDE5  (surface tint, donation pill)
  --navy:         #1B2D4F  (metadata)
  --amber:        #B45309  (scarcity warning)
  --bg:           #F8F6F2  (page background)
  --border:       #DDD9D1  (dividers)
*/

:root {
  --green-dark: #1F4B22;
  --green-mid: #2D6A30;
  --green-light: #E8EDE5;
  --navy: #1B2D4F;
  --amber: #B45309;
  --bg: #F8F6F2;
  --border: #DDD9D1;
  --text: #1a1a1a;
  --muted: #777;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: #B8B4AC;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Phone frame ── */
.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ── View management ── */
.view {
  display: none;
  min-height: 100vh;
  background: var(--bg);
  animation: fadeSlideIn 0.18s ease-out;
}
.view.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Nav ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--green-dark);
  color: #fff;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
  color: #fff;
  line-height: 1;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  font-weight: 500;
  margin-left: 1.25rem;
  transition: color 0.1s;
}
.nav-links a:hover { color: #fff; }

/* ── Hero ── */
.hero {
  padding: 1.4rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.hero p {
  font-size: 1.05rem;
  color: var(--green-dark);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

/* ── Filter chips ── */
.chips {
  display: flex;
  gap: 0.45rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.chip {
  padding: 0.3rem 0.95rem;
  border: 1px solid #C0BDB5;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  background: #fff;
  cursor: pointer;
  color: #555;
  transition: all 0.13s;
  letter-spacing: 0.01em;
}
.chip:hover { border-color: var(--green-dark); color: var(--green-dark); }
.chip.active { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }

/* ── Event list ── */
.event-list { padding: 0 1.5rem; }

.section-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #aaa;
  padding: 1.1rem 0 0.45rem;
}

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #EAE7E1;
  gap: 1rem;
  transition: background 0.1s;
}
.event-row.hidden { display: none; }

.event-info { flex: 1; min-width: 0; cursor: pointer; }
.event-info:hover .event-title { color: var(--green-dark); }

.event-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  transition: color 0.1s;
}

.event-meta { font-size: 0.77rem; color: var(--muted); margin-top: 0.12rem; }
.spots-left { font-size: 0.72rem; color: var(--amber); margin-top: 0.12rem; font-weight: 600; }

.btn-in {
  flex-shrink: 0;
  padding: 0.4rem 1rem;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-body);
  transition: background 0.12s;
}
.btn-in:hover { background: var(--green-mid); }

/* ── Empty states ── */
.empty-state {
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.api-error {
  margin: 1rem 1.5rem;
  padding: 0.75rem 1rem;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #92400E;
}

/* ── Section divider ── */
.section-divider {
  margin: 1.5rem 1.5rem 0;
  border: none;
  border-top: 2px solid var(--border);
}

/* ── Considering section ── */
.considering { padding: 0 1.5rem 5rem; }

.considering-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #aaa;
  padding: 1.1rem 0 0.45rem;
}

.consider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #EAE7E1;
  gap: 1rem;
}

.consider-info { flex: 1; cursor: pointer; }
.consider-info:hover .consider-title { color: var(--green-dark); }

.consider-title { font-weight: 600; font-size: 0.92rem; color: var(--text); transition: color 0.1s; }
.consider-meta { font-size: 0.75rem; color: #999; margin-top: 0.12rem; }

.btn-come {
  flex-shrink: 0;
  padding: 0.36rem 0.8rem;
  background: #fff;
  color: var(--green-dark);
  border: 1.5px solid var(--green-dark);
  border-radius: 6px;
  font-size: 0.79rem;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--font-body);
  transition: all 0.12s;
}
.btn-come:hover { background: var(--green-light); }
.btn-come.voted { background: var(--green-light); border-color: var(--green-mid); color: var(--green-mid); cursor: default; }

/* ── Detail view ── */
#detail-view { background: var(--bg); }

.detail-nav {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--green-dark);
}

.btn-back {
  background: none;
  border: none;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  transition: color 0.1s;
}
.btn-back:hover { color: #fff; }

.detail-body { padding: 1.75rem 1.5rem 5rem; }

.detail-chip {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--green-dark);
  border: 1px solid var(--green-dark);
  border-radius: 999px;
  padding: 0.17rem 0.65rem;
  margin-bottom: 0.9rem;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.18;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.detail-when { font-size: 0.875rem; color: #444; margin-bottom: 0.2rem; font-weight: 500; }
.detail-instructor { font-size: 0.84rem; color: #888; margin-bottom: 1.5rem; }

.detail-pending {
  display: inline-block;
  font-size: 0.77rem;
  color: var(--amber);
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.detail-desc { font-size: 0.95rem; color: #333; line-height: 1.72; margin-bottom: 1.75rem; }

.detail-location-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 0.3rem;
}

.detail-location { font-size: 0.875rem; color: #555; margin-bottom: 1.75rem; }
.detail-spots { font-size: 0.8rem; color: var(--amber); font-weight: 600; margin-bottom: 0.75rem; }

.donation-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  margin-bottom: 1.25rem;
}

.btn-in-detail {
  width: 100%;
  padding: 0.95rem;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.12s;
  letter-spacing: 0.01em;
}
.btn-in-detail:hover { background: var(--green-mid); }

.btn-come-detail {
  width: 100%;
  padding: 0.95rem;
  background: #fff;
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.12s;
}
.btn-come-detail:hover { background: var(--green-light); }

/* ── Modals ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; animation: overlayIn 0.18s ease-out; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 18px 18px 0 0;
  padding: 2rem 1.5rem 2.5rem;
  animation: modalSlideUp 0.2s cubic-bezier(0.34, 1.06, 0.64, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.modal-subtitle { font-size: 0.875rem; color: #888; margin-bottom: 1.4rem; }

.modal label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 0.35rem;
}

.modal input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1rem;
  background: var(--bg);
  font-family: var(--font-body);
  transition: border-color 0.12s;
}
.modal input:focus { outline: none; border-color: var(--green-dark); }
.modal input.error { border-color: #EF4444; }

.modal-error {
  font-size: 0.78rem;
  color: #EF4444;
  margin-top: -0.75rem;
  margin-bottom: 0.75rem;
  display: none;
}
.modal-error.visible { display: block; }

.tcpa-text { font-size: 0.7rem; color: #aaa; line-height: 1.55; margin-bottom: 0.85rem; }

.modal-actions { display: flex; gap: 0.75rem; }

.btn-submit {
  flex: 1;
  padding: 0.8rem;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.12s;
}
.btn-submit:hover { background: var(--green-mid); }
.btn-submit:disabled { background: #aaa; cursor: not-allowed; }

.btn-cancel {
  padding: 0.8rem 1.1rem;
  background: transparent;
  color: #aaa;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.12s;
}
.btn-cancel:hover { border-color: #ccc; color: #888; }

.confirmation { display: none; text-align: center; padding: 1.5rem 0 0.5rem; }
.confirmation .check { font-size: 2.25rem; color: var(--green-dark); margin-bottom: 0.75rem; }
.confirmation h2 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.4rem; }
.confirmation p { font-size: 0.875rem; color: var(--muted); line-height: 1.65; }

/* ── OTP / verification modal additions ── */
.otp-hint {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.otp-resend {
  margin-top: 1rem;
  text-align: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--green-mid); }
.btn-link:disabled { color: #aaa; cursor: not-allowed; text-decoration: none; }

.verified-phone {
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-link-inline {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.78rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link-inline:hover { color: #888; }

/* ── Teach page (teach.html) ── */
.teach-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.teach-body { padding: 2rem 1.5rem 5rem; }
.teach-eyebrow { font-size: 0.63rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: #aaa; margin-bottom: 0.6rem; }
.teach-headline { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; line-height: 1.1; color: var(--text); letter-spacing: -0.5px; margin-bottom: 0.3rem; }
.teach-subhead { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--green-dark); letter-spacing: -0.2px; margin-bottom: 1.25rem; }
.teach-desc { font-size: 0.92rem; color: #555; line-height: 1.7; margin-bottom: 2rem; border-left: 3px solid var(--green-light); padding-left: 1rem; }
.teach-divider { border: none; border-top: 1px solid var(--border); margin-bottom: 1.75rem; }

.btn-propose {
  width: 100%;
  padding: 1rem;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.12s;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: block;
  text-align: center;
}
.btn-propose:hover { background: var(--green-mid); }
