/* Toasts, footer, scroll-to-top, How It Works, CTA styles */
/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
  max-width: 360px;
  width: calc(100% - var(--sp-12));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--clr-secondary);
  color: white;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  border-left: 4px solid transparent;
  position: relative;
  overflow: hidden;
  animation: toastIn 0.4s var(--ease-spring) both;
}

.toast.removing {
  animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(110%) scale(0.9); max-height: 0; padding: 0; margin: 0; }
}

.toast--success { border-left-color: var(--clr-accent); }
.toast--error   { border-left-color: var(--clr-error); }
.toast--warning { border-left-color: var(--clr-warning); }
.toast--info    { border-left-color: #60A5FA; }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; line-height: 1.3; }
.toast-msg { font-size: 0.8rem; opacity: 0.75; line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.toast-close:hover { color: white; }

.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: rgba(255,255,255,0.3);
  animation: toastProgress linear forwards;
  transform-origin: left;
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ============================================
   SCROLL TO TOP
   ============================================ */

.scroll-top {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-6);
  width: 44px; height: 44px;
  background: var(--clr-primary);
  color: white;
  border: none;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-red);
  z-index: var(--z-sticky);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease-spring);
  font-size: 1rem;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 10px 30px rgba(229,57,53,0.5);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background: var(--clr-secondary);
  color: rgba(255,255,255,0.85);
  padding: var(--sp-16) 0 var(--sp-8);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--clr-primary),
    var(--clr-primary-light),
    var(--clr-accent),
    var(--bg-A));
}

.footer-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 60% at 90% 50%, rgba(229,57,53,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 30% 40% at 10% 80%, rgba(34,197,94,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.footer-inner { position: relative; z-index: 1; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-12);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  text-decoration: none;
}

.footer-logo-icon {
  width: 44px; height: 44px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.footer-logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.footer-logo-text span { color: var(--clr-primary-light); }

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  max-width: 280px;
  margin-bottom: var(--sp-6);
}

.footer-social { display: flex; gap: var(--sp-3); }

.footer-social-link {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.footer-social-link:hover {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: white;
  transform: translateY(-3px);
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
}

.footer-links { display: flex; flex-direction: column; gap: var(--sp-3); }

.footer-link {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.footer-link:hover { color: white; }

.footer-blood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.footer-blood-badge {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}
.footer-blood-badge:hover { opacity: 1; transform: scale(1.08); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.825rem;
  color: rgba(255,255,255,0.4);
}

.footer-bottom-links { display: flex; gap: var(--sp-5); }
.footer-bottom-links a {
  font-size: 0.825rem;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-bottom-links a:hover { color: rgba(255,255,255,0.8); }

.footer-heart {
  color: var(--clr-primary-light);
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.3); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.3); }
  70%       { transform: scale(1); }
}

/* ============================================
   EXPORT/IMPORT SECTION
   ============================================ */

.data-section {
  padding: var(--sp-12) 0;
  background: var(--clr-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.data-section-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.data-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--txt-primary);
  margin-bottom: var(--sp-2);
}

.data-section-sub {
  font-size: 0.875rem;
  color: var(--txt-muted);
}

.data-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

#import-input { display: none; }

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */

.how-it-works-section {
  padding: var(--sp-20) 0;
  background: var(--clr-bg);
  position: relative;
  overflow: hidden;
}

.how-it-works-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}

.section-header-center {
  text-align: center;
  margin-bottom: var(--sp-12);
}

.section-kicker {
  display: inline-block;
  background: rgba(229,57,53,0.08);
  border: 1px solid rgba(229,57,53,0.2);
  color: var(--clr-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-4);
}

.section-title-center {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: var(--txt-primary);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-4);
}

.section-sub-center {
  font-size: 1rem;
  color: var(--txt-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* HIW Grid */
.hiw-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: var(--sp-4);
  align-items: start;
}

.hiw-card {
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, border-color 0.3s;
}

.hiw-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

.hiw-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(229,57,53,0.2);
}

.hiw-card:hover::before {
  transform: scaleX(1);
}

.hiw-step-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--clr-primary);
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-4);
  opacity: 0.8;
}

.hiw-icon-wrap {
  width: 64px; height: 64px;
  background: rgba(229,57,53,0.08);
  border: 1px solid rgba(229,57,53,0.15);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-5);
  transition: transform 0.3s var(--ease-spring), background 0.3s;
}

.hiw-card:hover .hiw-icon-wrap {
  transform: scale(1.1) rotate(-5deg);
  background: rgba(229,57,53,0.12);
}

.hiw-icon { font-size: 1.75rem; }

.hiw-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--txt-primary);
  margin-bottom: var(--sp-3);
}

.hiw-desc {
  font-size: 0.875rem;
  color: var(--txt-secondary);
  line-height: 1.7;
}

/* HIW connector arrows */
.hiw-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
  gap: var(--sp-2);
  color: var(--clr-primary);
  opacity: 0.5;
}

.hiw-connector-line {
  width: 1px;
  height: 30px;
  background: var(--clr-primary);
  opacity: 0.3;
  display: none;
}

.hiw-connector-arrow {
  font-size: 1.5rem;
  animation: arrowPulse 1.5s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50%       { transform: translateX(6px); opacity: 1; }
}

/* Blood type cards */
.blood-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-10);
  align-items: center;
  padding: var(--sp-8);
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-2xl);
}

.blood-info-title h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--txt-primary);
  margin-bottom: var(--sp-2);
}

.blood-info-title p {
  font-size: 0.875rem;
  color: var(--txt-muted);
}

.blood-type-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.blood-type-card {
  background: var(--clr-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  text-align: center;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.blood-type-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.btc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: white;
  margin: 0 auto var(--sp-3);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btc-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--txt-primary);
  margin-bottom: var(--sp-1);
}

.btc-desc {
  font-size: 0.72rem;
  color: var(--txt-muted);
  line-height: 1.5;
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-section {
  padding: var(--sp-20) 0;
  background: var(--clr-bg);
  position: relative;
}

.cta-inner {
  position: relative;
  background: linear-gradient(135deg,
    var(--clr-primary-dark) 0%,
    var(--clr-primary) 50%,
    #E57373 100%);
  border-radius: var(--r-2xl);
  padding: var(--sp-16) var(--sp-12);
  overflow: hidden;
  text-align: center;
}

.cta-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.cta-orb--1 {
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.12);
  top: -80px; right: -60px;
  animation: orbFloat 8s ease-in-out infinite;
}

.cta-orb--2 {
  width: 200px; height: 200px;
  background: rgba(183,28,28,0.4);
  bottom: -60px; left: -40px;
  animation: orbFloat 10s ease-in-out infinite reverse;
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-6);
}

.cta-badge-pulse {
  width: 6px; height: 6px;
  background: white;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  color: white;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--sp-5);
}

.cta-title-accent {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
}

.cta-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.8);
  max-width: 560px;
  margin: 0 auto var(--sp-8);
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}

.cta-btn-primary {
  background: white !important;
  color: var(--clr-primary) !important;
  border-color: white !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
}

.cta-btn-primary:hover {
  background: rgba(255,255,255,0.9) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25) !important;
}

.cta-btn-outline {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: var(--r-full);
  font-size: 1rem;
  font-weight: 600;
  padding: 16px var(--sp-8);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}

.cta-btn-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
  transform: translateY(-2px);
}

.cta-facts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.cta-fact {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}

.cta-fact-icon { font-size: 1rem; }

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.reveal-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-card {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
  transition-delay: var(--card-delay, 0s);
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .footer-brand { grid-column: 1 / -1; }

  .hiw-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }
  .hiw-connector {
    flex-direction: row;
    padding-top: 0;
    transform: rotate(90deg);
    margin: calc(-1 * var(--sp-2)) auto;
    justify-content: flex-end;
    align-items: center;
    height: var(--sp-10);
  }
  .hiw-connector-arrow {
    transform: rotate(-90deg);
  }

  .blood-info-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .blood-type-cards { grid-template-columns: repeat(2, 1fr); }

  .cta-inner { padding: var(--sp-12) var(--sp-8); }
}

@media (max-width: 768px) {
  .hiw-connector { display: none; }

  /* Footer text white on small screens */
  .footer-link { color: white; }
  .footer-tagline { color: white; }
  .footer-copy { color: rgba(255,255,255,0.6); }
  .footer-bottom-links a { color: rgba(255,255,255,0.6); }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .cta-inner { padding: var(--sp-10) var(--sp-6); }
  .cta-title { font-size: 1.75rem; }
  .cta-facts { gap: var(--sp-4); flex-direction: column; }

  .blood-type-cards { grid-template-columns: repeat(2, 1fr); }
}