:root {
  --primary: #DC2626;
  --primary-hover: #B91C1C;
  --primary-light: #FEF2F2;
  --primary-border: #FECACA;
  --gray-50: #F9FAFB; --gray-100: #F3F4F6; --gray-200: #E5E7EB;
  --gray-300: #D1D5DB; --gray-400: #9CA3AF; --gray-500: #6B7280;
  --gray-600: #4B5563; --gray-700: #374151; --gray-800: #1F2937; --gray-900: #111827;
  --success: #059669; --success-light: #ECFDF5; --success-border: #A7F3D0;
  --warning: #D97706; --warning-light: #FFFBEB; --warning-border: #FDE68A;
  --info: #2563EB; --info-light: #EFF6FF; --info-border: #BFDBFE;
  --danger: #DC2626; --danger-light: #FEF2F2; --danger-border: #FECACA;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-full: 9999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 150ms ease; --transition-normal: 200ms ease; --transition-slow: 300ms ease;
}
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--gray-800); background: var(--gray-50); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* ── Buttons ── */
.btn { font-weight: 600; border-radius: var(--radius-md); transition: all var(--transition-normal); letter-spacing: -0.01em; }
.btn:active { transform: translateY(1px); }
.btn-danger { background: var(--primary); border-color: var(--primary); }
.btn-danger:hover, .btn-danger:focus { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline-danger { color: var(--primary); border-color: var(--primary); }
.btn-outline-danger:hover { background: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.btn-lg { padding: 0.625rem 1.5rem; font-size: 0.9375rem; border-radius: var(--radius-md); }

/* ── Forms ── */
.form-control, .form-select { border: 1px solid var(--gray-300); border-radius: var(--radius-md); padding: 0.5rem 0.75rem; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); font-size: 0.9375rem; color: var(--gray-800); background: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220,38,38,0.1); background: #fff; }
.form-control::placeholder { color: var(--gray-400); }
.form-label { font-weight: 600; font-size: 0.875rem; color: var(--gray-700); margin-bottom: 0.375rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }

/* ── Cards ── */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: box-shadow var(--transition-normal), transform var(--transition-normal); }
.card:hover { box-shadow: var(--shadow-md); }

/* ── Tables ── */
.table { font-size: 0.875rem; }
.table thead th { background: var(--gray-50); font-weight: 600; color: var(--gray-600); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--gray-200); padding: 0.75rem 1rem; position: sticky; top: 0; z-index: 1; }
.table tbody td { padding: 0.75rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.table-hover tbody tr:hover { background: var(--gray-50); }

/* ── Badges ── */
.badge { font-weight: 600; letter-spacing: 0.01em; }

/* ── Alerts ── */
.alert { border-radius: var(--radius-md); font-size: 0.875rem; border: 1px solid transparent; }

/* ── Toast Notifications ── */
#toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; max-width: 380px; width: 100%; pointer-events: none; }
.bn-toast { pointer-events: auto; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; transform: translateX(100%); border-left: 4px solid var(--gray-400); }
.bn-toast-show { animation: toastIn 0.3s ease forwards; }
.bn-toast-hide { animation: toastOut 0.25s ease forwards; }
.bn-toast-success { border-left-color: var(--success); }
.bn-toast-error { border-left-color: var(--danger); }
.bn-toast-warning { border-left-color: var(--warning); }
.bn-toast-info { border-left-color: var(--info); }
.bn-toast-body { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 1rem; }
.bn-toast-icon { font-size: 1.125rem; flex-shrink: 0; }
.bn-toast-success .bn-toast-icon { color: var(--success); }
.bn-toast-error .bn-toast-icon { color: var(--danger); }
.bn-toast-warning .bn-toast-icon { color: var(--warning); }
.bn-toast-info .bn-toast-icon { color: var(--info); }
.bn-toast-msg { flex: 1; font-size: 0.875rem; color: var(--gray-700); line-height: 1.4; }
.bn-toast-close { background: none; border: none; font-size: 1.25rem; color: var(--gray-400); cursor: pointer; padding: 0; line-height: 1; }
.bn-toast-close:hover { color: var(--gray-600); }
.bn-toast-progress { height: 3px; background: var(--gray-100); }
.bn-toast-progress-bar { height: 100%; width: 100%; background: var(--gray-300); }
.bn-toast-success .bn-toast-progress-bar { background: var(--success); }
.bn-toast-error .bn-toast-progress-bar { background: var(--danger); }
.bn-toast-warning .bn-toast-progress-bar { background: var(--warning); }
.bn-toast-info .bn-toast-progress-bar { background: var(--info); }
@keyframes toastIn { to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(100%); } }

/* ── Fade in up animation ── */
.fade-in-up { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in-up.is-visible { opacity: 1; transform: translateY(0); }

/* ── Navbar ── */
.bn-navbar { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 0.5rem 0; position: sticky; top: 0; z-index: 1030; }
.bn-navbar .navbar-brand { font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; }
.bn-navbar .navbar-brand img { width: 32px; height: 32px; border-radius: var(--radius-full); object-fit: cover; }
.bn-navbar .nav-link { color: var(--gray-600); font-weight: 500; font-size: 0.875rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); transition: color var(--transition-fast), background var(--transition-fast); }
.bn-navbar .nav-link:hover { color: var(--gray-900); background: var(--gray-50); }
.bn-navbar .nav-link.active { color: var(--primary); font-weight: 600; }
.bn-navbar .nav-link.active::after { content: ''; display: block; height: 2px; background: var(--primary); border-radius: 2px; margin-top: 2px; }
.nav-auth-btn { padding: 0.375rem 1rem; font-size: 0.8125rem; border-radius: var(--radius-full); font-weight: 600; }

/* ── Profile dropdown ── */
.profile-trigger { display: flex; align-items: center; gap: 0.5rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-full); padding: 0.25rem 0.625rem 0.25rem 0.25rem; cursor: pointer; transition: all var(--transition-fast); }
.profile-trigger:hover { background: var(--gray-100); border-color: var(--gray-300); }
.profile-avatar { width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; }
.profile-name { font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); }

/* ── Footer ── */
.bn-footer { background: var(--gray-900); color: rgba(255,255,255,0.7); border-top: none; padding: 3rem 0 1.5rem; }
.bn-footer h5, .bn-footer h6 { color: #fff; font-weight: 700; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.bn-footer a { color: rgba(255,255,255,0.6); transition: color var(--transition-fast); }
.bn-footer a:hover { color: #fff; }
.bn-footer ul { list-style: none; padding: 0; margin: 0; }
.bn-footer ul li { margin-bottom: 0.5rem; }
.bn-footer ul li a { font-size: 0.875rem; }
.bn-footer .footer-social a { width: 36px; height: 36px; border-radius: var(--radius-full); background: rgba(255,255,255,0.1); display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.7); font-size: 1rem; transition: all var(--transition-fast); }
.bn-footer .footer-social a:hover { background: var(--primary); color: #fff; }
.bn-footer hr { border-color: rgba(255,255,255,0.1); margin: 1.5rem 0; }
.bn-footer .footer-bottom { font-size: 0.8125rem; color: rgba(255,255,255,0.4); }

/* ── Hero Section ── */
.hero-section { position: relative; min-height: 560px; display: flex; align-items: center; overflow: hidden; }
.hero-background { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%); z-index: 1; }
.hero-content-wrapper { position: relative; z-index: 2; width: 100%; padding: 3rem 0; }
.hero-title { font-size: 3rem; font-weight: 800; line-height: 1.15; color: #fff; letter-spacing: -0.02em; }
.hero-subtitle { font-size: 1.125rem; color: rgba(255,255,255,0.9); line-height: 1.6; max-width: 540px; }
.hero-section .btn { font-weight: 600; padding: 0.6rem 1.25rem; font-size: 0.875rem; border-radius: var(--radius-md); }

/* ── Stats Section (Our Impact) ── */
.stats-section {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
  overflow: hidden;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

/* Background Blur Circles */
.stats-section::before,
.stats-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}
.stats-section::before {
  top: -10%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: rgba(239, 68, 68, 0.08); /* Soft red */
}
.stats-section::after {
  bottom: -10%;
  left: -5%;
  width: 350px;
  height: 350px;
  background: rgba(236, 72, 153, 0.08); /* Soft pink */
}

.stats-container {
  position: relative;
  z-index: 1;
}

/* ── New Stat Card ── */
.stat-card-new {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 0.875rem;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 210px;
  margin: 0 auto;
  overflow: hidden;
}

/* Top accent border */
.stat-card-new::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transition: filter var(--transition-normal);
}

/* Card Accents */
.stat-card-red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card-red .stat-icon-new { color: #ef4444; background: #fef2f2; }

.stat-card-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card-green .stat-icon-new { color: #10b981; background: #ecfdf5; }

.stat-card-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card-amber .stat-icon-new { color: #f59e0b; background: #fffbeb; }

.stat-card-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card-blue .stat-icon-new { color: #3b82f6; background: #eff6ff; }

/* Hover Interactions */
.stat-card-new:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.stat-card-new:hover::before {
  filter: brightness(1.1);
}
.stat-card-new:hover .stat-icon-new {
  transform: scale(1.05);
}

.stat-icon-new {
  font-size: 1.125rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: transform var(--transition-normal);
}

.stat-value-new {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
  margin-bottom: 0.125rem;
}

.stat-title-new {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.125rem;
}

.stat-desc-new {
  font-size: 0.6875rem;
  color: var(--gray-500);
  line-height: 1.4;
}

/* Scroll Animation Classes */
.animate-slide-up {
  animation: slideUpFade 0.6s ease forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Section titles ── */
.section-title { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); letter-spacing: -0.02em; }

/* ── Blood Group Cards ── */
.blood-group-card { display: flex; flex-direction: column; align-items: center; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem 1rem; transition: all var(--transition-normal); }
.blood-group-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.blood-group-badge { width: 56px; height: 56px; border-radius: var(--radius-full); background: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; }
.blood-group-badge span { font-size: 1.25rem; font-weight: 700; color: #fff; line-height: 1; }
.donor-count-number { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); }
.donor-count-label { font-size: 0.75rem; color: var(--gray-500); font-weight: 500; }
.available-indicator { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 600; color: var(--success); padding: 0.25rem 0.5rem; background: var(--success-light); border-radius: var(--radius-full); margin-top: 0.375rem; }
.available-dot { width: 6px; height: 6px; background: var(--success); border-radius: var(--radius-full); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Blog & Content Cards ── */
.blog-card, .donor-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; transition: all var(--transition-normal); }
.blog-card:hover, .donor-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.section-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.request-card { border: 1px solid var(--gray-200); border-radius: var(--radius-md); transition: background var(--transition-fast); }
.request-card:hover { background: var(--gray-50); }

/* ── Donor List ── */
.donor-card .card-body { padding: 1rem; }
.badge-blood-group { background: var(--primary); font-size: 0.875rem; padding: 0.375rem 0.75rem; border-radius: var(--radius-sm); font-weight: 700; }

/* ── Dashboard (Admin) ── */
.admin-sidebar { width: 250px; height: 100vh; position: fixed; top: 0; left: 0; background: var(--gray-900); color: #fff; z-index: 1040; overflow-y: auto; transition: transform var(--transition-slow); }
.admin-main { margin-left: 250px; min-height: 100vh; background: var(--gray-50); }
.sidebar-brand { padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); font-weight: 700; font-size: 1rem; }
.sidebar-category { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); padding: 1.25rem 1.5rem 0.5rem; font-weight: 600; }
.sidebar-link { display: flex; align-items: center; padding: 0.5rem 1.5rem; color: rgba(255,255,255,0.65); font-size: 0.875rem; font-weight: 500; transition: all var(--transition-fast); border-left: 3px solid transparent; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: #fff; background: rgba(220,38,38,0.15); border-left-color: var(--primary); }
.sidebar-link i { margin-right: 0.75rem; font-size: 1rem; width: 1.25rem; text-align: center; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1035; }
.dash-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.dash-stat-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.status-badge { padding: 0.25rem 0.75rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }
.status-open { background: var(--warning-light); color: var(--warning); }
.status-in_progress { background: var(--info-light); color: var(--info); }
.status-fulfilled { background: var(--success-light); color: var(--success); }
.status-cancelled { background: var(--danger-light); color: var(--danger); }

/* ── Auth Pages ── */
.auth-card { max-width: 440px; margin: 0 auto; }
.auth-card .card { border: 1px solid var(--gray-200); box-shadow: var(--shadow-md); }
.auth-header-icon { width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 1rem; }
.password-wrapper { position: relative; }
.password-toggle-btn { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--gray-400); cursor: pointer; padding: 0; z-index: 5; }
.password-toggle-btn:hover { color: var(--gray-600); }
.strength-meter { margin-top: 0.375rem; }
.strength-meter .progress { height: 4px; border-radius: 2px; background: var(--gray-200); }
.strength-label { font-size: 0.75rem; margin-top: 0.25rem; }

/* ── OTP Input ── */
.otp-inputs { display: flex; gap: 0.5rem; justify-content: center; }
.otp-inputs input { width: 48px; height: 56px; text-align: center; font-size: 1.25rem; font-weight: 700; border: 2px solid var(--gray-300); border-radius: var(--radius-md); transition: border-color var(--transition-fast); }
.otp-inputs input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220,38,38,0.1); outline: none; }

/* ── Empty States ── */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state-icon { font-size: 3rem; color: var(--gray-300); margin-bottom: 1rem; }
.empty-state h5 { font-weight: 700; color: var(--gray-700); margin-bottom: 0.5rem; }
.empty-state p { color: var(--gray-500); font-size: 0.875rem; max-width: 360px; margin: 0 auto; }

/* ── Register Split Layout ── */
.split-layout { display: flex; min-height: 100vh; }
.split-left { background: var(--primary); color: #fff; flex: 0 0 38%; padding: 3rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.split-right { flex: 1; background: #fff; padding: 2.5rem; overflow-y: auto; display: flex; flex-direction: column; }
.back-btn-floating { position: absolute; top: 1.25rem; left: 1.25rem; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.15); color: #fff; border-radius: var(--radius-full); transition: background var(--transition-fast); }
.back-btn-floating:hover { background: rgba(255,255,255,0.25); color: #fff; }
.form-container { max-width: 540px; margin: auto; width: 100%; }
.reg-section-title { color: var(--primary); font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.reg-section-title::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.input-group-custom { position: relative; }
.input-group-custom .form-control, .input-group-custom .form-select { padding-left: 2.25rem; }
.input-group-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); z-index: 5; font-size: 0.875rem; }
.feature-item { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.feature-icon { width: 40px; height: 40px; border-radius: var(--radius-full); background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; font-size: 1.125rem; flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .admin-main { margin-left: 0; }
  .split-layout { flex-direction: column; }
  .split-left { flex: none; padding: 2rem 1.5rem; }
}
@media (max-width: 767.98px) {
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-section { min-height: 400px; }
  .section-title { font-size: 1.375rem; }
  .stat-value { font-size: 1.5rem; }
  .stat-card { padding: 1rem; }
  .bn-footer { text-align: center; }
  .otp-inputs input { width: 42px; height: 48px; font-size: 1.125rem; }
}
@media (max-width: 575.98px) {
  .hero-title { font-size: 1.625rem; }
  .hero-section { min-height: 340px; }
  .hero-section .btn { font-size: 0.8125rem; padding: 0.5rem 0.875rem; }
  .blood-group-badge { width: 48px; height: 48px; }
  .blood-group-badge span { font-size: 1rem; }
  #toast-container { left: 1rem; right: 1rem; max-width: none; }
}
