:root {
  --red-primary: #E30613;
  --red-dark: #A1020B;
  --red-light: #FF4D5A;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-light: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(40px);
  --white: #ffffff;
  --dark-navy: #1a1a2e;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-dark: #e8f1fb;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  /* Gray scale for light theme pages */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --cyan-dark: #0E7490;
  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; background: #D4E8FA; }
body {
  font-family: var(--font);
  background: transparent;
  color: #1e293b;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* =================== AI CLOUD / AURORA BACKGROUND =================== */
.mesh-bg {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #bdd4ed 0%, #d0e2f4 18%, #e2ecf8 40%, #edf2fa 65%, #f6f9fd 100%);
  overflow: hidden;
  clip-path: inset(0);
  -webkit-clip-path: inset(0);
}

/* Animated cloud layers — subtle, organic */
.mesh-orb {
  display: block;
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

/* Large rose-red nebula — top-right */
.mesh-orb-1 {
  width: 600px; height: 450px;
  background: radial-gradient(ellipse, rgba(227, 6, 19, 0.12) 0%, rgba(227, 50, 80, 0.06) 30%, transparent 65%);
  filter: blur(70px);
  top: 2%; right: 3%;
  opacity: 1;
  animation: cloudDrift1 20s ease-in-out infinite alternate;
}

/* Cool blue cloud — center-left */
.mesh-orb-2 {
  width: 700px; height: 500px;
  background: radial-gradient(ellipse, rgba(80, 140, 220, 0.15) 0%, rgba(120, 180, 240, 0.06) 35%, transparent 65%);
  filter: blur(80px);
  top: 25%; left: 3%;
  opacity: 1;
  animation: cloudDrift2 28s ease-in-out infinite alternate;
}

/* Warm rose cloud — bottom-right */
.mesh-orb-3 {
  width: 550px; height: 400px;
  background: radial-gradient(ellipse, rgba(227, 6, 19, 0.08) 0%, rgba(220, 80, 120, 0.04) 35%, transparent 65%);
  filter: blur(70px);
  bottom: 5%; right: 8%;
  opacity: 1;
  animation: cloudDrift3 24s ease-in-out infinite alternate;
}

/* Aurora sweep — visible diagonal light ribbon */
.mesh-aurora {
  position: absolute;
  top: 0; left: -60%; right: -60%; bottom: 0;
  background:
    linear-gradient(
      125deg,
      transparent 0%,
      transparent 30%,
      rgba(80, 150, 240, 0.08) 36%,
      rgba(227, 6, 19, 0.05) 42%,
      rgba(160, 80, 220, 0.06) 48%,
      rgba(60, 190, 210, 0.05) 54%,
      rgba(227, 80, 120, 0.04) 60%,
      transparent 66%,
      transparent 100%
    );
  animation: auroraSweep 16s ease-in-out infinite alternate;
  pointer-events: none;
  will-change: transform;
}

@keyframes cloudDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-60px, 40px) scale(1.12); }
  100% { transform: translate(30px, -25px) scale(0.92); }
}
@keyframes cloudDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(70px, -30px) scale(1.08); }
  100% { transform: translate(-40px, 35px) scale(0.95); }
}
@keyframes cloudDrift3 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-50px, -40px) scale(1.15); }
  100% { transform: translate(35px, 20px) scale(0.9); }
}
@keyframes auroraSweep {
  0%   { transform: translateX(-15%) rotate(-3deg) scaleY(1.3); opacity: 0.5; }
  50%  { transform: translateX(15%) rotate(2deg) scaleY(0.9); opacity: 1; }
  100% { transform: translateX(-8%) rotate(-1deg) scaleY(1.15); opacity: 0.7; }
}

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .mesh-orb, .mesh-aurora { animation: none; }
  .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; }
}

/* Luminous veil at top */
.mesh-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background:
    radial-gradient(ellipse 90% 60% at 75% 0%, rgba(227, 6, 19, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 25% 0%, rgba(80, 150, 240, 0.1) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(170, 200, 235, 0.15) 0%, transparent 100%);
  pointer-events: none;
}

/* White horizon at bottom */
.mesh-bg::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30%;
  background:
    radial-gradient(ellipse 80% 70% at 50% 100%, rgba(255, 255, 255, 0.6) 0%, transparent 65%),
    linear-gradient(to top, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Dark mode mesh background ── */
body.dark .mesh-bg {
  background: linear-gradient(180deg, #0E0E12 0%, #121218 18%, #161620 40%, #1a1a24 65%, #1e1e28 100%);
}
body.dark .mesh-orb-1 {
  background: radial-gradient(ellipse, rgba(227, 6, 19, 0.08) 0%, rgba(227, 50, 80, 0.04) 30%, transparent 65%);
}
body.dark .mesh-orb-2 {
  background: radial-gradient(ellipse, rgba(80, 140, 220, 0.10) 0%, rgba(120, 180, 240, 0.04) 35%, transparent 65%);
}
body.dark .mesh-orb-3 {
  background: radial-gradient(ellipse, rgba(227, 6, 19, 0.05) 0%, rgba(220, 80, 120, 0.03) 35%, transparent 65%);
}
body.dark .mesh-aurora {
  background:
    linear-gradient(
      125deg,
      transparent 0%,
      transparent 30%,
      rgba(80, 150, 240, 0.05) 36%,
      rgba(227, 6, 19, 0.03) 42%,
      rgba(160, 80, 220, 0.04) 48%,
      rgba(60, 190, 210, 0.03) 54%,
      rgba(227, 80, 120, 0.02) 60%,
      transparent 66%,
      transparent 100%
    );
}
body.dark .mesh-bg::before {
  background:
    radial-gradient(ellipse 90% 60% at 75% 0%, rgba(227, 6, 19, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 25% 0%, rgba(80, 150, 240, 0.06) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(20, 20, 35, 0.15) 0%, transparent 100%);
}
body.dark .mesh-bg::after {
  background:
    radial-gradient(ellipse 80% 70% at 50% 100%, rgba(14, 14, 18, 0.6) 0%, transparent 65%),
    linear-gradient(to top, rgba(14, 14, 18, 0.4) 0%, transparent 100%);
}

/* ===== MINIMAL NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 36px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
}
.nav-progress {
  position: absolute;
  top: 0; left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--red-primary, #D42B2B), var(--red-dark, #A51E1E));
  border-radius: 0 2px 2px 0;
  z-index: 101;
  transition: width 0.05s linear, height 0.3s ease, filter 0.3s ease;
  box-shadow: 0 0 8px rgba(212,43,43,0.15);
}
.nav-progress.complete {
  height: 3.5px;
  animation: progress-pulse 0.6s ease-out;
}
.progress-confetti {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 60px;
  pointer-events: none;
  z-index: 102;
  overflow: visible;
}
.confetti-dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}
.confetti-dot.burst {
  animation: confetti-burst var(--duration) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes confetti-burst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  20% { opacity: 1; transform: translate(var(--tx-mid), var(--ty-mid)) scale(1.3); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2); }
}
@keyframes progress-pulse {
  0% { filter: brightness(1); box-shadow: 0 0 8px rgba(212,43,43,0.15); }
  30% { filter: brightness(2.2); box-shadow: 0 0 24px var(--red-primary, #D42B2B), 0 0 48px rgba(212,43,43,0.15); height: 5px; }
  60% { filter: brightness(1.6); box-shadow: 0 0 16px rgba(212,43,43,0.15); height: 4px; }
  100% { filter: brightness(1.2); box-shadow: 0 0 10px rgba(212,43,43,0.15); height: 3.5px; }
}
.navbar.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  border-bottom-color: rgba(17, 24, 39, 0.08);
}
body.dark .navbar {
  background: rgba(14,14,14,0.8);
}
body.dark .navbar.scrolled {
  background: rgba(14,14,14,0.92);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.nav-logo {
  width: 24px; height: 24px;
  object-fit: contain;
}
/* Legacy support for image logo */
.nav-logo-icon { height: 24px; width: auto; filter: brightness(0) saturate(100%) invert(12%) sepia(95%) saturate(6500%) hue-rotate(355deg) brightness(95%) contrast(110%); }
.nav-brand {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text-main, #1A1A1A);
  text-decoration: none;
}
.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-center a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500, #6B7280);
  text-decoration: none;
  padding: 8px 16px;
  position: relative;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  border-radius: 8px;
}
.nav-center a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--red-primary, #D42B2B);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nav-center a:hover {
  color: var(--text-main, #1A1A1A);
  background: rgba(0,0,0,0.03);
}
.nav-center a:hover::after {
  opacity: 0.5;
}
.nav-center a:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}
.nav-center a.active {
  color: var(--text-main, #1A1A1A);
  font-weight: 600;
}
.nav-center a.active::after {
  opacity: 1;
}
.nav-center a.active:hover {
  color: var(--red-primary, #D42B2B);
}
body.dark .nav-center a {
  color: var(--gray-400, #9CA3AF);
}
body.dark .nav-center a:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,0.05);
}
body.dark .nav-center a.active {
  color: #FFFFFF;
}
.nav-sam {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 10px;
  background: var(--red-primary, #D42B2B);
  border: 1px solid var(--red-primary, #D42B2B);
  border-radius: 999px;
  margin-left: 4px;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 20px -5px rgba(212,43,43,0.5);
  animation: nav-sam-pulse 2.5s infinite cubic-bezier(0.66, 0, 0, 1);
  overflow: hidden;
}
@keyframes nav-sam-pulse {
  0% { box-shadow: 0 0 0 0 rgba(212,43,43,0.4); }
  70% { box-shadow: 0 0 0 12px rgba(212,43,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,43,43,0); }
}
@keyframes nav-sam-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}
.nav-sam-icon-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  animation: nav-sam-icon-float 3s ease-in-out infinite;
  flex-shrink: 0;
}
.nav-sam img {
  width: 14px; height: 14px; object-fit: contain;
  filter: brightness(0) invert(1);
}
.nav-sam-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  white-space: nowrap;
}
.nav-sam:hover {
  background: var(--red-dark, #A51E1E);
  border-color: var(--red-dark, #A51E1E);
  transform: translateY(-1px);
  box-shadow: 0 0 30px -5px rgba(212,43,43,0.8);
  animation: none;
}
.nav-sam::after { display: none; }
.nav-sam-tooltip {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #1A1A1A; color: #fff;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  padding: 5px 10px; border-radius: 6px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateX(-50%) translateY(-4px);
}
.nav-sam-tooltip::before {
  content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #1A1A1A;
}
.nav-sam:hover .nav-sam-tooltip,
.nav-sam:focus-visible .nav-sam-tooltip {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
body.dark .nav-sam {
  background: var(--red-primary, #D42B2B);
  border-color: var(--red-primary, #D42B2B);
}
body.dark .nav-sam-label { color: #F3F4F6; }
body.dark .nav-sam:hover {
  background: #E04444;
  border-color: #E04444;
}
body.dark .nav-sam-tooltip { background: #E8E8E8; color: #1A1A1A; }
body.dark .nav-sam-tooltip::before { border-bottom-color: #E8E8E8; }
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.nav-fav-link {
  color: var(--text-main, #1A1A1A);
  opacity: 0.86;
}
.nav-fav-link:hover {
  background: rgba(212,43,43,0.08) !important;
  color: var(--red-primary, #D42B2B);
  opacity: 1;
}
.nav-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #6B6B6B);
  white-space: nowrap;
}
.dark-toggle-nav {
  position: relative;
  width: 36px; height: 20px;
  background: var(--gray-300, #D1D5DB);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.3s;
  border: none;
}
.dark-toggle-nav::after {
  content: '';
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 15px; height: 15px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
body.dark .dark-toggle-nav { background: var(--red-primary, #D42B2B); }
body.dark .dark-toggle-nav::after { transform: translateX(16px); }
.dark-toggle-wrap {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.dark-toggle-icon {
  width: 16px; height: 16px; color: var(--text-muted);
  transition: color 0.3s, opacity 0.3s, transform 0.3s;
  opacity: 0.42; flex-shrink: 0;
}
.dark-toggle-icon.active {
  opacity: 1; color: var(--red-primary);
  transform: scale(1.05);
}
.nav-cta {
  padding: 8px 18px;
  background: transparent;
  color: var(--text-main, #1A1A1A);
  border: 1px solid var(--gray-300, #D1D5DB);
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
  letter-spacing: 0.01em;
}
.nav-cta:hover {
  background: rgba(0,0,0,0.04);
  border-color: var(--gray-400, #9CA3AF);
  color: var(--text-main, #1A1A1A);
  opacity: 1;
}
body.dark .nav-cta {
  background: transparent;
  color: #E0E0E0;
  border-color: rgba(255,255,255,0.15);
}
body.dark .nav-cta:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
  color: #FFFFFF;
}
/* ===== MOBILE NAV ===== */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-main, #1A1A1A);
}
.mobile-menu {
  display: none;
  position: fixed;
  top: 72px; left: 0; right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--gray-200, #E5E5E5);
  padding: 16px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 12px;
}
body.dark .mobile-menu {
  background: #0E0E0E;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main, #1A1A1A);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200, #E5E5E5);
}
.mobile-menu a:hover { color: var(--red-primary, #D42B2B); }

/* Glass CTA Button */
.btn-primary {
  background: #E30613;
  border: none;
  color: #fff;
  border-radius: 100px;
  padding: 0.8rem 2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(227,6,19,0.25);
  transition: var(--transition);
  text-transform: uppercase; font-size: 0.85rem;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  background: #1a1a2e;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary.loading {
  position: relative;
  color: transparent;
}
.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-outline {
  background: rgba(255,255,255,0.6);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(0,0,0,0.08);
  color: #1e293b;
  border-radius: 100px;
  padding: 0.8rem 2rem;
  font-weight: 700; letter-spacing: 0.5px; text-decoration: none; text-transform: uppercase; font-size: 0.85rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.btn-outline:hover { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.12); transform: translateY(-2px); }

/* Global Glass Sections */
section { padding: 8rem 3rem; position: relative; z-index: 10; }
.section-title { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 1.5rem; color: #1e293b; }
.section-desc { font-size: 1.2rem; color: #64748b; max-width: 650px; margin: 0 auto; line-height: 1.8; }
.section-tag { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #E30613; margin-bottom: 1rem; }

/* Ultra Glass Cards */
.top-doctor-card, .feature-card, .security-item, .advantage-card, .specialty-card, .doctor-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-light);
  border-left: 1px solid var(--glass-border-light);
  border-radius: 24px;
  padding: 2.5rem;
  transition: box-shadow 0.4s ease, border-color 0.4s ease; /* Removed transform from css transition so JS handles it instantly */
  box-shadow: 0 8px 30px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.01);
  position: relative;
  overflow: hidden;
}

/* Base static glow/gradient */
.top-doctor-card::before, .feature-card::before, .security-item::before, .advantage-card::before {
  content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 100%); opacity: 0; transition: var(--transition); pointer-events: none; z-index: 0;
}

/* Dynamic Cursor Tracking Glow */
.top-doctor-card::after, .feature-card::after, .security-item::after, .advantage-card::after, .specialty-card::after, .doctor-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.45), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 0;
}

.top-doctor-card:hover::after, .feature-card:hover::after, .security-item:hover::after, .advantage-card:hover::after, .specialty-card:hover::after, .doctor-card:hover::after {
  opacity: 1;
}

/* Assure inner content sits above backgrounds */
.top-doctor-card > *, .feature-card > *, .security-item > *, .advantage-card > *, .specialty-card > *, .doctor-card > * {
  position: relative; z-index: 1;
}

.top-doctor-card:hover, .feature-card:hover, .security-item:hover, .advantage-card:hover, .specialty-card:hover, .doctor-card:hover {
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 -5px 20px rgba(255,255,255,0.5);
}
.top-doctor-card:hover::before { opacity: 1; }

.td-avatar, .feature-icon, .advantage-icon, .specialty-card-icon, .doctor-avatar {
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  color: #374151;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.td-info h3, .feature-title, .security-item h4 { color: #1e293b; font-weight: 700; letter-spacing: -0.02em; font-size: 1.15rem; }
.td-specialty, .td-rating-text, .td-location { color: #64748b; }
.feature-text, .security-item p { color: #64748b; font-size: 1rem; line-height: 1.7; }
/* Doctor card tags — discrete inline badges */
.td-tag-verified {
  background: none; border: none; color: #22C55E;
  font-size: 0.8rem; padding: 0; display: inline-flex; align-items: center; gap: 3px;
}
.td-tag-verified::before { content: '✓'; font-weight: 800; }
.td-tag-top {
  background: none; border: none; color: #E30613;
  font-size: 0.8rem; padding: 0; display: inline-flex; align-items: center; gap: 3px;
}
.td-tag-top::before { content: '♥'; }

.box-visual img { filter: drop-shadow(0 20px 40px rgba(0,0,0,0.12)); border-radius: 30px; }
.box-badge {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  backdrop-filter: blur(10px);
  border: none;
  color: #fff;
  padding: 0.7rem 2rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  letter-spacing: 0.5px;
}

/* Homepage Search Hero */
.home-hero, .search-hero {
  position: relative;
  min-height: calc(100dvh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6rem 3rem 4rem;
  text-align: center;
  z-index: 10;
}
.home-hero-title, .search-hero-title { font-size: clamp(3rem, 7vw, 6rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1.05; margin-bottom: 2rem; color: #1e293b; }
.home-hero-title .highlight, .search-hero-title .highlight { background: linear-gradient(135deg, #FF3344, #E30613); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.home-hero-sub, .search-hero-sub { font-size: 1.25rem; color: var(--text-muted); max-width: 650px; margin: 0 auto 3rem; line-height: 1.7; }

.home-search-bar, .search-bar {
  display: flex; max-width: 900px; margin: 0 auto;
  background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 100px; box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transition: var(--transition);
}
.home-search-bar:focus-within, .search-bar:focus-within { border-color: rgba(255,255,255,0.5); box-shadow: 0 12px 40px rgba(0,0,0,0.08); transform: scale(1.01); }
.home-search-field, .search-field { flex: 1; display: flex; align-items: center; gap: 15px; padding: 1.5rem 2rem; border-right: 1px solid rgba(0,0,0,0.06); }
.home-search-field:last-of-type { border-right: none; }
.home-search-field input, .search-field input { background: transparent; border: none; outline: none; color: #1e293b; font-size: 1.1rem; width: 100%; font-family: var(--font); font-weight: 500; }
.home-search-field input::placeholder { color: #94a3b8; }
.field-icon { color: #64748b; font-size: 1.3rem; }

/* Neural Lens — living AI indicator in search bar */
.neural-lens {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.neural-lens svg {
  position: relative;
  z-index: 1;
  transition: stroke 0.3s ease;
}
.neural-core {
  position: absolute;
  top: 50%;
  left: 46%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-primary);
  opacity: 0.6;
  transition: all 0.3s ease;
}
/* Pulse when typing (activated via JS) */
.neural-lens.active svg {
  stroke: var(--red-primary);
}
.neural-lens.active .neural-core {
  opacity: 1;
  animation: neuralPulse 1.5s ease-in-out infinite;
}
@keyframes neuralPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.3); }
  50% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 12px 4px rgba(227, 6, 19, 0.15); }
}
/* Processing state — faster pulse */
.neural-lens.processing .neural-core {
  opacity: 1;
  animation: neuralProcess 0.6s ease-in-out infinite;
}
@keyframes neuralProcess {
  0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
}
.home-search-btn, .search-btn {
  display: flex; align-items: center; justify-content: center; padding: 0 3rem;
  background: #E30613;
  border: none;
  color: #fff; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  border-radius: 0 100px 100px 0; cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.home-search-btn:hover, .search-btn:hover { background: #1a1a2e; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }

.home-specialty-chip, .specialty-chip { padding: 0.8rem 1.8rem; background: rgba(255,255,255,0.6); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.5); border-radius: 100px; color: #475569; text-decoration: none; transition: var(--transition); font-weight: 500; font-size: 0.9rem; }
.home-specialty-chip:hover, .specialty-chip:hover { border-color: #E30613; color: #E30613; background: #FEF2F2; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(230,0,18,0.12); }


/* ============ SMART BAR (single omnipotent field) ============ */
.smart-bar {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}
.smart-bar-inner {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 100px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transition: var(--transition);
  padding: 0.4rem;
}
.smart-bar-inner:focus-within {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  transform: scale(1.01);
  outline: none;
}
.smart-bar-icon {
  font-size: 1.3rem;
  padding: 0 0.8rem 0 1.2rem;
  flex-shrink: 0;
  transition: all 0.2s;
}
.smart-bar-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 500;
  color: #1e293b;
  padding: 1rem 0.5rem;
  min-width: 0;
}
.smart-bar-input::placeholder { color: #94a3b8; font-weight: 400; }
.smart-bar-input:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}
.smart-bar-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.smart-bar-mic:hover { opacity: 0.8; }
.smart-bar-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E30613;
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.smart-bar-btn:hover {
  background: #1a1a2e;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

/* Privacy badge under search */
.privacy-badge {
  max-width: 600px;
  margin: 1.5rem auto 0;
  text-align: center;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.6;
  font-weight: 400;
}

@media(max-width: 768px) {
  /* Navbar mobile — aligned padding */
  .navbar { padding: 0 1.2rem; }
  .navbar.scrolled { padding: 0 1.2rem; }
  .nav-brand { font-size: 16px; }
  .nav-logo, .nav-logo-icon { width: 24px; height: 24px; }
  .nav-right { gap: 12px; }
  .nav-sam { width: 36px; padding: 0; gap: 0; }
  .nav-sam-label { display: none; }
  .nav-cta { display: none; }

  /* Smart bar */
  .smart-bar-inner { flex-direction: row; border-radius: 100px; padding: 0.4rem 0.4rem 0.4rem 1rem; }
  .smart-bar-input { padding: 0.6rem 0.5rem; width: 100%; font-size: 0.95rem; }
  .smart-bar-icon { display: none; }
  .smart-bar-btn { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
  .smart-bar-mic { display: none; }
  .privacy-badge { font-size: 0.75rem; padding: 0 1rem; }

  /* Specialty chips — 2 col grid */
  .home-quick-specialties, .quick-specialties {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1.5rem;
    padding: 0 0.5rem;
  }
  .home-specialty-chip, .specialty-chip {
    padding: 0.6rem 1rem; font-size: 0.82rem; text-align: center; justify-content: center;
  }

  /* Box features — left aligned */
  .box-section { padding: 3rem 1.2rem; }
  .box-text { text-align: left; }
  .box-feat { align-items: center; gap: 0.8rem; text-align: left; }
  .box-feat-icon { min-width: 28px; text-align: center; }
  .box-features { padding-left: 0; }
}

/* Risultati overrides */
.results-header { padding: 10rem 3rem 4rem; text-align: center; }
.results-back { color: #E30613; font-size: 0.9rem; text-decoration: none; font-weight: 500; }
.results-back:hover { text-decoration: underline; }
#results-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; color: #1e293b; margin: 1rem 0 0.3rem; letter-spacing: -0.03em; }
#results-subtitle { font-size: 1rem; color: #64748b; }
.filter-bar-wrap { background: rgba(255,255,255,0.6); backdrop-filter: blur(30px); border-bottom: 1px solid rgba(0,0,0,0.06); border-top: 1px solid rgba(0,0,0,0.06); padding: 1rem 3rem; overflow: hidden; scrollbar-width: none; -ms-overflow-style: none; }
.filter-bar-wrap::-webkit-scrollbar { display: none; }
.filter-option { background: transparent; color: #374151; border: 1px solid rgba(0,0,0,0.1); border-radius: 100px; padding: 0.6rem 1.2rem; }
.filter-option:hover { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.2); }

/* Layout adjustments */
.top-doctors-grid, .features-grid, .advantage-grid, .specialties-grid, .cities-grid, .doctors-grid { display: grid; gap: 2rem; max-width: 1200px; margin: 0 auto; }
.top-doctors-grid, .features-grid { grid-template-columns: repeat(3, 1fr); }
.box-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; max-width: 1200px; margin: 0 auto; align-items: center; }

/* Responsive */
@media(max-width: 968px) {
  .top-doctors-grid, .features-grid { grid-template-columns: 1fr; }
  .box-content { grid-template-columns: 1fr; text-align: center; }
  .box-visual { min-height: 220px; margin: 0 auto; }
  .box-visual canvas { width: 100%; max-height: 220px; }
}

/* Legacy hamburger (kept for backward compat) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #374151;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media(max-width: 768px) {
  .home-search-bar, .search-bar { flex-direction: column; border-radius: 24px; }
  .home-search-field, .search-field { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.04); }
  .home-search-btn, .search-btn { border-radius: 0 0 24px 24px; padding: 1rem; }
  .menu-toggle { display: flex; }
  .nav-center { display: none; }
  .nav-label { display: none; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #ffffff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 500;
    padding: 2rem;
  }
  .nav-links.mobile-open {
    display: flex;
  }
  .nav-links li { width: 100%; display: flex; justify-content: center; }
  .nav-links a {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    display: block;
    padding: 0.5rem 0;
  }
  .nav-links a:hover {
    color: #E30613;
  }
  .nav-links a::after { display: none; }
  .menu-toggle { z-index: 501; }
  section { padding: 5rem 1.5rem; }
  .home-hero, .search-hero { padding: 8rem 1.5rem 4rem; }
  .results-header { padding: 7rem 1.5rem 3rem; }
  .filter-bar-wrap { padding: 0.8rem 1rem; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
  .filter-bar-wrap::-webkit-scrollbar { display: none; }
  .filter-bar { display: flex; gap: 0.5rem; flex-wrap: nowrap; min-width: max-content; }
}

.advantage-grid { grid-template-columns: repeat(3, 1fr); }
.specialties-grid, .cities-grid { grid-template-columns: repeat(4, 1fr); }
.doctors-grid { grid-template-columns: repeat(2, 1fr); }
.doctors-grid .doctor-card:only-child { grid-column: 1 / -1; max-width: 700px; }
@media(max-width: 968px) { .advantage-grid, .specialties-grid, .cities-grid { grid-template-columns: repeat(2, 1fr); } .doctors-grid { grid-template-columns: 1fr; } }
@media(max-width: 600px) { .advantage-grid, .specialties-grid, .cities-grid { grid-template-columns: 1fr; } }

/* RESTORED STRUCTURAL LAYOUTS */

/* ============ REVEAL ANIMATIONS ============ */
.reveal,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: none;
}

.section-header { text-align: center; margin-bottom: 4rem; }

/* Hero Extras */
/* City Selector — Homepage location chips */
.home-city-selector {
  display: flex; align-items: center; gap: 0.5rem; justify-content: center;
  flex-wrap: wrap; margin-top: 1rem; margin-bottom: 0.5rem;
}
.home-city-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  margin-right: 0.3rem;
}
.home-city-chip {
  padding: 0.35rem 0.9rem; border-radius: 100px; font-size: 0.78rem;
  font-weight: 600; text-decoration: none; transition: all 0.2s;
  background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(0,0,0,0.06);
  color: var(--text-muted); cursor: pointer;
}
.home-city-chip:hover { background: rgba(255, 255, 255, 0.8); border-color: rgba(0,0,0,0.1); color: var(--text-main); }
.home-city-chip.active { background: var(--red-primary); color: #fff; border-color: var(--red-primary); }

.home-quick-specialties, .quick-specialties {
  display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem;
}

/* Specific Search Bar Heights */
.home-search-bar, .search-bar { align-items: stretch; }
.home-search-field, .search-field { padding: 1rem 1.5rem; height: 100%; display: flex; align-items: center; }
.home-search-btn, .search-btn { height: auto; display: flex; align-items: center; justify-content: center; }

/* Doctor Cards Internal Layout */
.td-header, .doctor-card-header { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1.5rem; }
.td-avatar, .doctor-avatar { width: 64px; height: 64px; flex-shrink: 0; font-size: 1.5rem; }
.td-info h3 { margin-bottom: 0.2rem; }
.td-location { margin-top: 0.2rem; }
.td-rating { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.2rem; }
.td-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.td-tag { padding: 0.4rem 0.8rem; border-radius: 100px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.td-btn-review {
  display: block; width: 100%; padding: 1rem; text-align: center;
  background: #E30613; color: #fff; border: none; border-radius: 12px;
  font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; text-decoration: none;
  transition: var(--transition); box-shadow: 0 4px 15px rgba(227,6,19,0.2);
}
.td-btn-review:hover { background: #1a1a2e; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.td-stars { color: #F59E0B; font-size: 0.9rem; letter-spacing: 2px; }

/* Features & Advantages */
.feature-icon, .advantage-icon, .specialty-card-icon { width: 64px; height: 64px; margin-bottom: 1.5rem; font-size: 1.8rem; }
.feature-title { margin-bottom: 0.8rem; }

/* Specialty Cards (link styling) */
a.specialty-card {
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}
.specialty-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--white);
}
.specialty-card-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}
a.specialty-card:visited { color: var(--text-main); }

/* City Cards */
a.city-card {
  color: #fff;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: flex-end;
}
.city-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e, #2a2a3e);
  opacity: 0.85;
  transition: opacity 0.4s ease;
}
.city-card:hover .city-card-bg { opacity: 0.95; }
.city-card-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
}
.city-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.city-docs {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

/* Box Section Layout */
.box-features { display: flex; flex-direction: column; gap: 1.2rem; }
.box-feat { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 0; background: none; border: none; border-radius: 0; font-size: 1rem; color: #374151; text-align: left; }
.box-feat-icon { font-size: 1.3rem; flex-shrink: 0; width: 32px; text-align: center; }
.box-feat-text { flex: 1; }
.box-visual { display: flex; justify-content: center; align-items: center; position: relative; }

/* Security Internal Layout */
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; max-width: 1200px; margin: 0 auto; align-items: center; }
@media(max-width: 968px) { .security-grid { grid-template-columns: 1fr; gap: 2rem; } }
.security-item h4 { margin-left: 0; }

/* SECURITY LIST FIXES */
.security-list { list-style: none; display: flex; flex-direction: column; gap: 1.5rem; }
.security-item { display: flex; gap: 1.2rem; align-items: flex-start; }
.security-item-icon { font-size: 2rem; flex-shrink: 0; }
.security-item h4 { margin-top: 0; margin-bottom: 0.5rem; }
.security-visual { display: flex; align-items: center; justify-content: center; }

/* SEARCH BAR FINE TUNING */
.home-search-btn, .search-btn { align-self: stretch; }


/* ================ FOOTER & CHATBOT RESTORATION ================ */
footer {
  position: relative;
  z-index: 10;
  background: #fff;
  padding: 0;
  margin-top: 0;
}
.footer-content {
  display: flex; align-items: center; justify-content: center;
  max-width: 1200px; margin: 0 auto; flex-wrap: wrap; gap: 2rem;
  padding: 2rem 3rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.footer-links { display: flex; gap: 2rem; list-style: none; flex-wrap: wrap; margin-bottom: 0; justify-content: center; }
.footer-links a { color: #64748b; text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: color 0.2s; }
.footer-links a:hover { color: #1e293b; }
.footer-bottom {
  background: #F3F4F6;
  padding: 2rem 3rem;
}
.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.footer-bottom-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #1A1A1A;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}
.footer-bottom-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.footer-bottom-text {
  text-align: right;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0;
}

@media(max-width: 768px) {
  .footer-content { padding: 1.5rem; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; justify-content: center; }
  .footer-links a { font-size: 0.8rem; }
  .footer-bottom { padding: 1.5rem; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .footer-bottom-text { text-align: center; }
}


/* SPACING FIXES: Box Section */
.box-text {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}
.box-text h2 { margin-bottom: 1.5rem; font-size: clamp(2.5rem, 4vw, 3.5rem); font-weight: 800; line-height: 1.1; }
.box-text p { margin-bottom: 2.5rem; font-size: 1.1rem; color: var(--text-muted); line-height: 1.7; }
.box-features { margin-top: 1rem; }

/* (Chatbot widget styles removed — component no longer in use) */


/* VIVO EFFECT SU SAMARITAN */
.home-hero-title .highlight {
  position: relative;
  display: inline-block;
  background-size: 200% auto;
  animation: textShine 4s linear infinite;
  z-index: 2;
}

@keyframes textShine {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* Red orbs removed — clean institutional background */
.home-hero-title .highlight::before { display: none; }
.home-hero-title::before { display: none; }
.home-hero-title { position: relative; z-index: 10; }

@keyframes trueBreathe {
  0%, 100% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
    filter: blur(40px);
  }
}

/* ========== FULL-PAGE SAMARITAN CHAT RESULTS ========== */
.search-hero.collapsed .search-hero-title,
.search-hero.collapsed .search-hero-sub,
.search-hero.collapsed hr,
.search-hero.collapsed .privacy-badge {
  opacity: 0;
  transform: translateY(-30px);
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-hero.collapsed #hero-specialties {
  opacity: 0;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  transition: all 0.4s ease;
}
.search-hero.collapsed {
  padding-top: 7rem;
  padding-bottom: 2rem;
  transition: padding 0.5s ease;
}
.search-hero.collapsed .search-bar {
  max-width: 700px;
  transition: max-width 0.4s ease;
}

/* Chat results section */
/* =================== FULL-PAGE CHAT EXPERIENCE =================== */

body > section:not(#sam-chat-results), 
body > nav,
body > footer {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center top;
}

body.sam-chat-active > section:not(#sam-chat-results), 
body.sam-chat-active > nav,
body.sam-chat-active > footer {
  filter: blur(25px) brightness(0.8);
  transform: scale(0.95);
  pointer-events: none;
}

/* =================== FULLPAGE CHAT — LIGHT AI THEME =================== */
.sam-chat-fullpage {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  animation: samFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
}
@keyframes samFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Animated ambient orbs — contained, no edge bleed */
.sam-chat-bg {
  display: none;
}
.sam-chat-orb {
  position: absolute; border-radius: 50%; pointer-events: none; will-change: transform;
}
.sam-chat-orb-1 {
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(227, 6, 19, 0.1) 0%, rgba(227, 50, 80, 0.04) 35%, transparent 65%);
  filter: blur(70px);
  top: 2%; right: 5%;
  animation: chatOrb1 20s ease-in-out infinite alternate;
}
.sam-chat-orb-2 {
  width: 600px; height: 450px;
  background: radial-gradient(ellipse, rgba(80, 140, 220, 0.12) 0%, rgba(120, 180, 240, 0.04) 35%, transparent 65%);
  filter: blur(80px);
  bottom: 5%; left: 5%;
  animation: chatOrb2 26s ease-in-out infinite alternate;
}
.sam-chat-orb-3 {
  width: 400px; height: 350px;
  background: radial-gradient(ellipse, rgba(200, 60, 120, 0.06) 0%, transparent 60%);
  filter: blur(70px);
  top: 35%; left: 35%;
  animation: chatOrb3 18s ease-in-out infinite alternate;
}
@keyframes chatOrb1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 30px) scale(1.1); }
}
@keyframes chatOrb2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -25px) scale(1.08); }
}
@keyframes chatOrb3 {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.6; }
  100% { transform: translate(-20px, 15px) scale(1.15); opacity: 0.9; }
}

.sam-chat-container {
  width: 100%;
  max-width: 900px;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  padding-top: 58px;
}

/* ---- Top bar — full width, outside container flow ---- */
.sam-chat-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, transparent 100%);
  border-bottom: none;
  pointer-events: none;
}
.sam-chat-back, .sam-chat-newchat, .sam-chat-topbar-center { pointer-events: auto; }
.sam-chat-back,
.sam-chat-newchat {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.06);
  color: #64748b;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.sam-chat-back { left: 2rem; }
.sam-chat-newchat { right: 2rem; }
.sam-chat-back:hover,
.sam-chat-newchat:hover {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.sam-chat-topbar-center {
  display: flex; align-items: center; gap: 12px;
}
.sam-chat-topbar-avatar {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--red-primary);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 2px 12px rgba(227, 6, 19, 0.25);
}
.sam-chat-topbar-avatar img {
  width: 20px; height: 20px; object-fit: contain; filter: brightness(10);
}
.sam-chat-topbar-pulse {
  position: absolute; inset: -3px; border-radius: 14px;
  border: 2px solid rgba(227, 6, 19, 0.25);
  animation: topbarPulse 2.5s ease-in-out infinite;
}
@keyframes topbarPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
.sam-chat-topbar-info { display: flex; flex-direction: column; }
.sam-chat-topbar-name {
  font-weight: 700; font-size: 0.9rem; color: #1e293b; letter-spacing: -0.01em;
}
.sam-chat-topbar-status {
  font-size: 0.72rem; color: #94a3b8; font-weight: 500;
  display: flex; align-items: center; gap: 5px;
}
.sam-chat-status-dot-inline {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
  display: inline-block;
}

/* Legacy elements — hidden */
.sam-chat-status-dot { display: none; }
.sam-chat-header { display: none; }

/* ---- Messages area ---- */
.sam-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem 8rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.08) transparent;
}
.sam-chat-messages::-webkit-scrollbar { width: 4px; }
.sam-chat-messages::-webkit-scrollbar-track { background: transparent; }
.sam-chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

/* ---- Message rows ---- */
.sam-msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 100%;
  padding: 0.4rem 0;
  animation: samMsgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes samMsgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.sam-msg-avatar {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--red-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem; color: #fff; font-weight: 700;
  box-shadow: 0 2px 8px rgba(227, 6, 19, 0.2);
}
.sam-msg-avatar img {
  width: 18px; height: 18px; object-fit: contain; filter: brightness(10);
}
.sam-msg-user .sam-msg-avatar {
  background: #1e293b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border: none;
  order: 0;
  display: flex;
}
.sam-msg-bubble {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 18px;
  border-top-left-radius: 4px;
  padding: 1rem 1.3rem;
  font-size: 0.93rem; line-height: 1.7;
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* stronger shadow for depth */
  flex: 1; min-width: 0;
  max-width: 75%;
}
.sam-msg-bubble strong { font-weight: 700; color: #0f172a; }
.sam-msg-bubble a { color: var(--red-primary); text-decoration: none; font-weight: 600; }
.sam-msg-bubble a:hover { text-decoration: underline; }

.sam-msg-user .sam-msg-bubble {
  background: linear-gradient(135deg, #E30613, #A1020B);
  color: #fff;
  border: none;
  border-radius: 18px;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 20px rgba(227,6,19,0.25);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.sam-msg-user .sam-msg-bubble strong { color: #fff; }
.sam-msg-user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

/* ---- Typing indicator ---- */
.sam-typing {
  display: flex; gap: 5px; padding: 0.8rem 1.2rem; align-items: center;
  max-width: fit-content;
  flex: 0 0 auto;
  min-height: 38px;
  box-sizing: border-box;
}
.sam-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red-primary);
  animation: samTypingDot 1.4s infinite;
}
.sam-typing span:nth-child(2) { animation-delay: 0.15s; }
.sam-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes samTypingDot {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* =================== RECOMMENDED DOCTOR CARDS =================== */
/* These appear when Samaritan recommends a doctor after conversation */

.sam-recommend-section {
  margin: 0.5rem 0 1rem;
  padding-left: 46px;
  animation: samRecommendIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@media(max-width: 768px) {
  .sam-recommend-section { padding-left: 0; }
}
@keyframes samRecommendIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.sam-recommend-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--red-primary);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sam-recommend-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--red-primary);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(227,6,19,0.4);
}

.sam-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sam-doctor-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 18px;
  padding: 1.3rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.sam-doctor-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--red-primary);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.sam-doctor-card:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.9);
  border-color: rgba(227,6,19,0.15);
  box-shadow: 0 8px 30px rgba(227,6,19,0.08);
}
.sam-doctor-card:hover::before {
  opacity: 1;
}
.sam-doctor-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
}
.sam-doctor-card-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #E30613, #A1020B);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 8px rgba(227,6,19,0.2);
}
.sam-doctor-card-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.01em;
}
.sam-doctor-card-info .spec {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}
.sam-doctor-card-info .loc {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
}
.sam-doctor-card-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0.6rem;
  font-weight: 500;
}
.sam-doctor-card-rating .stars { color: #f5a623; font-size: 0.9rem; letter-spacing: 1px; }
.sam-doctor-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.sam-doctor-card-tags span {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
}
.sam-doctor-card-tags .tag-v {
  color: #16a34a;
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(22,163,74,0.12);
}
.sam-doctor-card-tags .tag-open {
  color: #16a34a;
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(22,163,74,0.12);
}
.sam-doctor-card-tags .tag-closed {
  color: #94a3b8;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
}
.sam-doctor-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.sam-doctor-card-actions a,
.sam-doctor-card-actions button {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}
.sam-doctor-card-actions .btn-profile {
  background: var(--red-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(227,6,19,0.2);
}
.sam-doctor-card-actions .btn-profile:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(227,6,19,0.3);
}
.sam-doctor-card-actions .btn-contact-card {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid rgba(0,0,0,0.06);
}
.sam-doctor-card-actions .btn-contact-card:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: rgba(0,0,0,0.1);
}

/* ---- Bottom input ---- */
.sam-chat-bottom {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  padding: 0 1.5rem;
  background: transparent;
  pointer-events: none;
  z-index: 10;
}
.sam-chat-bottom .sam-chat-legal { display: none; }
.sam-chat-input-wrap {
  width: 100%;
  margin: 0 auto;
  pointer-events: auto;
}
.sam-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255,255,255,0.8);
  border-top: 1px solid #fff;
  border-radius: 100px;
  padding: 8px 8px 8px 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 0 0 1px rgba(227,6,19,0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.sam-chat-input-bar:focus-within {
  box-shadow: 0 25px 50px rgba(0,0,0,0.15), 0 0 0 2px rgba(227,6,19,0.2);
  transform: translateY(-2px);
  background: rgba(255,255,255,0.85);
}
.sam-chat-input-bar input {
  font-size: 1.15rem;
  font-weight: 500;
  height: 54px;
  font-family: var(--font);
  background: transparent;
  border: none; outline: none; flex: 1;
}
.sam-chat-input-bar input::placeholder { color: #94a3b8; }

/* Dark mode for chat components */
body.dark .sam-chat-fullpage {
  background: rgba(14, 14, 14, 0.05);
}
body.dark .sam-chat-topbar {
  background: linear-gradient(to bottom, rgba(14,14,14,0.8) 0%, transparent 100%);
}
body.dark .sam-chat-back,
body.dark .sam-chat-newchat {
  background: rgba(30,30,30,0.7);
  border-color: rgba(255,255,255,0.1);
  color: #cbd5e1;
}
body.dark .sam-chat-back:hover,
body.dark .sam-chat-newchat:hover {
  background: rgba(30,30,30,0.9);
  color: #e2e8f0;
}
body.dark .sam-chat-topbar-name {
  color: #e2e8f0;
}
body.dark .sam-chat-topbar-status {
  color: #94a3b8;
}
body.dark .sam-chat-messages {
  background: transparent;
}
body.dark .sam-msg-bubble {
  background: rgba(30,30,30,0.5);
  backdrop-filter: blur(25px);
  border-color: rgba(255,255,255,0.1);
  color: #e2e8f0;
}
body.dark .sam-msg-bubble strong {
  color: #f1f5f9;
}
body.dark .sam-msg-bubble a {
  color: var(--red-light);
}
body.dark .sam-chat-input-bar {
  background: rgba(30,30,30,0.7);
  backdrop-filter: blur(40px);
  border-color: rgba(255,255,255,0.1);
}
body.dark .sam-chat-input-bar input {
  color: #e2e8f0;
}
body.dark .sam-chat-input-bar input::placeholder {
  color: #64748b;
}
body.dark .sam-chat-input-bar button {
  background: var(--red-primary);
}
body.dark .sam-doctor-card {
  background: rgba(30,30,30,0.7);
  backdrop-filter: blur(20px);
  border-color: rgba(255,255,255,0.1);
}
body.dark .sam-doctor-card:hover {
  background: rgba(30,30,30,0.9);
  border-color: rgba(227,6,19,0.3);
}
body.dark .sam-doctor-card-info h4 {
  color: #e2e8f0;
}
body.dark .sam-doctor-card-info .spec,
body.dark .sam-doctor-card-info .loc,
body.dark .sam-doctor-card-rating {
  color: #94a3b8;
}
.sam-chat-input-bar button {
  width: 54px; height: 54px; border-radius: 50%; background: #E30613; color: #fff; border: none; cursor: pointer; flex-shrink: 0; box-shadow: 0 4px 15px rgba(227,6,19,0.3); transition: all 0.3s;
}
.sam-chat-input-bar button:hover { background: #1a1a2e; transform: scale(1.05); }
.sam-chat-legal {
  text-align: center;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  max-width: 720px;
  margin-left: auto; margin-right: auto;
}
.sam-chat-legal strong { color: #64748b; }

/* Hide other sections when chat is active — high specificity prevents interaction */
body.sam-chat-active .specialties-section,
body.sam-chat-active .doctors-section,
body.sam-chat-active .cities-section,
body.sam-chat-active .advantage-section,
body.sam-chat-active footer,
body.sam-chat-active #samaritan-chatbot,
body.sam-chat-active .search-hero,
body.sam-chat-active .navbar {
  display: none;
}

@media (max-width: 768px) {
  .sam-chat-fullpage { padding: 0; }
  .sam-chat-container { max-width: 100%; }
  .sam-chat-topbar { padding: 0.6rem 1rem; }
  .sam-chat-messages { padding: 1rem 1rem; }
  .sam-chat-bottom { padding: 0.5rem 1rem 1rem; }
  .sam-msg { padding: 1rem 0; gap: 10px; }
  .sam-msg-avatar { width: 28px; height: 28px; border-radius: 8px; }
  .sam-msg-avatar img { width: 15px; height: 15px; }
  .sam-msg-bubble { font-size: 0.9rem; }
  .sam-recommend-section { padding-left: 0; }
  .sam-doctor-card-header { gap: 10px; margin-bottom: 0.6rem; }
  .sam-doctor-card-avatar { width: 42px; height: 42px; font-size: 0.85rem; }
  .sam-chat-back, .sam-chat-newchat { width: 34px; height: 34px; border-radius: 10px; }
  .sam-cards-grid { gap: 0.8rem; }
}

/* =================== SKELETON LOADING =================== */
.skeleton-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1.5rem;
}
.skeleton-card .sk-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 6px;
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-card .sk-line.sk-title { height: 18px; width: 60%; }
.skeleton-card .sk-line.sk-sub { height: 12px; width: 40%; }
.skeleton-card .sk-line.sk-wide { height: 12px; width: 80%; }
.skeleton-card .sk-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
.skeleton-card .sk-btn {
  height: 36px; border-radius: 8px; width: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media(max-width: 768px) {
  .skeleton-card { grid-template-columns: 1fr; }
}

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Doctor card two-column layout */
/* Doctor card layout and child elements defined in DOCTOR CARD 2-COLUMN LAYOUT section below */
.doctor-avatar { width: 48px; height: 48px; border-radius: 50%; background: #E30613; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; flex-shrink: 0; color: #fff; }

@media(max-width: 768px) {
  .doctors-grid { grid-template-columns: 1fr; }
}

/* Autocomplete dropdown */
.autocomplete-box {
  position: absolute;
  left: 0; right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 300;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.autocomplete-item {
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.autocomplete-item:hover { background: rgba(255,255,255,0.08); }
.autocomplete-item:focus-visible {
  background: rgba(227, 6, 19, 0.1);
  outline: 2px solid var(--red-primary);
  outline-offset: -2px;
}
.autocomplete-item:last-child { border-bottom: none; }

/* Filter dropdown menus */
.filter-bar { display: flex; align-items: center; gap: 0.8rem; max-width: 1200px; margin: 0 auto; }
.filter-label { color: #94a3b8; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.filter-dropdown { position: relative; }
.filter-btn {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.08);
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-btn:hover, .filter-btn.active { background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.15); }
.filter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  min-width: 160px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  padding: 0.4rem;
}
.filter-menu.open { display: block; }
.filter-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
  background: transparent;
  border: none;
}
.filter-option:hover { background: rgba(0,0,0,0.04); }
.filter-option.selected { background: rgba(227,6,19,0.1); color: #E30613; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.8rem;
  background: rgba(227,6,19,0.1);
  border: 1px solid rgba(227,6,19,0.2);
  border-radius: 100px;
  color: var(--red-light);
  font-size: 0.78rem;
  font-weight: 500;
}
.filter-chip-x { cursor: pointer; opacity: 0.7; transition: opacity 0.2s; }
.filter-chip-x:hover { opacity: 1; }

/* No results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}
.no-results h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.no-results p { color: var(--text-muted); }

/* Results section */
.results-section { padding: 2rem 3rem 4rem; max-width: 1200px; margin: 0 auto; }
@media(max-width: 768px) { .results-section { padding: 1.5rem; } }

/* Doctor tags — discrete inline style */
.doctor-tag { font-size: 0.78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; }
.tag-available { color: #22C55E; background: none; border: none; padding: 0; }
.tag-available::before { content: '●'; font-size: 0.5rem; }
.tag-verified { color: #22C55E; background: none; border: none; padding: 0; }
.tag-verified::before { content: '✓'; font-weight: 800; }
.tag-closed { color: #EF4444; background: none; border: none; padding: 0; }
.tag-closed::before { content: '●'; font-size: 0.5rem; }
.doctor-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.doctor-header { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.8rem; }
.doctor-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.doctor-specialty { color: var(--text-muted); font-size: 0.82rem; }
.doctor-location { color: #94a3b8; font-size: 0.8rem; margin-top: 2px; }
.doctor-rating { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.rating-text { color: var(--text-muted); font-size: 0.82rem; }

/* =================== PRICING CARDS =================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  align-items: stretch;
}
@media(max-width: 968px) { .pricing-grid { grid-template-columns: 1fr; max-width: 480px; } }

.pricing-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.pricing-card-featured {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(227,6,19,0.2);
  box-shadow: 0 8px 30px rgba(227,6,19,0.08);
}
.pricing-card-featured:hover {
  box-shadow: 0 16px 50px rgba(227,6,19,0.12);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #E30613;
  color: #fff;
  padding: 0.4rem 1.5rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.pricing-header { text-align: center; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(0,0,0,0.06); }
.pricing-name { font-size: 1.3rem; font-weight: 700; color: #1e293b; margin-bottom: 0.8rem; }
.pricing-price { font-size: 2.8rem; font-weight: 800; color: #1e293b; letter-spacing: -0.03em; }
.pricing-mo { font-size: 1rem; font-weight: 500; color: #94a3b8; }
.pricing-period { font-size: 0.85rem; color: #94a3b8; margin-top: 0.3rem; }
.pricing-features {
  list-style: none;
  flex: 1;
  margin-bottom: 2rem;
}
.pricing-features li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
}
.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #22C55E;
  font-weight: 700;
}
.pricing-features li strong { color: #1e293b; }
.pricing-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  text-align: center;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.pricing-btn-primary {
  background: #E30613;
  color: #fff;
  box-shadow: 0 4px 15px rgba(227,6,19,0.25);
}
.pricing-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(227,6,19,0.35);
}
.pricing-btn-outline {
  background: rgba(255,255,255,0.6);
  color: #1e293b;
  border: 1px solid rgba(0,0,0,0.08);
}
.pricing-btn-outline:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-2px);
}

/* =================== LEGAL PAGES =================== */
.legal-page {
  padding: 10rem 3rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}
.legal-content {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}
.legal-updated {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 3rem;
}
.legal-section {
  margin-bottom: 2.5rem;
}
.legal-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
}
.legal-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #374151;
  margin: 1.5rem 0 0.5rem;
}
.legal-section p {
  color: #475569;
  line-height: 1.8;
  margin-bottom: 0.8rem;
}
.legal-section ul, .legal-section ol {
  color: #475569;
  padding-left: 1.5rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}
.legal-section li {
  margin-bottom: 0.3rem;
}
@media(max-width: 768px) {
  .legal-page { padding: 7rem 1.5rem 3rem; }
  .legal-content { padding: 2rem 1.5rem; }
}

/* =================== FAQ =================== */
.faq-item {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}
.faq-item:hover { background: rgba(255, 255, 255, 0.85); }
.faq-item h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}
.faq-item p {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.7;
}

/* =================== DOCTOR CARD 2-COLUMN LAYOUT FIX =================== */
.doctor-card {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1.5rem;
  align-items: start;
}
.doctor-card-left { min-width: 0; }
.doctor-card-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: space-between;
  height: 100%;
}
@media(max-width: 768px) {
  .doctor-card { grid-template-columns: 1fr; }
}

/* =================== FAVORITE BUTTON =================== */
.fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
}
.fav-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(212,43,43,0.2);
}
.fav-btn svg {
  width: 18px; height: 18px;
  transition: all 0.25s;
}
.fav-btn.active {
  background: rgba(212,43,43,0.1);
  border-color: rgba(212,43,43,0.2);
}
.fav-btn.active svg {
  fill: #D42B2B;
  stroke: #D42B2B;
}
.fav-btn:not(.active) svg {
  fill: none;
  stroke: #666;
}
@keyframes fav-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.fav-btn.bounce { animation: fav-bounce 0.4s ease; }
body.dark .fav-btn {
  background: rgba(30,30,30,0.85);
  border-color: rgba(255,255,255,0.08);
}
body.dark .fav-btn:not(.active) svg { stroke: #999; }

/* =================== STORIE MASTHEAD — compact =================== */
.storie-masthead {
  position: relative;
  z-index: 10;
  background: transparent;
  border-bottom: none;
  padding: 0;
}
.storie-masthead-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 6.5rem 1.5rem 1.5rem;
  text-align: center;
}
.storie-masthead-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.storie-masthead-title {
  font-family: var(--font);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: 0.2rem;
}
.storie-masthead-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.3rem;
}

/* =================== FEED LAYOUT =================== */
.feed-column {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  position: relative;
  z-index: 10;
}

/* Compose box — collapsed prompt */
.feed-compose {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 100px;
  padding: 0;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.feed-compose.expanded {
  border-radius: 24px;
}
.feed-compose-prompt {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}
.feed-compose-prompt:hover {
  background: rgba(0,0,0,0.02);
}
.feed-compose-avatar {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.feed-compose-text {
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Compose box — expanded form */
.feed-compose-expanded {
  padding: 1.2rem;
}
.feed-compose-expanded .form-group {
  margin-bottom: 0.8rem;
}
.feed-compose-expanded .form-input {
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
}
.feed-compose-expanded .form-textarea {
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  min-height: 100px;
}
.feed-compose-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.5rem;
}
.feed-compose-selects {
  display: flex;
  gap: 0.5rem;
}
.form-select-sm {
  padding: 0.4rem 0.7rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-muted);
  outline: none;
  cursor: pointer;
}
.form-select-sm:focus { border-color: var(--red-primary); }
.feed-compose-submit {
  font-size: 0.82rem;
  padding: 0.5rem 1.2rem;
  white-space: nowrap;
}
.feed-compose-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* Filter tabs — segmented control */
.feed-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: none;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 100px;
}
.feed-tab {
  padding: 0.5rem 1.1rem;
  background: transparent;
  border: none;
  border-bottom: none;
  margin-bottom: 0;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 100px;
}
.feed-tab:hover { color: var(--text-main); }
.feed-tab.active {
  background: #fff;
  color: var(--text-main);
  border-bottom-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Feed list — single column */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Feed card — single column story card */
.feed-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 1.5rem 1.6rem;
  transition: var(--transition);
  box-shadow: 0 4px 24px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
}
.feed-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* Responsive */
@media (max-width: 768px) {
  .feed-compose-bottom { flex-direction: column; align-items: stretch; }
  .feed-compose-selects { flex-direction: column; }
  .feed-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Compact footer on storie page */
body:has(.feed-column) footer {
  margin-top: 0;
  padding: 2rem 1.5rem 1.5rem;
}
body:has(.feed-column) .footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.story-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 2rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
}
.story-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.06); }

.story-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.story-badge { padding: 0.3rem 0.8rem; border-radius: 100px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.story-badge-positive { background: #ECFDF5; color: #065F46; }
.story-badge-difficult { background: #FEF2F2; color: #991B1B; }
.story-badge-advice { background: #EFF6FF; color: #1E40AF; }
.story-date { font-size: 0.8rem; color: #94a3b8; }

.story-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; margin-bottom: 0.8rem; line-height: 1.3; }
.story-text { font-size: 0.9rem; color: #475569; line-height: 1.7; margin-bottom: 1.2rem; flex: 1; }
.story-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.story-tag { padding: 0.25rem 0.7rem; background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.06); border-radius: 100px; font-size: 0.75rem; color: #64748b; font-weight: 500; }
.story-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,0.05); }
.story-author { font-size: 0.78rem; color: #94a3b8; font-style: italic; }
.story-likes { font-size: 0.85rem; cursor: pointer; user-select: none; transition: transform 0.2s; }
.story-likes:hover { transform: scale(1.1); }
.story-likes.liked { transform: scale(1.2); }

/* Clickable feed card (link variant) */
.feed-card--link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.feed-card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.08);
}
.feed-card--link:hover .story-title {
  color: var(--red-primary);
}
.feed-card--link .story-likes {
  cursor: default;
}

/* ========== STORIA DETAIL PAGE ========== */

/* storia.html uses art-page so it gets white bg and hidden mesh from art-page rules */

/* Storia-specific info row */
.storia-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.storia-likes-display {
  font-size: 1rem;
  font-weight: 600;
}
.storia-anon-badge {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Related stories grid — card-based, not image-based */
.storia-related {
  padding: 2.5rem 1.5rem 3rem;
}
.storia-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
  max-width: 1400px;
  margin: 0 auto;
}
.storia-related-card {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.storia-related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.1);
}
.storia-related-card:hover .storia-related-card-title {
  color: var(--red-primary);
}
.storia-related-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.6rem;
  line-height: 1.35;
  transition: color 0.2s;
}
.storia-related-card-text {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

/* Mobile responsive for storia */
@media (max-width: 768px) {
  .storia-related-grid {
    grid-template-columns: 1fr;
  }
}

.story-filter {
  padding: 0.6rem 1.5rem;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: var(--transition);
}
.story-filter:hover { background: rgba(255,255,255,0.9); color: #1e293b; }
.story-filter.active { background: #1e293b; color: #fff; border-color: #1e293b; }

/* =================== FORMS =================== */
.story-form-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.9rem; font-weight: 600; color: #1e293b; margin-bottom: 0.5rem; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9rem;
  color: #1e293b;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: #E30613; }
.form-input:disabled, .form-textarea:disabled, .form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.form-input.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.form-textarea.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.78rem; color: #94a3b8; margin-top: 0.3rem; text-align: right; }
.form-radio-group { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.form-radio { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: #475569; cursor: pointer; }
.form-radio input[type="radio"] { accent-color: #E30613; }
.form-disclaimer {
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.1);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.form-disclaimer p { font-size: 0.82rem; color: #64748b; line-height: 1.6; }

/* =================== UTILITY CLASSES (replacing inline styles) =================== */

/* --- Spacing & Layout --- */
.u-mb-2    { margin-bottom: 2rem; }
.u-mb-2\.5 { margin-bottom: 2.5rem; }
.u-mb-3    { margin-bottom: 3rem; }
.u-mt-05   { margin-top: 0.5rem; }
.u-mt-1    { margin-top: 1rem; }
.u-pb-4    { padding-bottom: 4rem; }
.u-pt-2    { padding-top: 2rem; }
.u-p-3     { padding: 3rem; }
.u-mx-auto { margin: 0 auto; }
.u-max-w-800 { max-width: 800px; margin-left: auto; margin-right: auto; }
.u-w-full  { width: 100%; }

/* --- Flexbox --- */
.u-flex-center       { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.u-flex-center-08    { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.u-flex-col          { display: flex; flex-direction: column; gap: 1rem; }
.u-flex-align-center { display: flex; align-items: center; }
.u-flex-shrink-0     { flex-shrink: 0; }
.u-grid-full-col     { grid-column: 1 / -1; }

/* --- Typography --- */
.u-text-sm     { font-size: 0.85rem; }
.u-text-xs     { font-size: 0.8rem; }
.u-text-xxs    { font-size: 0.78rem; }
.u-text-lg     { font-size: 1.25rem; }
.u-text-hero-sm { font-size: clamp(2.5rem, 5vw, 4.5rem); }
.u-text-095    { font-size: 0.95rem; }
.u-text-center { text-align: center; }
.u-fw-500      { font-weight: 500; }
.u-fw-600      { font-weight: 600; }

/* --- Colors --- */
.u-color-muted   { color: #64748b; }
.u-color-slate   { color: #94a3b8; }
.u-color-dark    { color: var(--gray-800); }
.u-color-gray500 { color: var(--gray-500); }
.u-color-gray400 { color: var(--gray-400); }
.u-color-gray600 { color: var(--gray-600); }
.u-color-gray700 { color: var(--gray-700); }
.u-color-red     { color: #E30613; }
.u-color-cyan    { color: var(--cyan-dark); }
.u-color-white-40 { color: rgba(255,255,255,0.4); }

/* --- Transition Delay Stagger --- */
.u-delay-1  { transition-delay: 0.1s; }
.u-delay-2  { transition-delay: 0.2s; }
.u-delay-3  { transition-delay: 0.3s; }

/* --- Decorative Separator --- */
.u-separator {
  width: 100%;
  max-width: 800px;
  height: 1px;
  border: none;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
  margin: 0 auto 2.5rem;
  display: block;
}

/* --- Smart Bar Icon --- */
.smart-bar-icon-lg { font-size: 1.4rem; line-height: 1; }

/* --- Box Visual Canvas --- */
.box-visual-canvas {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.box-visual-canvas canvas { max-width: 100%; }

/* --- Footer Utility --- */
.footer-disclaimer { margin-top: 0.5rem; font-size: 0.8rem; color: #94a3b8; }
.footer-compact { padding: 3rem; text-align: center; border-top: 1px solid rgba(0,0,0,0.06); }
.footer-compact-text { color: #94a3b8; font-size: 0.85rem; }

/* --- Empty / Error States --- */
.u-empty-state { text-align: center; padding: 4rem 2rem; }
.u-empty-icon  { font-size: 2.5rem; margin-bottom: 0.8rem; opacity: 0.3; }
.u-empty-icon-lg { font-size: 3rem; margin-bottom: 1rem; opacity: 0.6; }

/* --- Load More Button --- */
.btn-load-more {
  display: inline-block;
  padding: 0.8rem 2rem;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  background: #1a1a2e;
  color: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
}
.btn-load-more:hover { background: var(--red-primary); }

/* --- Action Buttons (small variants) --- */
.btn-action-sm { padding: 0.5rem 1.2rem; font-size: 0.8rem; }
.btn-action-xs { padding: 0.5rem 1rem; font-size: 0.75rem; }

/* --- Contact Info Row --- */
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.contact-row:last-child { border-bottom: none; }
.contact-row svg { flex-shrink: 0; }
.contact-row span { color: var(--gray-800); font-size: 0.88rem; font-weight: 500; }

/* --- Score Display --- */
.score-display { text-align: center; margin-top: 1.2rem; }
.score-value { font-size: 2.2rem; font-weight: 800; color: #1F2937; letter-spacing: -0.03em; }
.score-denominator { font-size: 0.85rem; color: var(--gray-500); font-weight: 500; }

/* --- Compare Buttons --- */
.compare-btn-primary { background: var(--red-primary); color: #fff; margin-bottom: 4px; }
.compare-btn-secondary { background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-200); margin-top: 4px; }

/* =================== TRUST BAR =================== */
.trust-bar {
  padding: 4rem 3rem;
  position: relative;
  z-index: 10;
}
.trust-bar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.trust-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #1e293b;
  line-height: 1.1;
}
.trust-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  .trust-bar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.5rem;
  }
}

/* =================== NEWS PAGE =================== */
/* =================== INCHIESTE — EDITORIAL LAYOUT =================== */

/* Editorial masthead — 3 rows: identity, stats, filters */
/* Masthead: full-width background, content constrained via .inv-masthead-inner.
   .inv-masthead-inner uses the SAME box model as .inv-featured / .news-section / .inv-cta-section:
   max-width: 1200px, padding: 0 3rem, margin: 0 auto.
   This guarantees pixel-perfect alignment across all sections. */
.inv-masthead {
  position: relative;
  z-index: 10;
  background: #E8E9EC;
  border-bottom: 1px solid #DCDEE2;
  padding: 0;                /* override global section { padding: 8rem 3rem } */
}
.inv-masthead-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 6.5rem 1.5rem 2.5rem;  /* match art-header spacing */
}

/* Row 1 — Section identity: tag + title left, description right */
.inv-masthead-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 0.75rem;
}
.inv-masthead-identity {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.inv-masthead-tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  background: var(--red-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  width: fit-content;
}
.inv-masthead-title {
  font-family: var(--font);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: 0.15rem;
}
.inv-masthead-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
  text-align: right;
  flex-shrink: 0;
}

/* Row 2 — Stats ticker bar */
.inv-masthead-stats {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.inv-stat {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.inv-stat-num {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.inv-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.inv-stat-sep {
  width: 1px;
  height: 1.4rem;
  background: rgba(0,0,0,0.1);
  flex-shrink: 0;
}

/* Row 3 — Search + Filters combined */
.inv-masthead-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0 0.3rem;
}

/* Search bar */
.inv-search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 100px;
  padding: 0.3rem 0.4rem 0.3rem 1rem;
  gap: 0.4rem;
  flex-shrink: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.inv-search-bar:focus-within {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(227,6,19,0.08);
}
.inv-search-input {
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  width: 180px;
}
.inv-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
.inv-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--red-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.inv-search-btn:hover { background: #c4000f; }

/* Filters — inline with search */
.inv-masthead-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Filter pills */
.news-filter-btn {
  padding: 0.35rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.08);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.news-filter-btn:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}
.news-filter-btn:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}
.news-filter-btn.active {
  background: var(--red-primary);
  color: #fff;
  border-color: var(--red-primary);
  box-shadow: 0 4px 12px rgba(227,6,19,0.2);
}

/* ---- Category color system ---- */
.news-card[data-category="fatture"]      { --cat-color: #E30613; }
.news-card[data-category="malpractice"] { --cat-color: #E87A00; }
.news-card[data-category="sistema"]      { --cat-color: #1A3A5C; }
.news-card[data-category="segnalazioni"]{ --cat-color: #7B2D8E; }

/* Left accent bar on every card */
.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--cat-color, var(--red-primary));
  border-radius: 18px 0 0 18px;
  z-index: 2;
}

/* Top gradient band — subtle color identity */
.news-card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cat-color, var(--red-primary));
}

/* ---- Featured split: hero left 60%, sidebar right 40% ---- */
.inv-featured {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 3rem 0;
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-rows: 1fr;
  align-items: stretch;
  gap: 1.2rem;
  position: relative;
  z-index: 10;
}

/* Hero card — main investigation, bold and prominent */
.inv-hero-card {
  border-radius: 18px;
  padding: 2.2rem 2.2rem 2.2rem 2.5rem;  /* extra left for accent bar */
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(227, 6, 19, 0.04) 100%);
  cursor: pointer;
  height: 100%;
}
.inv-hero-card::before {
  width: 5px;  /* thicker accent for hero */
}
.inv-hero-card .news-card-badge {
  align-self: flex-start;
}
.inv-hero-card .news-card-category { display: none; } /* badge is enough */
.inv-hero-card .news-card-meta { margin-top: auto; }
.inv-hero-title {
  font-size: clamp(1.5rem, 2.8vw, 1.9rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.22;
}
.inv-hero-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 540px;
}

/* Sidebar — two cards stacked, filling the column */
.inv-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  height: 100%;
}
.inv-sidebar-card {
  flex: 1;
  border-radius: 16px;
  padding: 1.4rem 1.4rem 1.4rem 1.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 0;
  min-height: 0;
}
.inv-sidebar-card .news-card-meta { margin-top: auto; }
.inv-sidebar-card .news-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}
.inv-sidebar-card .news-card-excerpt {
  font-size: 0.84rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- News Cards — clean white style ---- */
.news-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 18px;
  padding: 1.6rem 1.6rem 1.6rem 1.8rem;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-left: none;
}
.news-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.45), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 0;
}
.news-card:hover::after { opacity: 1; }
.news-card > * { position: relative; z-index: 1; }
.news-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

/* Cards as links — remove default link styling */
a.news-card,
a.news-card:visited,
a.news-card:hover,
a.news-card:active {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.news-card-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  background: var(--cat-color, var(--red-primary));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}
.news-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.news-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.news-card-meta {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.72rem;
  color: var(--gray-400);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0,0,0,0.04);
}
.news-card-read::before {
  content: '·';
  margin-right: 0.4rem;
}

/* ---- Regular grid — 3 equal columns, aligned tops ---- */
.news-section {
  padding: 1.2rem 3rem 5rem;
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.news-grid .news-card .news-card-meta { margin-top: auto; }

.news-load-more {
  text-align: center;
  margin-top: 2rem;
}

/* =================== REGION SECTIONS (Ticino / Svizzera) =================== */
.inv-region-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
  position: relative;
  z-index: 10;
}
.inv-region-section--alt {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}
.inv-region-inner {
  /* inherits max-width from parent */
}
.inv-region-title {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
  padding-bottom: 0;
  padding-left: 0.8rem;
  border-left: 3px solid var(--red-primary);
  border-bottom: none;
  display: block;
  text-transform: uppercase;
}

/* ---- Region grid: hero (large) + side cards ---- */
.inv-region-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.5rem;
}
.inv-region-grid .news-img-card--hero {
  grid-row: 1 / 3;
  min-height: 420px;
}

/* Flat grid (no hero): 3 equal columns */
.inv-region-grid--flat {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
}
.inv-region-grid--flat .news-img-card {
  min-height: 280px;
}

/* =================== IMAGE CARDS — overlay style =================== */
.news-img-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 10px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #1a1a2e;
  min-height: 200px;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-img-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.news-img-card:visited { color: #fff; }

/* Dark gradient overlay */
.news-img-card__overlay {
  padding: 1.5rem 1.2rem 1.2rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 45%;
  justify-content: flex-end;
}

/* Badge */
.news-img-card__badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  background: var(--red-primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: fit-content;
}
.news-img-card__badge--orange { background: #E87A00; }
.news-img-card__badge--navy { background: #1A3A5C; }
.news-img-card__badge--purple { background: #7B2D8E; }

/* Title */
.news-img-card__title {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.01em;
}
.news-img-card__title--hero {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Meta */
.news-img-card__meta {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
}

/* ---- Region responsive ---- */
@media (max-width: 1024px) {
  .inv-region-grid--flat {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .inv-region-section {
    padding: 2rem 1.5rem 0;
  }
  .inv-region-grid {
    grid-template-columns: 1fr;
  }
  .inv-region-grid .news-img-card--hero {
    grid-row: auto;
    min-height: 280px;
  }
  .inv-region-grid--flat {
    grid-template-columns: 1fr;
  }
  .news-img-card__title--hero {
    font-size: 1.15rem;
  }
}

/* ---- CTA bar — horizontal, compact ---- */
.inv-cta-section {
  padding: 2rem 1.5rem 2.5rem;
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto;
}
.inv-cta-card {
  background: linear-gradient(135deg, #FFF5F5 0%, rgba(227,6,19,0.06) 100%);
  border: 1.5px solid rgba(227,6,19,0.15);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 8px 32px rgba(227,6,19,0.08), 0 2px 8px rgba(0,0,0,0.04);
}
.inv-cta-title {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.inv-cta-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.55;
}
.inv-cta-card .btn-primary {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .inv-masthead-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .inv-masthead-desc {
    text-align: left;
    max-width: none;
  }
  .inv-featured {
    grid-template-columns: 1fr 1fr;
  }
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .inv-masthead-inner {
    padding: 5.5rem 1.5rem 0;
  }
  .inv-masthead-title {
    font-size: 1.3rem;
  }
  .inv-masthead-stats {
    gap: 1rem;
    flex-wrap: wrap;
  }
  .inv-stat-num { font-size: 1.1rem; }
  .inv-masthead-controls {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }
  .inv-search-input {
    width: 100%;
  }
  .inv-search-bar {
    width: 100%;
  }
  .inv-masthead-filters {
    gap: 0.4rem;
  }
  .inv-featured {
    grid-template-columns: 1fr;
    padding: 1rem 1.5rem 0;
    gap: 1rem;
  }
  .inv-hero-card { height: auto; }
  .inv-sidebar {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.8rem;
    padding-bottom: 0.5rem;
    height: auto;
  }
  .inv-sidebar-card {
    min-width: 260px;
    flex: 0 0 auto;
    height: auto;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-section {
    padding: 1rem 1.5rem 3rem;
  }
  .inv-cta-section {
    padding: 0 1.5rem 3rem;
  }
  .inv-cta-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 1rem;
  }
}

/* =================== ARTICLE PAGE — FOCUS READER =================== */

/* White background — covers the mesh bg on editorial pages */
body:has(.art-page) .mesh-bg,
body:has(.inv-masthead) .mesh-bg { display: none; }
body:has(.art-page),
body:has(.inv-masthead) {
  background: #fff;
}
/* Footer on editorial pages: solid gray */
body:has(.art-page) footer,
body:has(.inv-masthead) footer {
  background: #F3F4F6;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid #E5E7EB;
  margin-top: 0;
}

/* Reading progress bar — fixed at top */
.art-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--red-primary);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Article header — dark gray band, full width */
.art-header {
  background: var(--dark-navy);
  padding: 6.5rem 1.5rem 2.5rem;  /* original article header spacing */
  position: relative;
  z-index: 10;
}
.art-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Back link — white on red */
.art-back {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.2s;
}
.art-back:hover { color: #fff; }

/* Category bar on red bg */
.art-category-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.art-category {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.85);
}
.art-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: #fff;
  color: var(--red-primary);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Title — white on red */
.art-title {
  font-family: var(--font);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.8rem;
}

/* Meta row — white on red */
.art-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 0;
}
.art-meta-sep { opacity: 0.4; }

/* Article page container — body only, white */
.art-page {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  background: #fff;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ---- Article body — the reading column ---- */
.art-body {
  font-family: var(--font);
  font-size: 1.2rem;
  color: var(--text-main);
  line-height: 1.75;
}
/* Article images — aligned with text */
.art-figure {
  margin: 1.5rem 0;
  position: relative;
}
.art-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  max-height: 460px;
}
.art-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.7rem;
  padding: 0;
  line-height: 1.5;
}

.art-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.8rem;
  color: var(--text-main);
}
.art-body p {
  margin-bottom: 1rem;
  color: rgba(20,30,50,0.82);
}

/* Lead paragraph — first paragraph, bold intro */
.art-page .art-lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Pull quote — breaks out of column for editorial weight */
.art-pullquote {
  margin: 1.5rem 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-left: 4px solid var(--red-primary);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.55;
  background: rgba(227,6,19,0.02);
  border-radius: 0 12px 12px 0;
}
.art-pullquote cite {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 500;
  color: var(--text-muted);
}

/* Highlight box — numbered findings, breaks out wider */
.art-highlight-box {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.art-highlight-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  background: #F8F9FA;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  transition: box-shadow 0.25s ease;
}
.art-highlight-item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.art-highlight-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--red-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}
.art-highlight-item strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.art-highlight-item p {
  font-size: 0.9rem;
  margin-bottom: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Key takeaway box */
.art-key-takeaway {
  margin: 1.5rem 0;
  padding: 1.5rem 1.5rem;
  background: linear-gradient(135deg, #FEF2F2 0%, #FFF7ED 100%);
  border: 1px solid rgba(227,6,19,0.08);
  border-left: 4px solid var(--red-primary);
  border-radius: 0 14px 14px 0;
}
.art-key-takeaway strong {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red-primary);
  margin-bottom: 0.5rem;
}
.art-key-takeaway p {
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.6;
}

/* Footer meta: tags + share */
.art-footer-meta {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 2rem;
}
.art-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.art-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
/* Social share buttons */
.art-share {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.art-share-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.art-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F3F4F6;
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}
.art-share-btn:hover {
  background: var(--red-primary);
  color: #fff;
  border-color: var(--red-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(227,6,19,0.2);
}
.art-tag {
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  background: #F3F4F6;
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s;
}
.art-tag:hover {
  background: #E5E7EB;
}

/* ---- Related articles grid ---- */
.art-related {
  max-width: 100%;
  margin: 0;
  padding: 2rem 1.5rem 2.5rem;
  position: relative;
  z-index: 10;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
}
.art-related > * {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}
.art-related-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--red-primary);
  text-transform: uppercase;
}
.art-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.art-related-grid .news-img-card {
  min-height: 240px;
}
.art-related-card {
  text-decoration: none;
  cursor: pointer;
}

/* CTA constrained on article page — align with text column */
.art-cta-constrained {
  max-width: 1400px;
  padding: 2rem 1.5rem 2.5rem;
}

/* ---- Article responsive ---- */
@media (max-width: 768px) {
  .art-header {
    padding: 5rem 1.5rem 2rem;
  }
  .art-page {
    padding: 2rem 1.2rem 2rem;
  }
  .art-title {
    font-size: 1.6rem;
  }
  .art-body {
    font-size: 1rem;
  }
  .art-pullquote {
    font-size: 1.05rem;
    padding-left: 1.2rem;
    margin: 2rem 0;
    border-radius: 0;
  }
  .art-figure {
    margin-left: -1.2rem;
    margin-right: -1.2rem;
  }
  .art-caption {
    padding: 0 1.2rem;
  }
  .art-highlight-box {
    margin-left: 0;
    margin-right: 0;
  }
  .art-key-takeaway {
    margin-left: 0;
    margin-right: 0;
  }
  .art-footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .art-share-label {
    display: none;
  }
  .art-cta-constrained {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
  .inv-cta-card {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .art-related {
    padding: 2rem 1.5rem 3rem;
  }
  .art-related-grid {
    grid-template-columns: 1fr;
  }
  .art-highlight-item {
    flex-direction: column;
    gap: 0.6rem;
  }
}

/* Accessibility - Focus indicators */
*:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =================== MOBILE SMALL (375px and below) =================== */
@media (max-width: 375px) {
  html { font-size: 14px; }

  .hero-title { font-size: 1.8rem; line-height: 1.2; }
  .hero-subtitle { font-size: 0.85rem; }

  .search-bar, .search-box, .home-search-box {
    flex-direction: column;
    gap: 0.5rem;
  }
  .search-field, .home-search-field { width: 100%; min-width: 0; }
  .search-btn { width: 100%; border-radius: 12px; }

  .specialty-chips { gap: 0.4rem; }
  .specialty-chip { font-size: 0.7rem; padding: 0.35rem 0.7rem; }

  .doctors-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .doctor-card { padding: 1rem; }
  .doctor-card-right { display: none; }
  .doctor-card-left { width: 100%; }

  .section-title { font-size: 1.3rem; }
  .section-desc { font-size: 0.8rem; }

  .specialty-grid, .cities-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .specialty-card, .city-card { padding: 0.8rem; }

  .advantage-grid { grid-template-columns: 1fr; }

  .nav-center { display: none; }
  .nav-right .nav-label { display: none; }
  .nav-cta { display: none; }
  .nav-left .nav-brand { font-size: 1rem; }

  footer .footer-content { flex-direction: column; text-align: center; gap: 1rem; }
  .footer-links { flex-direction: column; gap: 0.5rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .comparison-table { font-size: 0.75rem; }

  /* Modals on small screens */
  #reviews-detail-modal > div,
  #review-modal > div,
  #report-modal > div {
    margin: 0.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    max-height: 95vh;
  }
}

/* =================== MOBILE EXTRA SMALL (320px) =================== */
@media (max-width: 320px) {
  html { font-size: 13px; }

  .hero-title { font-size: 1.5rem; }
  .hero-section { padding: 5rem 0.8rem 2rem; }

  .specialty-grid, .cities-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }

  .doctor-header { flex-direction: column; align-items: flex-start; }
  .doctor-avatar { width: 36px; height: 36px; font-size: 0.7rem; }

  .nav-left { gap: 0.3rem; }
  .nav-logo { width: 24px; height: 24px; }
}

/* =================== FOCUS STATES (Accessibility) =================== */
:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 2px;
}

.nav-center a:focus-visible { border-radius: 8px; }
.search-btn:focus-visible { outline-offset: 3px; }
.doctor-card:focus-visible { outline-offset: 4px; border-radius: 16px; }
.specialty-chip:focus-visible { border-radius: 20px; }

/* =================== SKIP TO CONTENT (Accessibility) =================== */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
  padding: 1rem 2rem;
  background: var(--red-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 0 0 12px 0;
}
.skip-to-content:focus {
  left: 0;
  top: 0;
  width: auto;
  height: auto;
}

/* =================== UI STATES =================== */
.state-empty, .state-loading, .state-error {
  text-align: center;
  padding: 3rem 1.5rem;
}
.state-empty-icon, .state-loading-icon, .state-error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}
.state-empty-title, .state-error-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.state-empty-desc, .state-error-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
}
.state-error { color: #EF4444; }
.state-error-title { color: #DC2626; }

.state-loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(0,0,0,0.08);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== MOBILE 480px =================== */
@media(max-width: 480px) {
  .navbar { height: 64px; padding: 0 0.8rem; }
  .nav-brand { font-size: 14px; }
  .nav-sam { width: 32px; height: 32px; padding: 0; }
  .nav-sam-icon-wrap { width: 20px; height: 20px; }
  .nav-right { gap: 8px; }

  section { padding: 3rem 1rem; }
  .home-hero, .search-hero { padding: 6rem 1rem 3rem; }
  .results-header { padding: 4rem 1rem 2rem; }
  #results-title { font-size: clamp(1.4rem, 3vw, 1.8rem); }

  .filter-bar-wrap { padding: 0.6rem 0.8rem; }
  .filter-option { padding: 0.4rem 0.9rem; font-size: 0.75rem; }

  .top-doctor-card, .feature-card, .security-item,
  .advantage-card, .specialty-card, .doctor-card { padding: 1rem; }

  .section-header { margin-bottom: 2rem; }
  .section-title { font-size: clamp(1.6rem, 4vw, 2rem); }

  .box-section { padding: 2rem 1rem; }
  .box-content { gap: 2rem; }
  .box-text h2 { font-size: clamp(1.6rem, 4vw, 2rem); }

  .footer-content { padding: 1rem; gap: 1rem; }
  .footer-links { gap: 0.3rem 0.8rem; font-size: 0.75rem; }
  .footer-bottom { padding: 1rem; }
  .footer-bottom-inner { gap: 1rem; }
  .footer-bottom-brand { font-size: 14px; }
  .footer-bottom-text { font-size: 0.7rem; }

  .home-quick-specialties, .quick-specialties {
    grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0 0.3rem;
  }
  .home-specialty-chip, .specialty-chip { padding: 0.5rem 0.8rem; font-size: 0.78rem; }

  .smart-bar-inner { padding: 0.3rem 0.3rem 0.3rem 0.8rem; }
  .smart-bar-input { font-size: 0.9rem; }
  .privacy-badge { font-size: 0.7rem; padding: 0 0.8rem; }
}

/* =================== MOBILE 375px =================== */
@media(max-width: 375px) {
  .navbar { height: 56px; padding: 0 0.5rem; }
  .nav-logo, .nav-logo-icon { width: 20px; height: 20px; }

  section { padding: 2.5rem 0.8rem; }
  .home-hero, .search-hero { padding: 5rem 0.8rem 2.5rem; }

  .top-doctor-card, .feature-card, .security-item,
  .advantage-card, .specialty-card, .doctor-card { padding: 0.8rem; }

  .footer-content { padding: 0.8rem; gap: 0.8rem; }
  .footer-links a { font-size: 0.7rem; }
  .footer-bottom { padding: 0.8rem; }
}

/* =================== PRINT STYLES =================== */
@media print {
  .mesh-bg, .navbar, .mobile-menu, footer, .nav-hamburger,
  .search-bar, .specialty-chips, .dark-toggle-wrap { display: none; }

  body { background: #fff; color: #000; font-size: 12pt; }
  .doctor-card { break-inside: avoid; border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; }
  a { color: #000; text-decoration: underline; }
  .hero-section { background: none; padding: 1rem 0; }
}
