/* Crowdly — main stylesheet */

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

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --red: #dc2626;
  --orange: #f97316;
  --yellow: #eab308;
  --green: #22c55e;
  --dark: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --white: #ffffff;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--dark);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--blue); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-full { width: 100%; text-align: center; }

/* Hero */
.hero {
  background: var(--dark);
  color: var(--white);
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.hero-sub {
  font-size: 1.2rem;
  color: var(--gray-400);
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; }

/* Sections */
section { padding: 64px 0; }
section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.section-desc {
  color: var(--gray-600);
  margin-bottom: 32px;
}

/* Matches grid */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.match-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
}
.match-card .teams {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.match-card .venue { color: var(--gray-600); font-size: 0.85rem; margin-bottom: 4px; }
.match-card .date { color: var(--gray-600); font-size: 0.85rem; margin-bottom: 12px; }
.crowd-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.crowd-low { background: #dcfce7; color: #166534; }
.crowd-medium { background: #fef9c3; color: #854d0e; }
.crowd-high { background: #fee2e2; color: #991b1b; }

/* Heatmap grid */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.neighborhood-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.neighborhood-card .name { font-weight: 600; font-size: 0.95rem; }
.neighborhood-card .meta { color: var(--gray-600); font-size: 0.8rem; }
.risk-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--gray-200);
  overflow: hidden;
  margin-top: 4px;
}
.risk-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.risk-low .risk-fill { background: var(--green); }
.risk-medium .risk-fill { background: var(--yellow); }
.risk-high .risk-fill { background: var(--orange); }
.risk-severe .risk-fill { background: var(--red); }

/* CTA section */
.signup-cta {
  background: var(--blue);
  color: var(--white);
  text-align: center;
  padding: 64px 0;
}
.signup-cta h2 { color: var(--white); margin-bottom: 12px; }
.signup-cta p { color: rgba(255,255,255,0.8); margin-bottom: 28px; }
.signup-cta .btn-primary { background: var(--white); color: var(--blue); }
.signup-cta .btn-primary:hover { background: var(--gray-100); }

/* Business page */
.business-page { padding: 64px 0; }
.business-hero { text-align: center; margin-bottom: 48px; }
.business-hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; }
.business-hero .hero-sub { color: var(--gray-600); max-width: 500px; margin: 0 auto; }

.form-container {
  max-width: 520px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 40px;
}
.signup-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--gray-800); }
.form-group input, .form-group select {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.checkbox-group { flex-direction: row; align-items: center; gap: 10px; }
.checkbox-group input { width: 18px; height: 18px; }
.checkbox-group label { font-weight: 400; font-size: 0.9rem; }

.success-message {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 48px 40px;
}
.success-message h2 { color: var(--blue); margin-bottom: 12px; }
.success-message p { color: var(--gray-600); margin-bottom: 28px; }

.error-message {
  max-width: 520px;
  margin: 20px auto 0;
  padding: 16px 20px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  text-align: center;
}

/* Footer */
.site-footer {
  background: var(--gray-800);
  color: var(--gray-400);
  padding: 32px 0;
  text-align: center;
  font-size: 0.85rem;
}

.loading { color: var(--gray-600); font-size: 0.9rem; }

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .form-container { padding: 24px; }
}