/* Grant Guide Canada - grantguide.ca */
/* Dark theme, mobile-first, performance-optimized */

:root {
  --bg: #0f1117;
  --bg-alt: #161924;
  --bg-card: #1c2030;
  --text: #e4e8f0;
  --text-muted: #8b93a8;
  --primary: #4f8cff;
  --primary-dark: #3a6fd8;
  --accent: #22c55e;
  --accent-dark: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #2a3042;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; }

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

/* Header */
.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo-ca { color: var(--danger); }

.main-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.main-nav a { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.main-nav a:hover { color: var(--primary); text-decoration: none; }

.trust-bar { display: flex; gap: 12px; margin-left: auto; }
.trust-item {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(34,197,94,0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* Hero */
.hero {
  padding: 60px 0 50px;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 28px;
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }

.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat strong { display: block; font-size: 1.8rem; color: var(--primary); }
.hero-stats .stat span { font-size: 0.8rem; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-align: center;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-cta { background: var(--accent); color: #fff; }
.btn-cta:hover { background: var(--accent-dark); }

.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* Sections */
.section { padding: 40px 0; }
.section-alt { background: var(--bg-alt); }

.section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-cta { text-align: center; margin-top: 20px; }
.page-intro { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* Grant Cards */
.grant-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
}
.grant-card:hover { border-color: var(--primary); }

.grant-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.grant-level {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
}

.grant-status {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.status-active { background: rgba(34,197,94,0.15); color: var(--accent); }
.status-closed { background: rgba(239,68,68,0.15); color: var(--danger); }

.grant-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.grant-amount { font-size: 1.4rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.grant-deadline { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.grant-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.grant-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* City Cards */
.city-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
  text-decoration: none;
  color: var(--text);
}
.city-card:hover { border-color: var(--primary); text-decoration: none; }
.city-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.city-region { font-size: 0.85rem; color: var(--text-muted); display: block; }
.city-pop { font-size: 0.8rem; color: var(--text-muted); display: block; }
.city-count { font-size: 0.9rem; color: var(--accent); font-weight: 600; display: block; margin-top: 6px; }
.city-hook { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

/* Trade Cards */
.trade-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
}
.trade-card:hover { border-color: var(--primary); text-decoration: none; }
.trade-icon { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.trade-card h3 { font-size: 1rem; margin-bottom: 4px; }
.trade-jobs { font-size: 0.8rem; color: var(--text-muted); }

/* City/Trade Meta */
.city-meta, .trade-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.city-meta span, .trade-meta span { font-size: 0.9rem; }

/* Program Hero */
.program-hero {
  text-align: center;
  padding: 32px;
  margin-bottom: 24px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.program-amount { font-size: 2rem; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.program-level { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; }
.program-deadline { font-size: 0.95rem; color: var(--text-muted); margin-top: 8px; }

/* Steps */
.step-list { display: grid; gap: 16px; }
.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 16px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.step-num {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 50%;
}
.step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.step p { font-size: 0.9rem; color: var(--text-muted); grid-column: 2; }

/* Checklists */
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: 8px 0 8px 28px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Tables */
.table-responsive { overflow-x: auto; }
.grant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.grant-table th, .grant-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.grant-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* CTA Box */
.cta-box {
  text-align: center;
  padding: 32px;
  background: var(--bg-alt);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
}
.cta-box h3 { font-size: 1.4rem; margin-bottom: 8px; }
.cta-box p { color: var(--text-muted); margin-bottom: 16px; }

/* Email Capture */
.email-capture {
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, rgba(79,140,255,0.1), rgba(34,197,94,0.05));
  border: 1px solid var(--primary);
  border-radius: var(--radius);
}
.email-capture h3 { font-size: 1.3rem; margin-bottom: 8px; }
.email-capture p { color: var(--text-muted); margin-bottom: 16px; }

.capture-form {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.capture-form input[type="text"],
.capture-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}
.capture-form button {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
.capture-form button:hover { background: var(--accent-dark); }
.form-privacy { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

/* NSO CTA */
.nso-cta {
  margin: 32px 0;
  padding: 24px;
  background: var(--bg-alt);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.nso-cta h3 { font-size: 1.15rem; margin-bottom: 6px; }
.nso-cta p { color: var(--text-muted); margin-bottom: 12px; font-size: 0.95rem; }
.nso-phone { color: var(--text-muted); font-size: 0.9rem; margin-left: 12px; }

/* FAQ */
.faq-section { margin: 24px 0; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.faq-q {
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
}
.faq-a p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* Eligibility Checker */
.ec-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
}

.ec-progress {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 20px;
}
.ec-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ec-step { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.ec-question { font-size: 1.3rem; margin-bottom: 20px; }

.ec-options { display: grid; gap: 10px; }
.ec-option {
  display: block;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ec-option:hover {
  border-color: var(--primary);
  background: rgba(79,140,255,0.05);
}

.ec-back {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.ec-back:hover { color: var(--primary); }

.ec-results-header { text-align: center; margin-bottom: 24px; }
.ec-results-header h2 { font-size: 1.6rem; }
.ec-total { font-size: 1.2rem; color: var(--accent); margin-top: 4px; }

.ec-results-list { display: grid; gap: 16px; margin-bottom: 24px; }

.ec-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.ec-result-level {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.ec-result-card h3 { font-size: 1.1rem; margin: 4px 0; }
.ec-result-amount { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.ec-result-deadline { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0 10px; }
.ec-result-actions { display: flex; gap: 8px; }
.ec-btn-primary {
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.ec-btn-secondary {
  padding: 8px 18px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-decoration: none;
}

.ec-email-gate {
  text-align: center;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.ec-email-gate h3 { font-size: 1.2rem; margin-bottom: 6px; }
.ec-email-gate p { color: var(--text-muted); margin-bottom: 12px; }

.ec-email-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.ec-email-form input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  min-width: 160px;
}
.ec-btn-submit {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.ec-btn-submit:hover { background: var(--accent-dark); }
.ec-privacy { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

.ec-no-results { padding: 20px; }
.ec-no-results ul { margin-top: 10px; padding-left: 20px; }
.ec-no-results li { color: var(--text-muted); margin-bottom: 6px; }

.ec-restart {
  display: block;
  margin: 0 auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.ec-restart:hover { color: var(--primary); }

/* Footer */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 3px 0;
}
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
}
.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 1rem; }
  .hero-stats { gap: 16px; }
  .hero-stats .stat strong { font-size: 1.4rem; }
  .main-nav { display: none; }
  .trust-bar { display: none; }
  .grant-card { padding: 14px; }
  .step { grid-template-columns: 40px 1fr; }
  .ec-question { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .capture-form { flex-direction: column; }
  .capture-form input, .capture-form button { width: 100%; }
}

/* Info cards */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.info-card h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}
.info-card ul {
  list-style: none;
  padding: 0;
}
.info-card ul li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.5;
}
.info-card ul li:last-child { border-bottom: none; }

/* Source list - government citations */
.source-list {
  list-style: none;
  padding: 0;
}
.source-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.source-list li a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.source-list li a:hover {
  text-decoration: underline;
}

/* About / E-E-A-T section */
.about-section { margin-top: 2rem; }
.about-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}
.about-box h2 {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}
.about-box p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.about-box a {
  color: var(--primary);
}
