/* =====================================================================
   Jibon Care BD - Design Tokens & Core Styles
   -----------------------------------------------------------------
   Palette (named):
     --maroon        #A11D33  primary / urgency / brand actions
     --bottle-green  #0B4F3C  secondary / "available" & success states
     --ivory         #FAF7F2  page background
     --ink           #211D1D  body text
     --clay          #EDE7E1  card/section surfaces, borders
     --amber         #E8A33D  critical/urgent badges (distinct from brand red)

   Type:
     Display - "Fraunces" (headings, hero, page titles) - used sparingly
     Body/UI - "Inter" (forms, tables, nav, dashboard content)
     Bangla fallback - "Noto Sans Bengali" (name_bn / local-language text)
   ===================================================================== */

:root {
  --maroon: #A11D33;
  --maroon-dark: #7A1526;
  --bottle-green: #0B4F3C;
  --bottle-green-dark: #083B2C;
  --ivory: #FAF7F2;
  --ink: #211D1D;
  --clay: #EDE7E1;
  --amber: #E8A33D;

  --font-display: "Fraunces", "Noto Serif Bengali", Georgia, serif;
  --font-body: "Inter", "Noto Sans Bengali", -apple-system, Segoe UI, Roboto, sans-serif;

  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-soft: 0 8px 30px rgba(33, 29, 29, 0.08);
}

* { box-sizing: border-box; }

body {
  background-color: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}

h1, h2, h3, h4, .brand-font {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--bottle-green); text-decoration: none; }
a:hover { color: var(--bottle-green-dark); text-decoration: underline; }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn-brand {
  background-color: var(--maroon);
  border-color: var(--maroon);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
}
.btn-brand:hover, .btn-brand:focus {
  background-color: var(--maroon-dark);
  border-color: var(--maroon-dark);
  color: #fff;
}
.btn-outline-brand {
  border: 1.5px solid var(--maroon);
  color: var(--maroon);
  background: transparent;
  font-weight: 600;
  border-radius: var(--radius-md);
}
.btn-outline-brand:hover {
  background-color: var(--maroon);
  color: #fff;
}
.btn-brand:focus-visible, .btn-outline-brand:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Top navbar
   --------------------------------------------------------------- */
.ll-navbar {
  background-color: #fff;
  border-bottom: 1px solid var(--clay);
}
.ll-navbar .navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--maroon);
  font-size: 1.35rem;
}
.ll-navbar .nav-link {
  color: var(--ink);
  font-weight: 500;
}
.ll-navbar .nav-link.active,
.ll-navbar .nav-link:hover {
  color: var(--maroon);
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.ll-footer {
  background-color: var(--ink);
  color: #EDE7E1;
  margin-top: 4rem;
}
.ll-footer a { color: #EDE7E1; opacity: 0.85; }
.ll-footer a:hover { opacity: 1; color: #fff; }
.ll-footer .footer-heading {
  font-family: var(--font-display);
  color: #fff;
  font-weight: 600;
}

/* ---------------------------------------------------------------
   Auth pages: split-screen layout with signature pulse-line
   --------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
}
.auth-brand-panel {
  position: relative;
  width: 42%;
  min-width: 340px;
  background: linear-gradient(165deg, var(--maroon-dark) 0%, var(--ink) 100%);
  color: #fff;
  padding: 3rem 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-brand-panel .brand-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  z-index: 2;
  position: relative;
}
.auth-brand-panel .brand-tagline {
  color: #EDE0D9;
  max-width: 320px;
  z-index: 2;
  position: relative;
}
.auth-stats {
  z-index: 2;
  position: relative;
  display: flex;
  gap: 2rem;
}
.auth-stats .stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--amber);
  display: block;
}
.auth-stats .stat-label {
  font-size: 0.78rem;
  color: #EDE0D9;
  opacity: 0.85;
}

/* The signature element: a continuous ECG / pulse line tracing down
   the brand panel - literal to "life" and blood/heart health without
   resorting to a stock blood-drop icon. */
.pulse-line-wrap {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  z-index: 1;
}
.pulse-line-wrap svg { width: 100%; height: 100%; }
.pulse-path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-pulse 4.5s ease-in-out infinite;
}
@keyframes draw-pulse {
  0%   { stroke-dashoffset: 1400; }
  55%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1400; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-path { animation: none; stroke-dashoffset: 0; }
}

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background-color: var(--ivory);
}
.auth-form-card {
  width: 100%;
  max-width: 460px;
  animation: fade-up 0.45s ease-out;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.7;
  text-decoration: none;
}
.back-link:hover { opacity: 1; color: var(--maroon); text-decoration: none; }

.auth-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--maroon);
}
.auth-form-card h1 {
  font-size: 1.9rem;
  margin-bottom: 0.25rem;
}
.auth-form-card .form-label {
  font-weight: 600;
  font-size: 0.9rem;
}
.auth-form-card .form-control,
.auth-form-card .form-select {
  border-radius: var(--radius-md);
  border-color: #DCD3C8;
  padding: 0.65rem 0.9rem;
}
.auth-form-card .form-control:focus,
.auth-form-card .form-select:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(161, 29, 51, 0.12);
}

/* Role-choice cards (register page): a meaningful branching choice,
   not a decorative pill list. */
.role-choice { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }
.role-choice input[type="radio"] { display: none; }
.role-choice label {
  flex: 1;
  border: 1.5px solid var(--clay);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.role-choice label strong { display: block; font-size: 0.95rem; }
.role-choice label span { font-size: 0.78rem; color: #6b625c; }
.role-choice input[type="radio"]:checked + label {
  border-color: var(--maroon);
  background-color: #FBEFEF;
}

.donor-fields {
  border-left: 3px solid var(--bottle-green);
  padding-left: 1rem;
  margin: 1rem 0 1.25rem;
  background-color: #F3F7F5;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding-top: 0.75rem;
  padding-bottom: 0.5rem;
}

.status-badge-available { background-color: var(--bottle-green); color: #fff; }
.status-badge-urgent { background-color: var(--amber); color: var(--ink); }
.status-badge-critical { background-color: var(--maroon); color: #fff; }

@media (max-width: 860px) {
  .auth-shell { flex-direction: column; }
  .auth-brand-panel {
    width: 100%;
    min-width: 0;
    padding: 1.75rem 1.5rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .auth-stats { display: none; }
  .auth-brand-panel .brand-tagline { display: none; }
}

/* ---------------------------------------------------------------
   Dashboard shell (used by role dashboards from Module 2 onward,
   included now so auth redirects land somewhere styled consistently)
   --------------------------------------------------------------- */
.dash-shell { min-height: 100vh; }
.dash-sidebar {
  background-color: #fff;
  border-right: 1px solid var(--clay);
  min-height: 100vh;
  width: 250px;
  flex-shrink: 0;
}
.dash-sidebar .nav-link {
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.2rem;
  font-weight: 500;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.dash-sidebar .nav-link:not(.active):not(.disabled):hover {
  background-color: var(--clay);
}
.dash-sidebar .nav-link.active {
  background-color: #FBEFEF;
  color: var(--maroon);
  border-left-color: var(--maroon);
  font-weight: 600;
}
.dash-sidebar .nav-link.disabled { opacity: 0.45; cursor: default; }
.dash-sidebar .sidebar-icon { flex-shrink: 0; opacity: 0.8; }
.dash-sidebar .nav-link.active .sidebar-icon { opacity: 1; }
.dash-sidebar-footer { border-top: 1px solid var(--clay); }

.avatar-chip {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.dash-topbar {
  background-color: #fff;
  border-bottom: 1px solid var(--clay);
  position: sticky;
  top: 0;
  z-index: 5;
}
.dash-card {
  background: #fff;
  border: 1px solid var(--clay);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
a.text-decoration-none .dash-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.text-decoration-none:hover .dash-card {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(33, 29, 29, 0.1);
}

@media (max-width: 991.98px) {
  .dash-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 1040;
    box-shadow: 0 0 0 100vmax rgba(0,0,0,0);
  }
  .dash-sidebar.dash-sidebar-open {
    transform: translateX(0);
    box-shadow: 0 0 0 100vmax rgba(33,29,29,0.35);
  }
}

/* ---------------------------------------------------------------
   Print support (Reports page "Print" button)
   --------------------------------------------------------------- */
@media print {
  .dash-sidebar, .dash-topbar, .no-print, form, .btn { display: none !important; }
  main { width: 100% !important; }
  .dash-card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  body { background: #fff !important; }
}
