/* =============================================================================
   PlatformWatch website — shared styles
   =============================================================================
   These styles are shared by every page (landing, map, legal pages).

   The colour and spacing values below are copied straight from the mobile app's
   design system in lib/theme.js, so the website and the app look like the same
   product. If you ever change a colour in the app, change it here too.

   We use CSS "custom properties" (the --name variables in :root). Think of them
   as named values you set once and reuse everywhere with var(--name).
   ============================================================================= */

:root {
  /* ---- Colours (from lib/theme.js light palette) ---- */
  --navy: #0F172A;
  --navy-soft: #1E293B;

  --background: #F8FAFC;   /* off-white page background */
  --surface: #FFFFFF;      /* cards and panels */
  --border: #E2E8F0;       /* hairline borders / dividers */

  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-on-dark: #F8FAFC; /* text sitting on a navy background */
  --text-muted: #94A3B8;

  --accent: #2563EB;       /* primary blue, for main actions/links */
  --accent-soft: #DBEAFE;

  --alert: #DC2626;        /* red, reserved for active reports/alerts */
  --alert-soft: #FEE2E2;

  --confirm: #16A34A;      /* green, for confirm/positive */
  --confirm-soft: #DCFCE7;

  /* Officer-type colours (same as the app) */
  --rpo: #D97706;
  --plain-rpo: #B45309;
  --btp: #7C3AED;

  /* Staff role badge colours (owner/admin/moderator) */
  --role-owner: #7C3AED;
  --role-admin: #DC2626;
  --role-moderator: #2563EB;

  /* Leaderboard medal colours (top 3) */
  --medal-gold: #D4AF37;
  --medal-silver: #9CA3AF;
  --medal-bronze: #CD7F32;

  /* ---- Spacing scale (from lib/theme.js) ---- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;

  /* ---- Corner radius scale ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* A soft shadow matching the app's card shadow. */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);

  /* One font family throughout — the system default stack (fast, native feel). */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  /* Max width for centred page content. */
  --content-width: 1080px;
}

/* ---- Base / reset --------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 var(--space-md);
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.875rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 var(--space-md); }

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

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

/* A centred container used by most sections. */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* ---- Buttons (mirrors components/Button.js variants) ---------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 48px;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.06s ease, background-color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* A clean, on-brand focus ring — replaces the browser's default outline, which
   can show as a clashing gold/orange glow around the blue button. */
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
.btn-primary:hover { background: #1D4ED8; }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--background); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.btn-danger {
  background: var(--alert);
  border-color: var(--alert);
  color: #FFFFFF;
}

.btn-block { width: 100%; }

/* ---- Site header ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
}
.brand:hover { text-decoration: none; }
.brand .brand-mark { width: 28px; height: 28px; display: block; border-radius: 6px; object-fit: cover; }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
/* Plain text links in the nav use the muted colour. The :not(.btn) is important:
   without it this rule out-ranks .btn-primary and turns the "Live map" button's
   text grey instead of white (grey-on-blue is hard to read). Buttons keep their
   own colours. */
.site-nav a:not(.btn) {
  color: var(--text-secondary);
  font-weight: 500;
}
.site-nav a:not(.btn):hover { color: var(--text-primary); text-decoration: none; }

/* Nav links live inside .nav-menu (a flex row on desktop). On mobile they
   collapse into a dropdown opened by the hamburger (.nav-toggle). It's a CSS-only
   toggle (a hidden checkbox) so it works even on pages with no JavaScript. */
.nav-menu { display: flex; align-items: center; gap: var(--space-lg); }
.nav-toggle, .nav-toggle-cb { display: none; }

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

.site-footer {
  background: var(--navy);
  color: var(--text-on-dark);
  padding: var(--space-3xl) 0;
  margin-top: var(--space-3xl);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xl);
  justify-content: space-between;
}
.site-footer h4 {
  margin: 0 0 var(--space-sm);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-on-dark); opacity: 0.85; }
.site-footer a:hover { opacity: 1; }
.site-footer .footer-links { display: flex; flex-direction: column; gap: var(--space-xs); }
.site-footer .footer-tagline { max-width: 320px; opacity: 0.8; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- Social links (TikTok / Discord) ------------------------------------- */
.social-links { display: inline-flex; align-items: center; gap: var(--space-xs); }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.social-links a:hover { color: var(--text-primary); background: var(--background); text-decoration: none; }
.social-links svg { width: 20px; height: 20px; fill: currentColor; }

/* On the dark footer the icons are light. */
.site-footer .social-links { margin-top: var(--space-md); }
.site-footer .social-links a { color: var(--text-on-dark); opacity: 0.8; }
.site-footer .social-links a:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }

/* ---- Hero (landing) ------------------------------------------------------- */

.hero {
  background:
    radial-gradient(1200px 400px at 70% -10%, rgba(37, 99, 235, 0.12), transparent),
    var(--background);
  padding: var(--space-3xl) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-3xl);
  align-items: center;
}
.hero h1 { font-size: 3rem; margin-bottom: var(--space-lg); }
.hero .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}
.hero .lede {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 36ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ---- "Coming soon" store badges (NOT the trademarked store artwork) ------- */

.store-badges { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-xl); }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  min-width: 200px;
  cursor: default;
  position: relative;
}
.store-badge .store-icon { width: 26px; height: 26px; flex: none; }
.store-badge .store-small { font-size: 0.7rem; color: var(--text-muted); display: block; line-height: 1.1; }
.store-badge .store-big { font-size: 1.05rem; font-weight: 600; display: block; line-height: 1.2; }
.store-badge .soon {
  position: absolute;
  top: -10px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* The phone mockup on the right of the hero (pure CSS, no screenshot needed). */
.phone {
  margin: 0 auto;
  width: 270px;
  height: 540px;
  border-radius: 40px;
  background: var(--navy);
  padding: 14px;
  box-shadow: var(--shadow-lg);
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: linear-gradient(160deg, #0B1220, #1E293B);
  overflow: hidden;
  position: relative;
  color: var(--text-on-dark);
}
.phone-map {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 30px 30px;
}
.phone-pin {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
}
.phone-pin.red { background: var(--alert); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.25); }
.phone-pin.grey { background: var(--text-muted); }

/* ---- Generic section + feature cards -------------------------------------- */

.section { padding: var(--space-3xl) 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto var(--space-2xl); }
.section-head p { color: var(--text-secondary); font-size: 1.1rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: var(--space-sm); }
.card p { color: var(--text-secondary); margin: 0; }
.card .card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-lg);
}
.card .card-icon svg { width: 24px; height: 24px; }

/* Numbered "how it works" steps. */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
/* Leave room on the left for the numbered circle PLUS a gap, so the heading
   text never touches the circle. Circle is 32px + ~16px breathing room. */
.step { position: relative; padding-left: 48px; min-height: 32px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
/* Nudge the heading down so its text visually centres against the circle. */
.step h3 { margin-bottom: var(--space-xs); line-height: 32px; }
.step p { color: var(--text-secondary); margin: 0; }

/* A reassuring "what this is / isn't" callout. */
.callout {
  background: var(--accent-soft);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.callout p { margin: 0; color: var(--navy-soft); font-size: 1.05rem; }

/* ---- Legal / long-form text pages ---------------------------------------- */

.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
}
.prose h1 { margin-bottom: var(--space-lg); }
.prose h2 { font-size: 1.4rem; margin-top: var(--space-2xl); }
.prose ul { padding-left: var(--space-xl); }
.prose li { margin-bottom: var(--space-xs); }
.prose .muted { color: var(--text-secondary); font-style: italic; }
.prose .note {
  background: var(--alert-soft);
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  color: var(--navy-soft);
}

/* ---- Badges (officer types + staff roles) -------------------------------- */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}
.role-badge { margin-left: 6px; }

/* ---- Leaderboard page ----------------------------------------------------- */

.leaderboard { max-width: 720px; margin: 0 auto; padding: var(--space-2xl) var(--space-xl); }
.leaderboard h1 { margin-bottom: var(--space-xs); }
.leaderboard .lb-intro { color: var(--text-secondary); margin-bottom: var(--space-xl); }

/* "Your rank" banner shown to the signed-in user. */
.rank-banner {
  display: flex; align-items: center; gap: var(--space-lg);
  background: var(--accent-soft); border: 1px solid #BFDBFE;
  border-radius: var(--radius-lg); padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}
.rank-banner .rb-rank { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.rank-banner .rb-text { color: var(--navy-soft); }
.rank-banner .rb-text strong { color: var(--navy); }

/* One row of the table. */
.lb-row {
  display: flex; align-items: center; gap: var(--space-md);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
}
.lb-row.me { border-color: var(--accent); background: var(--accent-soft); }

/* The rank disc — plain for 4th+, metallic for the top three. */
.lb-rank {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem;
  background: var(--background); color: var(--text-secondary);
  border: 2px solid var(--border);
}
.lb-rank.gold   { background: var(--medal-gold);   color: #fff; border-color: var(--medal-gold); }
.lb-rank.silver { background: var(--medal-silver); color: #fff; border-color: var(--medal-silver); }
.lb-rank.bronze { background: var(--medal-bronze); color: #fff; border-color: var(--medal-bronze); }

.lb-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }

.lb-name { flex: 1; min-width: 0; }
.lb-name .nm { font-weight: 600; display: flex; align-items: center; }
.lb-name .hd { font-size: 0.85rem; color: var(--text-secondary); }

.lb-count { flex: none; text-align: right; }
.lb-count .n { display: block; font-weight: 800; color: var(--accent); font-size: 1.15rem; }
.lb-count .l { display: block; font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

.lb-locked { text-align: center; padding: var(--space-3xl) var(--space-md); }
.lb-locked .lock-icon { width: 48px; height: 48px; margin: 0 auto var(--space-md); color: var(--accent); }

/* ---- Account page --------------------------------------------------------- */

.account { max-width: 640px; margin: 0 auto; padding: var(--space-2xl) var(--space-xl); }

.account-header { text-align: center; margin-bottom: var(--space-xl); }
.acct-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: var(--space-md);
}
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-name { font-size: 1.6rem; margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.acct-handle { color: var(--text-secondary); margin: 2px 0 0; }
.acct-email { color: var(--text-muted); font-size: 0.9rem; margin: 4px 0 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-md) var(--space-xs);
  text-align: center;
}
.stat-card .sv { display: block; font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.stat-card .sl { display: block; font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }

.acct-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.acct-section h2 { font-size: 1.2rem; margin: 0 0 var(--space-lg); }
.acct-field { margin-bottom: var(--space-lg); }
.acct-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.acct-field input {
  width: 100%; padding: var(--space-md); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 1rem; font-family: inherit;
}
.acct-field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.acct-hint { font-size: 0.8rem; color: var(--text-muted); margin: 4px 0 0; }
.acct-msg { min-height: 1.2em; font-size: 0.9rem; margin-bottom: var(--space-sm); }

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Utility -------------------------------------------------------------- */

.text-center { text-align: center; }
.muted { color: var(--text-secondary); }
.hidden { display: none !important; }
.spacer-lg { height: var(--space-3xl); }

/* =============================================================================
   MAP PAGE (map.html) — full-screen map, station panel, login modal
   ============================================================================= */

/* The map page fills the whole viewport; the body must not scroll. */
body.map-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

#map {
  flex: 1;
  width: 100%;
  z-index: 1;            /* keep below the header/panel/modal */
  background: var(--background);
}

/* A small floating hint over the map (e.g. "Zoom in to see stations"). */
.map-hint {
  position: absolute;
  top: calc(64px + var(--space-md));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-sm) var(--space-lg);
  box-shadow: var(--shadow-card);
  font-size: 0.9rem;
  color: var(--text-secondary);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

/* A small map legend (bottom-left). */
.map-legend {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--space-lg);
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-card);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.map-legend .row { display: flex; align-items: center; gap: var(--space-sm); }
.map-legend .row + .row { margin-top: 4px; }
.map-legend .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.map-legend .dot.red { background: var(--alert); }
.map-legend .dot.grey { background: var(--text-muted); }

/* ---- Station report panel (slides in from the right) ---------------------- */

.panel {
  position: fixed;
  top: 64px;                       /* sit below the header */
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}
.panel.open { transform: translateX(0); }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 1.25rem; margin: 0; }
.panel-header .panel-sub { color: var(--text-secondary); font-size: 0.85rem; margin: 2px 0 0; }
.panel-close {
  border: none;
  background: var(--background);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  flex: none;
}
.panel-body { padding: var(--space-lg); overflow-y: auto; flex: 1; }

/* The "sign in to see reports" prompt inside the panel. */
.panel-locked { text-align: center; padding: var(--space-2xl) var(--space-md); }
.panel-locked .lock-icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--space-md);
  color: var(--accent);
}
.panel-locked p { color: var(--text-secondary); }

/* ---- A single report card (mirrors components/ReportCard.js) -------------- */

.report-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.report-card .types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-sm); }
.report-card .meta { display: flex; align-items: center; gap: var(--space-sm); font-size: 0.85rem; color: var(--text-secondary); margin-bottom: var(--space-sm); }
.report-card .meta .author { font-weight: 600; color: var(--text-primary); }
.report-card .note { margin: var(--space-sm) 0; color: var(--text-primary); }
.report-card .photo-locked {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--background);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  margin: var(--space-sm) 0;
}

/* Confirm / dismiss vote buttons. */
.votes { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); }
.vote-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
}
.vote-btn.confirm.active { background: var(--confirm-soft); border-color: var(--confirm); color: var(--confirm); }
.vote-btn.deny.active { background: var(--alert-soft); border-color: var(--alert); color: var(--alert); }
.vote-btn:disabled { opacity: 0.6; cursor: default; }

/* ---- Login / sign-up modal ----------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: var(--space-2xl);
}
.modal h2 { margin-top: 0; }
.modal .field { margin-bottom: var(--space-md); }
.modal label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.modal input {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
}
.modal input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.modal .form-error { color: var(--alert); font-size: 0.85rem; margin: var(--space-sm) 0; min-height: 1.2em; }
.modal .switch { text-align: center; margin: var(--space-md) 0 0; font-size: 0.9rem; color: var(--text-secondary); }
.modal .switch button { background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.modal .modal-note { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: var(--space-md); }

/* OAuth provider buttons (Continue with Google / Apple). */
.oauth-buttons { display: flex; flex-direction: column; gap: var(--space-sm); }
.oauth-btn { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text-primary); }
.oauth-btn:hover { background: var(--background); }
.oauth-btn svg { flex: none; }
.oauth-apple { background: #000000; border-color: #000000; color: #FFFFFF; }
.oauth-apple:hover { background: #1A1A1A; }
.oauth-divider {
  display: flex; align-items: center; gap: var(--space-md);
  margin: var(--space-md) 0; color: var(--text-muted); font-size: 0.85rem;
}
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* The signed-in header area: the user pill + "Log out" button. This must be a
   flex container itself (it's a <span>) so its children line up vertically with
   each other and with the taller button — otherwise they align by text baseline
   and the username sits slightly off. */
#auth-controls { display: inline-flex; align-items: center; gap: var(--space-md); }

/* The current-user pill in the header (when signed in). */
.user-pill { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); font-size: 0.9rem; white-space: nowrap; }
.user-pill strong { color: var(--text-primary); font-weight: 600; }

/* ---- Responsive ----------------------------------------------------------- */

@media (max-width: 860px) {
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero .phone { display: none; }       /* keep the hero compact on phones */
  .cards, .steps { grid-template-columns: 1fr; }

  /* Show the hamburger; turn the nav links into a dropdown panel. */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-right: -8px;
    cursor: pointer; color: var(--text-primary);
  }
  .nav-menu {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: var(--space-md);
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-card); padding: var(--space-lg) var(--space-xl);
  }
  .nav-toggle-cb:checked ~ .nav-menu { display: flex; }
  .nav-menu .btn { width: 100%; }
  #auth-controls { width: 100%; }

  /* On phones the report panel becomes a bottom sheet. */
  .panel {
    top: auto;
    width: 100%;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  .panel.open { transform: translateY(0); }
}
