:root {
  /* Brand Colors (derived from logo SVG #20326C) */
  --brand-50: #f4f5f9;
  /* Very Light, bright */
  --brand-100: #daddf0;
  /* Soft contrast */
  --brand-500: #4a67cc;
  /* Brighter accent for buttons/hovers to keep vibes up */
  --brand-600: #3b52a3;
  /* Primary interactive */
  --brand-800: #263875;
  /* Deep, strong */
  --brand-900: #20326c;
  /* Exact Logo Base Color */

  /* Deep dark blue */

  /* Neutral Colors */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --white: #ffffff;
  --black: #000000;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background-color: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--gray-900);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  font-size: 1.125rem;
  color: var(--gray-600);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: 6rem 0;
}

.text-center {
  text-align: center;
}

.img-fluid {
  width: 100%;
  object-fit: cover;
}

/* Flexbox Grid */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-4 {
  gap: 1rem;
}

.gap-8 {
  gap: 2rem;
}

@media (min-width: 768px) {
  .md\:flex-row {
    flex-direction: row;
  }

  .md\:gap-12 {
    gap: 3rem;
  }

  .md\:w-1\/2 {
    width: 50%;
  }
}

/* Header & Navbar */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  transition: all var(--transition-normal);
  background: rgba(255, 255, 255, 0.85);
  /* Default glass */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 0;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  transition: padding var(--transition-normal);
}

.nav-brand img {
  height: 80px !important;
  width: auto;
  max-height: none;
  transition: height var(--transition-normal);
}

.header.scrolled .nav-brand img {
  height: 60px !important;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  color: var(--gray-800);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--brand-500);
  transition: width var(--transition-normal);
}

.nav-links a:hover {
  color: var(--brand-600);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-800);
}

/* Call to Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  /* Pill */
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--brand-600);
  color: var(--white);
  box-shadow: 0 4px 14px 0 rgba(2, 132, 199, 0.39);
}

.btn-primary:hover {
  background-color: var(--brand-800);
  box-shadow: 0 6px 20px 0 rgba(7, 89, 133, 0.23);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--brand-900);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background-color: var(--brand-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  /* offset header */
  background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-800) 100%);
  color: var(--white);
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 2rem 0;
}

.hero h1 {
  color: var(--white);
}

.hero-subtitle {
  color: var(--brand-100);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-tag {
  display: inline-block;
  padding: 0.25rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

.hero-image-wrapper {
  position: relative;
  z-index: 10;
  height: 600px;
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 4px solid rgba(255, 255, 255, 0.1);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Cards (Especialidades, Features) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.feature-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, var(--brand-50) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--brand-100);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background-color: var(--brand-50);
  color: var(--brand-600);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 1.5rem;
  transition: all var(--transition-normal);
}

.feature-card:hover .feature-icon {
  background-color: var(--brand-500);
  color: var(--white);
  transform: scale(1.1) rotate(-5deg);
}

.feature-card h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* Glass Section */
.glass-section {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 32px;
  padding: 4rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
}

/* Doctor Profile Section */
.profile-section {
  background-color: var(--white);
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 992px) {
  .profile-card {
    flex-direction: row;
  }
}

.profile-image {
  flex: 1;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.profile-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}

.profile-info {
  flex: 1;
}

.profile-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.badge {
  background-color: var(--gray-100);
  color: var(--brand-800);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Doctor Filters */
.doctor-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.625rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 9999px;
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
  border-color: var(--brand-500);
  color: var(--brand-600);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--brand-900);
  color: var(--white);
  border-color: var(--brand-900);
  box-shadow: 0 4px 12px rgba(32, 50, 108, 0.2);
}

/* Doctor Grid */
.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.doctor-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.doctor-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.doctor-card-img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  background-color: var(--brand-50);
}

.doctor-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.doctor-card-content .btn {
  margin-top: auto;
}

.doctor-card-spec {
  display: block;
  font-size: 0.75rem;
  color: var(--brand-500);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.doctor-card-name {
  font-size: 1.25rem;
  color: var(--brand-900);
  margin-bottom: 0.75rem;
}

.doctor-card-info {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.doctor-card-badge {
  font-size: 0.75rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Animations for Filtering */
.doctor-card.hidden {
  display: none;
}

.doctor-card.fade-in {
  animation: cardFadeIn 0.5s ease-out forwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  transform: translateX(-50px);
}

.reveal-right {
  transform: translateX(50px);
}

.reveal-left.active,
.reveal-right.active {
  transform: translateX(0);
}

/* Floating WhatsApp Botton */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.2);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.3);
}

/* Convenios (Insurances) Marquee */
.convenios-marquee {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  padding: 1rem 0;
  display: flex;
  align-items: center;
}

/* Gradient fade at edges for smooth entry/exit */
.convenios-marquee::before,
.convenios-marquee::after {
  content: '';
  position: absolute;
  top: 0;
  width: 60px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.convenios-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--brand-50), transparent);
}

.convenios-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--brand-50), transparent);
}

.convenios-track {
  display: inline-flex;
  gap: 1rem;
  padding-left: 1rem;
  animation: scroll-marquee 80s linear infinite;
}

/* Pause animation on hover */
.convenios-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }

  /* Scrolls exactly one half of the duplicated string */
}

.convenio-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--white);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  /* Pill */
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: default;
}

.convenio-badge:hover {
  background-color: var(--brand-500);
  color: var(--white);
  border-color: var(--brand-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Footer */
footer {
  background-color: var(--brand-900);
  color: var(--brand-50);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--brand-500);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--brand-800);
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    /* simple mobile hide for now */
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    text-align: center;
    padding-top: 120px;
  }

  .hero-tag {
    margin: 0 auto 1.5rem;
  }

  .hero-image-wrapper {
    height: 400px;
    margin-top: 3rem;
  }

  .glass-section {
    padding: 2rem;
  }

  .btn-primary {
    width: 100%;
  }

  .whatsapp-float {
    bottom: 20px;
    right: 20px;
  }
}
details > summary::-webkit-details-marker { display: none; }

/* Video Modal Styles */
.video-trigger {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  display: block;
  outline: none;
}

.play-button-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 50, 108, 0.2);
  transition: background var(--transition-normal);
  z-index: 2;
}

.video-trigger:hover .play-button-overlay {
  background: rgba(32, 50, 108, 0.4);
}

.play-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all var(--transition-normal);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

.play-icon i {
  width: 32px;
  height: 32px;
  margin-left: 4px; /* Slight offset to visually center the play triangle */
}

.video-trigger:hover .play-icon {
  transform: scale(1.1);
  background: var(--brand-500);
  border-color: var(--brand-500);
}

/* Modal Core */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 1100px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
  transform: scale(1);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: -40px;
  right: -0px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 1010;
  transition: color 0.2s;
  padding: 10px;
}

.close-modal:hover {
  color: var(--brand-500);
}

@media (max-width: 768px) {
  .modal {
    padding: 1rem;
  }
  
  .play-icon {
    width: 60px;
    height: 60px;
  }
  
  .play-icon i {
    width: 24px;
    height: 24px;
  }
  
  .close-modal {
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
}
