/* Global Navigation & Responsive Layout Stylesheet */
/* QR For Change design system — shared chrome tokens & components */

/* ============================================
   5.1 ROOT TOKENS
   ============================================ */
:root {
  /* Colours — QR For Change brand */
  --bg-page: rgb(237, 236, 250);        /* lavender (purple-100) */
  --brand-indigo: rgb(70, 70, 160);     /* primary brand purple (purple-700) */
  --brand-purple-600: rgb(76, 72, 164);
  --brand-purple-800: rgb(61, 60, 127);
  --brand-purple-500: rgb(96, 96, 230);
  --brand-purple-400: rgb(123, 123, 228);
  --text-primary: rgb(28, 27, 31);
  --text-secondary: rgb(121, 122, 170);
  --success: rgb(53, 197, 92);
  --success-hover: rgb(45, 175, 80);
  --danger: rgb(233, 75, 90);
  --warning: rgb(242, 169, 59);
  --border: rgb(200, 200, 245);         /* purple-200 input borders */
  --divider: rgb(237, 236, 250);
  --card: #FFFFFF;
  --input-fill: rgb(245, 244, 251);     /* purple-50 */
  --shadow: 0 4px 4px rgba(0, 0, 0, .25);

  /* Radii — two strict scales: 30px pill, 20px card */
  --r-card: 20px;
  --r-input: 30px;
  --r-pill: 30px;
  --r-tile: 20px;

  /* Typography */
  --ff: Inter, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --ff-display: Montserrat, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --fs-h1: 32px;
  --lh-h1: 38px;
  --fs-h2: 28px;
  --lh-h2: 34px;
  --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 — 77px white 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: 64px;
}

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

.brand-logo {
  height: 56px;
}

.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-family: var(--ff-display);
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  transition: background 0.15s ease-out, color 0.15s ease-out;
}

.nav-link:hover,
.nav-link:focus {
  background: rgba(70, 70, 160, .08);
  color: var(--brand-indigo);
  outline: none;
}

.nav-link[aria-current="page"] {
  background: var(--divider);
  color: var(--brand-indigo);
  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: rgb(217, 217, 217);
}

.btn.btn-outline {
  border: 2px solid var(--brand-indigo);
  border-radius: var(--r-pill);
  color: var(--brand-indigo);
  font-family: var(--ff-display);
  font-weight: 700;
  padding: 8px 18px;
  background: transparent;
  transition: background 0.15s ease-out, color 0.15s ease-out;
}

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

.btn.btn-outline:active {
  transform: scale(0.97);
}

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

.hamburger:hover,
.hamburger:focus {
  background: rgba(70, 70, 160, .08);
  outline: none;
}

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

.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.18s ease-out;
  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.15s ease-out;
}

.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.15s ease-out;
}

.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 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-link {
  color: #fff;
  text-decoration: none;
  font-family: var(--ff-display);
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
  display: block;
  transition: background 0.15s ease-out;
}

.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-family: var(--ff-display);
  font-weight: 600;
  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.15s ease-out, color 0.15s ease-out;
}

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

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

.footer-meta p {
  margin: 0;
}

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

.input:focus {
  outline: none;
  border-color: var(--brand-purple-500);
}

.btn-primary {
  background: var(--success);
  color: #fff;
  border: 0;
  border-radius: var(--r-pill);
  height: 56px;
  padding: 0 28px;
  font-weight: 700;
  font-size: var(--fs-body);
  font-family: var(--ff-display);
  cursor: pointer;
  transition: background 0.15s ease-out, transform 0.09s ease-in;
}

.btn-primary:hover {
  background: var(--success-hover);
}

.btn-primary:active {
  transform: scale(0.97);
}

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

.btn-primary[disabled] {
  background: rgb(200, 200, 245);
  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 — 77px white public nav */
@media (min-width: 1024px) {
  .hamburger {
    display: none;
  }

  .nav-desktop {
    display: block;
  }

  .header-inner {
    height: 77px;
  }

  .brand-logo {
    height: 64px;
  }

  .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: var(--r-pill);
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text-primary);
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
  text-align: center;
}

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

.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: var(--r-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgb(244, 104, 104) 0%, rgb(166, 240, 101) 100%);
  transition: width 0.3s ease-out;
  border-radius: var(--r-pill);
}

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

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

  .donation-card {
    padding: 32px;
  }
}
