/* HeartByte design system — layered on existing pages without renaming IDs */

:root {
  --hb-green-50: #f3fbf5;
  --hb-green-100: #e4f5e8;
  --hb-green-200: #c8e6c9;
  --hb-green-300: #a5d6a7;
  --hb-green-400: #66bb6a;
  --hb-green-500: #43a047;
  --hb-green-600: #2e7d32;
  --hb-green-700: #1b5e20;
  --hb-green-800: #144a19;
  --hb-ink: #122018;
  --hb-muted: #5c6b61;
  --hb-line: rgba(46, 125, 50, 0.16);
  --hb-surface: rgba(255, 255, 255, 0.86);
  --hb-surface-strong: #ffffff;
  --hb-shadow: 0 18px 50px rgba(20, 74, 25, 0.12);
  --hb-shadow-lg: 0 28px 80px rgba(20, 74, 25, 0.18);
  --hb-radius: 22px;
  --hb-radius-sm: 14px;
  --hb-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --hb-display: "Montserrat", "Plus Jakarta Sans", sans-serif;
  --hb-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html.dark,
body.dark {
  --hb-ink: #eef6ef;
  --hb-muted: #b7c5ba;
  --hb-line: rgba(165, 214, 167, 0.18);
  --hb-surface: rgba(18, 36, 24, 0.82);
  --hb-surface-strong: #16301d;
  --hb-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --hb-shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.45);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--hb-font);
  color: var(--hb-ink);
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(165, 214, 167, 0.45), transparent 55%),
    radial-gradient(900px 500px at 110% 0%, rgba(46, 125, 50, 0.16), transparent 50%),
    linear-gradient(180deg, #f4fbf6 0%, #e8f5e9 42%, #f7fbf8 100%);
  background-attachment: fixed;
}

html.dark body,
body.dark {
  background:
    radial-gradient(1000px 520px at -10% -20%, rgba(46, 125, 50, 0.28), transparent 55%),
    radial-gradient(800px 420px at 110% 10%, rgba(27, 94, 32, 0.35), transparent 50%),
    linear-gradient(180deg, #0c1610 0%, #102016 50%, #0b140f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(46, 125, 50, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 125, 50, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

.font-brand,
.hb-brand {
  font-family: var(--hb-display) !important;
  letter-spacing: -0.03em;
}

/* Navbar */
.navbar {
  background: color-mix(in srgb, var(--hb-green-200) 55%, white) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--hb-line);
  box-shadow: 0 8px 30px rgba(27, 94, 32, 0.08) !important;
  min-height: 84px !important;
  padding: 10px 0 !important;
}

body.dark .navbar {
  background: rgba(18, 42, 26, 0.78) !important;
}

.navbar.hb-nav-scrolled {
  min-height: 72px !important;
  box-shadow: 0 10px 36px rgba(27, 94, 32, 0.14) !important;
}

.hb-nav-link {
  position: relative;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  padding: 0.55rem 0.95rem !important;
  border-radius: 999px !important;
  color: var(--hb-green-800) !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  transition: background 0.25s var(--hb-ease), color 0.25s var(--hb-ease), transform 0.25s var(--hb-ease);
}

.text-center > .hb-pill {
  margin-left: auto;
  margin-right: auto;
}

.hb-nav-link:hover,
.hb-nav-link.active,
.hb-nav-link.nav-item.active {
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--hb-green-700) !important;
  transform: translateY(-1px);
}

body.dark .hb-nav-link {
  color: var(--hb-green-300) !important;
}

body.dark .hb-nav-link:hover,
body.dark .hb-nav-link.active {
  background: rgba(46, 125, 50, 0.28) !important;
  color: #dcfce7 !important;
}

/* Do not paint every button green */
#themeToggle,
.btn-ghost,
.btn.btn-circle,
.navbar button.btn-ghost,
.navbar .btn-circle,
button#hb-menu-btn,
button#mobileMenuButton {
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  color: var(--hb-green-700) !important;
}

body.dark #themeToggle,
body.dark .btn-ghost,
body.dark .btn.btn-circle {
  color: var(--hb-green-300) !important;
}

#themeToggle {
  border: 1px solid var(--hb-line) !important;
  background: rgba(255, 255, 255, 0.55) !important;
  transition: transform 0.3s var(--hb-ease), background 0.3s ease;
}

#themeToggle:hover {
  transform: rotate(18deg) scale(1.06);
}

/* Cards & sections */
.card,
.section,
.hb-panel,
.bg-white.rounded-2xl,
.bg-white.rounded-lg,
.bg-white.p-6,
.bg-white.p-8,
.dark\:bg-gray-800 {
  border: 1px solid var(--hb-line) !important;
  box-shadow: var(--hb-shadow) !important;
  border-radius: var(--hb-radius) !important;
  background: var(--hb-surface-strong);
}

.hb-panel {
  backdrop-filter: blur(16px);
  padding: 1.75rem;
}

.hb-auth-main .card:hover,
form .card:hover,
.hb-panel:hover {
  transform: none;
}

section[id] {
  scroll-margin-top: 104px;
}

.hb-section-kicker {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.75rem;
}

.hb-empty {
  text-align: center;
  padding: 2.25rem 1rem;
  color: var(--hb-muted);
  border: 1px dashed var(--hb-line);
  border-radius: var(--hb-radius-sm);
  background: rgba(255, 255, 255, 0.4);
}

.hb-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  color: var(--hb-green-700) !important;
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid var(--hb-line) !important;
  box-shadow: none !important;
  margin: 0 !important;
  transition: transform 0.25s var(--hb-ease), background 0.25s ease;
}

.hb-btn-ghost:hover {
  transform: translateY(-1px);
  background: #fff !important;
}

input,
select,
textarea,
.input {
  border-radius: 14px !important;
  border-color: var(--hb-line) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

body.dark input,
body.dark select,
body.dark textarea,
body.dark .input {
  background: rgba(12, 24, 16, 0.72) !important;
  color: #eef6ef !important;
}

input:focus,
select:focus,
textarea:focus,
.input:focus {
  border-color: var(--hb-green-500) !important;
  box-shadow: 0 0 0 4px rgba(67, 160, 71, 0.16) !important;
  transform: translateY(-1px);
}

button.btn-primary,
.btn-primary,
a.btn-primary {
  background: linear-gradient(135deg, #43a047, #1b5e20) !important;
  border: none !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 24px rgba(46, 125, 50, 0.28) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  transition: transform 0.25s var(--hb-ease), box-shadow 0.25s var(--hb-ease) !important;
}

button.btn-primary:hover,
.btn-primary:hover,
a.btn-primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 32px rgba(46, 125, 50, 0.36) !important;
  opacity: 1 !important;
}

.response.success,
.response.error {
  animation: hbPop 0.45s var(--hb-ease);
  border-radius: 14px;
  font-family: var(--hb-font) !important;
}

.response.success {
  background: #ecfdf3 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}

.response.error {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

/* Stat cards */
#todayAppointments,
#totalPatients,
#pendingRecords,
#waitingPatients,
#totalUsers,
#totalStudents,
#totalNurses,
#activeSessions {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

#dashboard .bg-white,
#dashboard .dark\:bg-gray-800,
section#dashboard .bg-white {
  border-radius: 22px !important;
  overflow: hidden;
}

section#dashboard .bg-white.p-6,
#dashboard .grid > div {
  position: relative;
}

section#dashboard .bg-white.p-6::after,
#dashboard .grid > .bg-white::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--hb-green-400), var(--hb-green-700));
}

/* Tables */
table {
  border-collapse: separate;
  border-spacing: 0;
}

table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hb-muted);
}

table tbody tr {
  transition: background 0.2s ease;
}

table tbody tr:hover {
  background: rgba(165, 214, 167, 0.18);
}

/* Auth layouts */
.hb-auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.hb-auth-visual {
  position: relative;
  overflow: hidden;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background:
    linear-gradient(160deg, rgba(20, 74, 25, 0.55), rgba(27, 94, 32, 0.72)),
    url("/images/about/clinc.jpeg") center/cover;
}

.hb-auth-visual::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -80px;
  bottom: -80px;
  background: rgba(165, 214, 167, 0.18);
  filter: blur(8px);
  animation: hbFloat 8s ease-in-out infinite;
}

.hb-auth-visual > * {
  position: relative;
  z-index: 1;
}

.hb-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 48px;
}

.hb-auth-main .card {
  animation: hbRise 0.7s var(--hb-ease) both;
}

@media (max-width: 900px) {
  .hb-auth-layout {
    grid-template-columns: 1fr;
  }
  .hb-auth-visual {
    min-height: 220px;
    padding: 28px;
  }
}

/* Landing */
.hb-hero-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.55;
  animation: hbFloat 10s ease-in-out infinite;
}

.hb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--hb-line);
  color: var(--hb-green-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.dark .hb-pill {
  background: rgba(22, 48, 29, 0.8);
  color: var(--hb-green-300);
}

.hb-feature,
.hb-campus,
.hb-step {
  background: var(--hb-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  box-shadow: var(--hb-shadow);
  transition: transform 0.4s var(--hb-ease), box-shadow 0.4s var(--hb-ease);
}

.hb-feature:hover,
.hb-campus:hover,
.hb-step:hover {
  transform: translateY(-8px);
  box-shadow: var(--hb-shadow-lg);
}

.hb-reveal {
  opacity: 0;
  transform: translateY(28px);
  animation: hbRise 0.8s var(--hb-ease) forwards;
}

.hb-delay-1 { animation-delay: 0.08s; }
.hb-delay-2 { animation-delay: 0.16s; }
.hb-delay-3 { animation-delay: 0.24s; }
.hb-delay-4 { animation-delay: 0.32s; }
.hb-delay-5 { animation-delay: 0.4s; }

.hb-cta {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 56px 32px;
  color: white;
  background:
    linear-gradient(135deg, rgba(27, 94, 32, 0.92), rgba(46, 125, 50, 0.82)),
    url("/images/about/patient.jpg") center/cover;
}

.hb-cta::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -10%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  animation: hbFloat 7s ease-in-out infinite;
}

/* Assistant */
.hb-assistant .launcher {
  background: linear-gradient(135deg, #43a047, #1b5e20) !important;
  border-radius: 999px !important;
  box-shadow: 0 16px 32px rgba(27, 94, 32, 0.35) !important;
}

.hb-assistant .launcher i {
  color: #1b5e20 !important;
}

.hb-assistant button.send {
  background: #2e7d32 !important;
}

.hb-assistant .user {
  background: #2e7d32 !important;
}

/* Motion */
@keyframes hbRise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hbPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

@keyframes hbPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

.hb-float { animation: hbFloat 6s ease-in-out infinite; }

footer {
  border-top: 1px solid var(--hb-line);
}

.hb-setting-row {
  border: 1px solid var(--hb-line) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.55) !important;
  transition: transform 0.25s var(--hb-ease), box-shadow 0.25s ease;
}

.hb-setting-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 74, 25, 0.08);
}

body.dark .hb-setting-row {
  background: rgba(18, 42, 26, 0.55) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hb-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .navbar {
    min-height: 72px !important;
  }
}
