:root {
  --color-primary: #244a9f;
  --color-primary-dark: #1a3672;
  --color-primary-light: #8ca8e0;
  --color-accent: #aac2f3;
  --color-bg-soft: #f5f8fd;
  --color-text: #32373c;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--color-text);
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(36, 74, 159, 0.55);
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.7);
}
.btn-outline:hover {
  background-color: #fff;
  color: var(--color-primary);
}

.btn-light {
  background-color: #fff;
  color: var(--color-primary);
}
.btn-light:hover {
  background-color: var(--color-bg-soft);
}

/* Header */
#site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.nav-link {
  position: relative;
  color: var(--color-text);
  font-weight: 500;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.2s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}
.nav-link.active {
  color: var(--color-primary);
}

/* Hero */
.cta-photo {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.cta-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(15, 30, 70, 0.85), rgba(26, 54, 114, 0.88));
}

.cta-photo > * {
  position: relative;
  z-index: 1;
}

.hero-photo {
  position: relative;
  background-image: url('/assets/img/hero-bg.jpg');
  background-size: cover;
  background-position: center right;
  overflow: hidden;
}

.hero-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(15, 30, 70, 0.94) 0%,
    rgba(20, 40, 95, 0.88) 32%,
    rgba(26, 54, 114, 0.55) 58%,
    rgba(26, 54, 114, 0.15) 82%);
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  line-height: 0;
}

.page-hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,0.08) 0, transparent 45%),
    linear-gradient(120deg, #1a3672 0%, var(--color-primary) 100%);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 100% at 90% 0%, black 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 90% 0%, black 40%, transparent 75%);
  pointer-events: none;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

/* Photo-backed inner page headers (services, conditions, about, contact, condition detail pages) */
.page-hero-photo {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.page-hero-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    rgba(15, 30, 70, 0.90) 0%,
    rgba(20, 40, 95, 0.82) 40%,
    rgba(26, 54, 114, 0.62) 70%,
    rgba(26, 54, 114, 0.35) 100%);
}

.page-hero-photo > * {
  position: relative;
  z-index: 1;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(15, 30, 70, 0.06);
  border: 1px solid #eef1f8;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 30, 70, 0.12);
}

.icon-badge {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
  color: var(--color-primary);
}

/* Accordion (Conditions page) */
.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}
.accordion-icon {
  transition: transform 0.2s ease;
}
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

/* Utility */
.section-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
}

.avatar-placeholder {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

/* Mobile nav */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
#mobile-menu.open {
  max-height: 40rem;
  overflow-y: auto;
}

/* Desktop conditions dropdown */
.dropdown-panel {
  pointer-events: none;
}
.group:hover .dropdown-panel,
.group:focus-within .dropdown-panel {
  pointer-events: auto;
}

/* Mobile conditions submenu */
.mobile-accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.mobile-accordion-item.open .mobile-accordion-panel {
  max-height: 28rem;
}
.mobile-accordion-item.open .mobile-accordion-icon {
  transform: rotate(180deg);
}

/* Back to top */
#back-to-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(8px);
}
#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Form focus */
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(36, 74, 159, 0.15);
}
