/* ═══════════════════════════════════════════════════════════════
   CharityGrantWriter Design System
   Single source of truth for colours, typography, and components.
   Every page links this file; page-specific styles live in each
   page's own <style> block.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Colour palette */
  --green:        #1B6B3A;  /* Primary CTAs, active states, links */
  --green-hover:  #155230;
  --green-light:  #E8F5EE;  /* Green tinted backgrounds, badges */
  --green-border: #C6E6D4;
  --navy:         #0F2D52;  /* Headings, nav accents, footer */
  --navy-light:   #E8EEF5;  /* Navy tinted section backgrounds */
  --white:        #FFFFFF;
  --off-white:    #F7F8FA;  /* Alternate sections, zebra rows */
  --red:          #C0392B;  /* Urgency/error ONLY */
  --red-light:    #FFF5F5;
  --red-border:   #FED7D7;
  --blue:         #2B6CB0;  /* Normal deadline badges */
  --blue-light:   #EBF8FF;
  --blue-border:  #BEE3F8;
  --text-dark:    #1A1A2E;
  --text-medium:  #4A5568;
  --text-light:   #718096;
  --placeholder:  #A0AEC0;
  --border:       #E2E8F0;
  --border-dark:  #CBD5E0;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Elevation */
  --shadow-card:       0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-nav:        0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-btn-hover:  0 4px 12px rgba(27, 107, 58, 0.25);

  /* Layout */
  --radius:     8px;
  --radius-sm:  6px;
  --container:  1200px;
}

/* ── Base ──────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, .ds-h1 {
  font-weight: 700;
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--navy);
}

h2, .ds-h2 {
  font-weight: 600;
  font-size: clamp(28px, 3.5vw, 32px);
  line-height: 1.25;
  color: var(--navy);
}

h3, .ds-h3 {
  font-weight: 600;
  font-size: 19px;
  line-height: 1.4;
  color: var(--text-dark);
}

p { color: var(--text-dark); }

.ds-secondary { font-size: 14px; color: var(--text-medium); }
.ds-meta      { font-size: 13px; color: var(--text-light); }

a { color: var(--green); }

.ds-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
}

/* ── Layout helpers ────────────────────────────────────────── */
.ds-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

.ds-section        { padding: 80px 0; background: var(--white); }
.ds-section-alt    { padding: 80px 0; background: var(--off-white); }
.ds-section-navy   { padding: 80px 0; background: var(--navy-light); }
.ds-section-green  { padding: 80px 0; background: var(--green-light); }

@media (max-width: 768px) {
  .ds-container { padding: 0 20px; }
  .ds-section, .ds-section-alt, .ds-section-navy, .ds-section-green { padding: 56px 0; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
  padding: 8.5px 22.5px; /* compensate border so height matches primary */
}
.btn-secondary:hover { background: var(--green-light); }

.btn-destructive { background: var(--red); color: var(--white); }
.btn-destructive:hover { background: #A93226; }

.btn-ghost { background: transparent; color: var(--text-medium); }
.btn-ghost:hover { color: var(--text-dark); background: rgba(0, 0, 0, 0.04); }

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

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: var(--shadow-card-hover); border-color: var(--border-dark); }
.card-static:hover { box-shadow: var(--shadow-card); border-color: var(--border); }

/* Icon container inside feature cards */
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; }
.card-icon-red  { background: var(--red-light);  color: var(--red); }
.card-icon-navy { background: var(--navy-light); color: var(--navy); }

/* ── Forms ─────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-dark);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.12);
}

/* ── Badges & tags ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-match    { background: var(--green-light); color: var(--green); border: 1px solid var(--green-border); }
.badge-urgent   { background: var(--red-light);   color: var(--red);   border: 1px solid var(--red-border); }
.badge-deadline { background: var(--blue-light);  color: var(--blue);  border: 1px solid var(--blue-border); }
.badge-status   { background: var(--off-white);   color: var(--text-medium); border: 1px solid var(--border); }

/* ── Tables ────────────────────────────────────────────────── */
.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ds-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-medium);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border-dark);
}
.ds-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-dark); }
.ds-table tbody tr:nth-child(even) { background: var(--off-white); }
