/* Global Navigation & Responsive Layout Stylesheet */
/* Design Tokens, Layout, Components, and Responsive Rules */

/* ============================================
   5.1 ROOT TOKENS
   ============================================ */
:root {
  /* Colours */
  --bg-page: #ECEAF7;           /* lavender */
  --brand-indigo: #4A46A3;      /* primary */
  --text-primary: #2A2866;
  --text-secondary: #7B78A6;
  --success: #2ECC71;
  --danger: #E74C3C;
  --warning: #F5C04E;
  --border: #D5D3EA;
  --divider: #EEEAF7;
  --card: #FFFFFF;
  --shadow: 0 6px 18px rgba(42, 40, 102, .10);

  /* Radii */
  --r-card: 20px;
  --r-input: 14px;
  --r-pill: 28px;
  --r-tile: 16px;

  /* Typography */
  --ff: Inter, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --fs-h1: 26px;
  --lh-h1: 34px;
  --fs-h2: 20px;
  --lh-h2: 28px;
  --fs-body: 16px;
  --lh-body: 24px;
  --fs-cap: 13px;
  --lh-cap: 18px;

  /* Breakpoints (referenced in media queries) */
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--ff);
}

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

.hidden {
  display: none !important;
}

.no-scroll {
  overflow: hidden;
}

/* ============================================
   5.2 HEADER & DESKTOP TOP NAV
   ============================================ */
.site-header {
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 72px;
}

.nav-desktop {
  display: none;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
  background: var(--divider);
  outline: none;
}

.nav-link[aria-current="page"] {
  background: var(--divider);
  position: relative;
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--brand-indigo);
  border-radius: 2px;
}

.nav-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.btn.btn-outline {
  border: 2px solid var(--brand-indigo);
  border-radius: 20px;
  color: var(--brand-indigo);
  padding: 8px 14px;
  background: transparent;
  transition: all 0.2s ease;
}

.btn.btn-outline:hover,
.btn.btn-outline:focus {
  background: var(--brand-indigo);
  color: #fff;
}

.hamburger {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hamburger:hover,
.hamburger:focus {
  background: var(--divider);
  outline: none;
}

.hamburger .bar {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  display: block;
  transition: transform 0.2s ease;
}

.hamburger[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ============================================
   5.3 MOBILE DRAWER
   ============================================ */
.mobile-drawer {
  position: fixed;
  inset: 0 30% 0 0;
  background: var(--brand-indigo);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  box-shadow: var(--shadow);
  color: #fff;
  z-index: 1100;
}

.mobile-drawer[aria-hidden="false"] {
  transform: translateX(0);
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 1050;
  transition: opacity 0.2s ease;
}

.drawer-scrim[hidden] {
  display: none;
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.drawer-close:hover,
.drawer-close:focus {
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.nav-mobile {
  margin-top: 48px;
  overflow-y: auto;
  max-height: calc(100vh - 48px);
}

.mobile-list {
  list-style: none;
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-link {
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 12px;
  display: block;
  transition: background 0.2s ease;
}

.mobile-link:hover,
.mobile-link:focus {
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.mobile-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-sep {
  height: 1px;
  background: rgba(255, 255, 255, .25);
  margin: 8px 0;
}

/* ============================================
   5.4 FOOTER
   ============================================ */
.site-footer {
  background: var(--card);
  box-shadow: var(--shadow);
  margin-top: 32px;
}

.footer-inner {
  display: grid;
  gap: 24px;
  padding: 24px;
  grid-template-columns: 1fr;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  height: 28px;
}

.footer-tag {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-cap);
}

.footer-nav {
  /* Container for footer links */
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-list a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.footer-list a:hover,
.footer-list a:focus {
  background: var(--divider);
  outline: none;
}

.footer-meta {
  font-size: var(--fs-cap);
  color: var(--text-secondary);
}

.footer-meta p {
  margin: 0;
}

/* ============================================
   5.5 INPUTS & BUTTONS (SHARED)
   ============================================ */
.input {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  height: 56px;
  padding: 0 14px;
  font-size: var(--fs-body);
  font-family: var(--ff);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.input:focus {
  outline: 2px solid var(--brand-indigo);
  outline-offset: 0;
  border-color: transparent;
}

.btn-primary {
  background: var(--success);
  color: #fff;
  border: 0;
  border-radius: var(--r-pill);
  height: 56px;
  padding: 0 24px;
  font-weight: 700;
  font-size: var(--fs-body);
  font-family: var(--ff);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #27AE60;
  transform: translateY(-1px);
}

.btn-primary:focus {
  outline: 2px solid var(--success);
  outline-offset: 2px;
}

.btn-primary[disabled] {
  background: #D7D4FA;
  color: #fff;
  opacity: 0.9;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   5.6 RESPONSIVE RULES
   ============================================ */

/* Tablet: 768px - 1023px */
@media (min-width: 768px) {
  .mobile-drawer {
    inset: 0 50% 0 0;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-meta {
    grid-column: 1 / -1;
  }
}

/* Desktop: ≥ 1024px */
@media (min-width: 1024px) {
  .hamburger {
    display: none;
  }

  .nav-desktop {
    display: block;
  }

  .header-inner {
    height: 80px;
  }

  .brand-logo {
    height: 80px;
  }

  .footer-inner {
    grid-template-columns: 1fr auto auto;
  }

  .footer-meta {
    grid-column: auto;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .mobile-drawer,
  .drawer-scrim,
  .hamburger .bar,
  .nav-link,
  .mobile-link,
  .btn-primary {
    transition: none;
  }
}

/* ============================================
   6. DONATION FLOW PAGES
   ============================================ */

/* Donation Page Container */
.donation-page {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-page);
}

.donation-card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 24px;
  max-width: 430px;
  width: 100%;
  box-shadow: var(--shadow);
}

/* Segmented Donor Type Pills */
.donor-type-pills {
  display: flex;
  gap: 12px;
}

.donor-pill {
  flex: 1;
  padding: 12px 20px;
  border-radius: 24px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.donor-pill:hover {
  border-color: var(--brand-indigo);
}

.donor-pill.active {
  background: var(--brand-indigo);
  color: #FFFFFF;
  border-color: var(--brand-indigo);
}

/* Progress Bar Styles */
.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--divider);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 10px;
}

/* Thank You Page */
.thank-you-page {
  min-height: calc(100vh - 80px);
}

@media (min-width: 768px) {
  .donation-page {
    padding: 40px;
  }
  
  .donation-card {
    padding: 32px;
  }
}
