/* ============================================
   BLOOD BRIDGE — Global Design System
   Palette: Deep Crimson + Deep Blue + White
   Font: Plus Jakarta Sans + Instrument Serif
   ============================================ */

:root {
  --crimson:       #C0392B;
  --crimson-light: #E74C3C;
  --crimson-pale:  #FDECEA;
  --deep-blue:     #1A3A6B;
  --deep-blue-mid: #2255A4;
  --deep-blue-pale:#EAF0FB;
  --white:         #FFFFFF;
  --off-white:     #F8F6F4;
  --gray-100:      #F2F2F2;
  --gray-200:      #E0E0E0;
  --gray-400:      #9E9E9E;
  --gray-600:      #616161;
  --gray-800:      #212121;
  --text-main:     #1A1A2E;
  --text-sub:      #5A5A72;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:     0 6px 24px rgba(0,0,0,0.12);
  --shadow-lg:     0 16px 48px rgba(0,0,0,0.16);
  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-xl:     32px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--off-white);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }
sup { font-size: 0.65em; }

/* ============================================
   BACKGROUND BLOBS
   ============================================ */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.blob-top-right {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--crimson), transparent);
  top: -80px; right: -80px;
}
.blob-bottom-left {
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--deep-blue), transparent);
  bottom: -60px; left: -60px;
}

/* ============================================
   WELCOME PAGE
   ============================================ */
.welcome-page {
  background: linear-gradient(160deg, #fff5f5 0%, #f0f4ff 100%);
}
.welcome-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 40px;
  z-index: 1;
  gap: 0;
}

/* Brand */
.brand-section {
  text-align: center;
  margin-bottom: 36px;
  animation: fadeSlideDown 0.7s ease both;
}
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.brand-name {
  font-family: 'Instrument Serif', serif;
  font-size: 2.6rem;
  font-weight: 400;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1;
}
.drop { font-size: 1.8rem; animation: drip 2s ease-in-out infinite alternate; }
.drop-1 { animation-delay: 0s; }
.drop-2 { animation-delay: 0.4s; }
@keyframes drip {
  0%   { transform: translateY(0); }
  100% { transform: translateY(6px); }
}
.brand-tagline {
  font-size: 0.9rem;
  color: var(--text-sub);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Hero illustration */
.hero-illustration {
  position: relative;
  width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 44px;
  animation: fadeIn 1s ease 0.3s both;
}
.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--crimson);
  opacity: 0;
  animation: pulseRing 2.4s ease-out infinite;
}
.ring-1 { width: 60px;  height: 60px;  animation-delay: 0s; }
.ring-2 { width: 100px; height: 100px; animation-delay: 0.6s; }
.ring-3 { width: 140px; height: 140px; animation-delay: 1.2s; }
@keyframes pulseRing {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.1); opacity: 0; }
}
.heart-icon { font-size: 3rem; z-index: 1; animation: heartbeat 1.4s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.15); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.1); }
  70%       { transform: scale(1); }
}

/* CTA section */
.cta-section {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  animation: fadeSlideUp 0.7s ease 0.4s both;
}
.footer-note {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-align: center;
  animation: fadeIn 1s ease 0.8s both;
}

/* ============================================
   INNER PAGES
   ============================================ */
.inner-page { background: var(--off-white); }
.page-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  padding: 20px 24px 12px;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  transition: all 0.2s;
  flex-shrink: 0;
}
.back-btn:hover { background: var(--crimson-pale); color: var(--crimson); transform: translateX(-2px); }
.mini-brand {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 1rem; color: var(--text-main);
}
.centered-brand { margin: 0 auto; }
.drop-sm { font-size: 1.1rem; }

/* Content area */
.content-area {
  flex: 1;
  padding: 16px 24px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  animation: fadeSlideUp 0.5s ease both;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.page-title {
  font-family: 'Instrument Serif', serif;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 8px;
}
.accent-text { color: var(--crimson); font-style: italic; }
.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 28px;
  line-height: 1.5;
}
.center-text { text-align: center; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-light) 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(192,57,43,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192,57,43,0.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  background: var(--gray-200);
  color: var(--gray-400);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: var(--white);
  color: var(--text-main);
  border: 2px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--deep-blue);
  color: var(--deep-blue);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: var(--crimson);
  border: 2px solid var(--crimson);
}
.btn-outline:hover { background: var(--crimson-pale); }
.full-width { width: 100%; }
.mt-24 { margin-top: 24px; }
.mt-12 { margin-top: 12px; }

/* Deep Blue Circle Button */
.btn-circle-deep-blue {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 28px;
  border-radius: 50px;
  background: var(--deep-blue);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  border: 3px solid var(--deep-blue);
  box-shadow: 0 4px 20px rgba(26,58,107,0.35);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.2px;
}
.btn-circle-deep-blue:hover {
  background: var(--deep-blue-mid);
  border-color: var(--deep-blue-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26,58,107,0.45);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}
.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
  margin-bottom: 8px;
}
.phone-input-wrap:focus-within { border-color: var(--deep-blue); }
.country-code {
  padding: 12px 14px;
  background: var(--gray-100);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  border-right: 2px solid var(--gray-200);
  white-space: nowrap;
}
.phone-input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-main);
  background: transparent;
}
.input-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 20px;
  line-height: 1.4;
}
.text-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
  background: var(--white);
}
.text-input:focus { border-color: var(--deep-blue); }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group.half { flex: 1; }
.name-row { display: flex; gap: 12px; margin-bottom: 20px; }

/* Divider */
.divider-row {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0 16px;
}
.divider-line { flex: 1; height: 1px; background: var(--gray-200); }
.divider-text { font-size: 0.8rem; color: var(--gray-400); font-weight: 600; }
.switch-auth { font-size: 0.88rem; color: var(--text-sub); text-align: center; }
.link-text { color: var(--deep-blue); font-weight: 700; }
.link-text:hover { text-decoration: underline; }

/* ============================================
   NEW USER PAGE
   ============================================ */
.new-user-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 20px;
  margin-top: 8px;
}
.phone-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.phone-display {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.95rem; font-weight: 600; color: var(--text-main);
}
.change-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--deep-blue);
  padding: 4px 12px;
  border: 2px solid var(--deep-blue);
  border-radius: 20px;
  transition: all 0.2s;
}
.change-link:hover { background: var(--deep-blue); color: var(--white); }
.new-user-sub {
  font-size: 0.92rem;
  color: var(--text-sub);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ============================================
   REGISTER PAGE
   ============================================ */
.section-bold-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}
.register-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
}
.card-phone-row { margin-bottom: 0; }
.card-divider { height: 1px; background: var(--gray-200); margin: 16px 0; }
.otp-notice {
  font-size: 0.75rem;
  color: var(--gray-400);
  line-height: 1.5;
  margin-bottom: 16px;
}
.black-divider {
  height: 1.5px;
  background: var(--gray-800);
  margin: 20px 0 16px;
}
.already-user-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.sign-in-instead {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--deep-blue);
  transition: all 0.2s;
}
.sign-in-instead:hover { text-decoration: underline; }

/* Footer links */
.footer-links-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  margin-top: 4px;
}
.footer-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-sub);
  transition: color 0.2s;
}
.footer-link:hover { color: var(--deep-blue); text-decoration: underline; }

/* ============================================
   OTP PAGE
   ============================================ */
.otp-icon-wrap {
  display: flex; justify-content: center;
  margin-bottom: 16px; margin-top: 8px;
}
.otp-icon {
  font-size: 3rem;
  animation: bounce 1s ease infinite alternate;
}
@keyframes bounce {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}
.otp-boxes {
  display: flex; gap: 10px; justify-content: center;
  margin: 24px 0 16px;
}
.otp-box {
  width: 48px; height: 56px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
  background: var(--white);
}
.otp-box:focus { border-color: var(--deep-blue); box-shadow: 0 0 0 3px rgba(26,58,107,0.12); }
.otp-box.filled { border-color: var(--crimson); background: var(--crimson-pale); }
.otp-timer-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 8px;
}
.timer-label { font-size: 0.85rem; color: var(--text-sub); }
.timer-count {
  font-size: 0.95rem; font-weight: 800;
  color: var(--crimson);
  font-variant-numeric: tabular-nums;
}
.otp-error {
  text-align: center;
  color: var(--crimson);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--crimson-pale);
  border-radius: var(--radius-sm);
}
.resend-row {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 16px;
}
.resend-btn {
  color: var(--deep-blue);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  background: none; border: none;
  transition: opacity 0.2s;
}
.resend-btn:disabled { color: var(--gray-400); cursor: not-allowed; }
.resend-btn:not(:disabled):hover { text-decoration: underline; }

/* ============================================
   ROLE SELECT PAGE
   ============================================ */
.role-content { padding-top: 8px; }
.welcome-user-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--deep-blue-pale);
  color: var(--deep-blue);
  font-size: 0.85rem; font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  align-self: flex-start;
}
.role-cards {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 8px;
}
.role-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}
.role-card:hover {
  border-color: var(--crimson);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.role-card-icon {
  font-size: 1.8rem;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.find-icon   { background: #FFF3E0; }
.donate-icon { background: var(--crimson-pale); }
.both-icon   { background: var(--deep-blue-pale); }
.role-card-body { flex: 1; }
.role-card-title { font-size: 1rem; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.role-card-desc  { font-size: 0.8rem; color: var(--text-sub); line-height: 1.4; }
.role-card-arrow { color: var(--gray-400); flex-shrink: 0; }

/* ============================================
   BLOOD GROUP GRID
   ============================================ */
.blood-group-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.blood-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 2.5px solid var(--gray-200);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.blood-btn:hover {
  border-color: var(--crimson);
  color: var(--crimson);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(192,57,43,0.2);
}
.blood-btn.selected {
  background: var(--crimson);
  border-color: var(--crimson);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(192,57,43,0.4);
  transform: scale(1.05);
}
.blood-btn.offer-selected {
  background: var(--deep-blue);
  border-color: var(--deep-blue);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(26,58,107,0.4);
  transform: scale(1.05);
}
.selected-group-display {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}
.selected-label { font-size: 0.85rem; color: var(--text-sub); font-weight: 600; }
.selected-badge {
  font-size: 1.2rem; font-weight: 800;
  color: var(--white);
  background: var(--crimson);
  padding: 6px 16px;
  border-radius: 20px;
}
.offer-badge { background: var(--deep-blue); }
.info-note {
  font-size: 0.8rem; color: var(--text-sub);
  text-align: center; margin-top: 16px; line-height: 1.5;
}

/* Need reminder */
.need-reminder {
  display: flex; align-items: center; gap: 10px;
  background: var(--crimson-pale);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 20px;
  border-left: 4px solid var(--crimson);
}
.need-label { font-size: 0.85rem; font-weight: 600; color: var(--crimson); }
.need-badge {
  font-size: 1rem; font-weight: 800;
  color: var(--white);
  background: var(--crimson);
  padding: 3px 12px;
  border-radius: 20px;
}

/* ============================================
   MATCH PAGE
   ============================================ */
.match-content {
  align-items: center;
  text-align: center;
  padding-top: 32px;
}
.match-success-wrap {
  position: relative;
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.match-pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid #27AE60;
  opacity: 0;
  animation: pulseRing 2s ease-out infinite;
}
.r1 { width: 60px;  height: 60px;  animation-delay: 0s; }
.r2 { width: 100px; height: 100px; animation-delay: 0.5s; }
.match-icon { font-size: 3rem; z-index: 1; }
.match-title {
  font-family: 'Instrument Serif', serif;
  font-size: 2.4rem; font-weight: 400;
  margin-bottom: 10px;
}
.match-subtitle {
  font-size: 0.9rem; color: var(--text-sub);
  margin-bottom: 28px; line-height: 1.5;
  max-width: 280px;
}
.match-card {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}
.match-row {
  display: flex; align-items: center; justify-content: space-around;
  margin-bottom: 16px;
}
.match-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.match-side-label { font-size: 0.78rem; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.5px; }
.match-blood-badge {
  font-size: 1.4rem; font-weight: 800;
  color: var(--white);
  padding: 8px 20px;
  border-radius: 20px;
}
.need-color  { background: var(--crimson); }
.offer-color { background: var(--deep-blue); }
.match-swap-icon { font-size: 1.8rem; color: var(--gray-400); }
.match-divider { height: 1px; background: var(--gray-200); margin-bottom: 14px; }
.match-info-row { display: flex; justify-content: space-around; }
.match-info-item { display: flex; align-items: center; gap: 6px; }
.match-info-icon { font-size: 1rem; }
.match-info-text { font-size: 0.82rem; color: var(--text-sub); font-weight: 600; }
.donor-card {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 2px solid #E8F5E9;
}
.donor-avatar { font-size: 2rem; }
.donor-info { flex: 1; text-align: left; }
.donor-name { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.donor-detail { font-size: 0.78rem; color: var(--text-sub); }
.donor-verified {
  width: 28px; height: 28px;
  background: #27AE60;
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 380px) {
  .brand-name { font-size: 2.1rem; }
  .page-title  { font-size: 1.9rem; }
  .blood-group-grid { gap: 8px; }
  .otp-box { width: 42px; height: 50px; font-size: 1.2rem; }
}
@media (min-width: 480px) {
  .welcome-container { max-width: 420px; margin: 0 auto; }
  .page-container    { max-width: 420px; margin: 0 auto; }
}