:root {
  /* Color Palette - Medical/Health Professional */
  --primary-color: #0077b6;
  /* Ocean Blue */
  --primary-dark: #023e8a;
  --footer-bg: #0d253f;
  /* Dark Navy consistent with Logo Mark */
  --secondary-color: #48cae4;
  /* Light Cyan */
  --accent-color: #ff9f1c;
  /* Soft Orange for CTA */
  --text-dark: #2b2d42;
  --text-light: #5d5f76;
  --white: #ffffff;
  --light-bg: #f8f9fa;
  --success: #2a9d8f;

  /* Typography */
  --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Spacing */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;

  /* Shadows & Radius */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius-md: 8px;
  --radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text-dark);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Header */
header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--spacing-md) 0;
  overflow: visible;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: visible;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
  list-style: none;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1.2rem;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* Submenu Cursos */
.nav-links .has-submenu {
  position: relative;
}

.nav-links .submenu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.nav-links .submenu-toggle ion-icon {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.nav-links .has-submenu.open .submenu-toggle ion-icon {
  transform: rotate(180deg);
}

.nav-links .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 0, 0, 0.06);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  z-index: 2000;
  /* Ponte invisível para o mouse não “cair” no vão */
  padding-top: 0.5rem;
}

.nav-links .submenu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
}

.nav-links .has-submenu.open > .submenu {
  display: block;
}

.nav-links .submenu li {
  width: 100%;
  text-align: left;
}

.nav-links .submenu a {
  display: block;
  padding: 0.7rem 1.15rem;
  font-size: 1rem;
  white-space: nowrap;
}

.nav-links .submenu a:hover {
  background: #f0f7f8;
  color: var(--primary-color);
}

.cta-btn {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-md);
}

.cta-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  color: var(--white);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--white) 0%, #eefbfd 100%);
  padding: var(--spacing-xl) 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  color: var(--primary-dark);
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
}

/* Featured Courses Section */
.courses-section {
  padding: var(--spacing-xl) 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: var(--spacing-xl);
  color: var(--primary-dark);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.course-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.course-image {
  height: 200px;
  background-color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 3rem;
}

.course-content {
  padding: var(--spacing-lg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-tag {
  display: inline-block;
  background: #e0f2f1;
  color: var(--success);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  width: fit-content;
}

.course-title {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

.course-description {
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
  font-size: 1rem;
}

.course-details {
  margin-top: auto;
  border-top: 1px solid #eee;
  padding-top: var(--spacing-md);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: var(--spacing-md) 0;
}

.course-detailed-info {
  background-color: #f8f9fa;
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border-left: 4px solid var(--success);
}

.info-item {
  margin-bottom: var(--spacing-md);
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item h4 {
  color: #6a1b9a;
  /* Match urgency banner purple or use primary */
  font-size: 1rem;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item h4 ion-icon {
  font-size: 1.2rem;
  color: var(--success);
}

.info-item p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.5;
}

.enroll-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 0.8rem;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.enroll-btn:hover {
  background: var(--primary-color);
  color: white;
}

.urgency-banner {
  color: #6a1b9a;
  /* Deep Purple */
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  background-color: #f3e5f5;
  /* Light Purple Bg */
  padding: 0.8rem;
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  border: 1px solid #e1bee7;
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: white;
  padding: 4rem 0 2rem;
}

.sponsors-banner .container {
  gap: 2rem;
}

.sponsors-banner img {
  height: 60px;
  object-fit: contain;
}

.sponsor-fallback {
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  color: var(--text-light);
  font-weight: 600;
  background: #fafafa;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col ul li a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover {
  color: var(--secondary-color);
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  color: white;
  font-size: 1.5rem;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  border-top: 1px solid #444;
  margin-top: 3rem;
  padding-top: 2rem;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
}

/* Contact Section */
.contact-section {
  padding: 4rem 0;
  background-color: white;
  border-top: 1px solid #eee;
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .contact-container {
    grid-template-columns: 1fr;
  }
}

.contact-form {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid #eee;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-dark);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition: background 0.3s;
}

.submit-btn:hover {
  background-color: var(--primary-dark);
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: 400px;
  height: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Testimonials Carousel */
.testimonials-section {
  background-color: var(--light-bg);
  padding: var(--spacing-xl) 0;
  overflow: hidden;
}

.testimonial-slider {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.testimonial-track {
  display: flex;
  gap: var(--spacing-lg);
  width: max-content;
  animation: scroll 40s linear infinite;
  padding: var(--spacing-md) 0;
}

.testimonial-track:hover {
  animation-play-state: paused;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - var(--spacing-lg)));
  }
}

.testimonial-card {
  width: 350px;
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.testimonial-text {
  font-style: italic;
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
  flex-grow: 1;
  font-size: 0.95rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 15px;
}

.author-avatar {
  background-color: var(--secondary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.author-info h5 {
  color: var(--primary-dark);
  font-size: 1rem;
  margin-bottom: 2px;
}

.author-info span {
  font-size: 0.85rem;
  color: var(--text-light);
  display: block;
}

/* Floating WhatsApp Button */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: white;
  border-radius: 50px;
  text-align: center;
  font-size: 35px;
  box-shadow: 2px 2px 3px #999;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  background-color: #128c7e;
  box-shadow: 3px 3px 5px #777;
}

.whatsapp-float ion-icon {
  margin-top: 2px;
  /* Visual adjustment */
}

@media (max-width: 480px) {
  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 28px;
    bottom: 20px;
    right: 20px;
  }
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  color: #fff;
  font-size: 1.5rem;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--secondary-color);
}

/* Mobile Menu Styles */
.menu-toggle {
  display: none;
  font-size: 2rem;
  color: var(--primary-dark);
  cursor: pointer;
  z-index: 1100;
  position: relative;
  line-height: 1;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  header .container {
    position: relative;
  }

  nav {
    position: relative;
    width: 100%;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 0 0 12px 12px;
    z-index: 1090;
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  .nav-links.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links > li > a {
    display: block;
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
  }

  .nav-links .has-submenu {
    width: 100%;
  }

  .nav-links .submenu {
    position: static;
    transform: none;
    display: none;
    box-shadow: none;
    border: none;
    background: #f7fafb;
    min-width: 0;
    padding: 0.35rem 0 0.75rem;
    margin-top: 0;
    z-index: auto;
  }

  .nav-links .submenu::before {
    display: none;
  }

  .nav-links .has-submenu.open > .submenu {
    display: block;
  }

  .nav-links .submenu a {
    font-size: 1rem;
    padding: 0.55rem 1rem;
    text-align: center;
  }

  /* Responsive Registration Button */
  #btn-inscricao-forms {
    display: block;
    width: 100%;
    margin: 2rem auto !important;
    text-align: center;
    box-sizing: border-box;
  }
}

/* Visitor Counter Styles */
#visitor-counter-display {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.9rem;
  color: #ccc;
  /* Fallback color */
}

.visitor-counter-content {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.visitor-counter-content ion-icon {
  font-size: 1.1rem;
  vertical-align: text-bottom;
  margin-right: 4px;
}

.live-location .pulse-anim {
  color: var(--success);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
    text-shadow: 0 0 5px var(--success);
  }

  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

@media (max-width: 768px) {
  .separator {
    display: none;
  }

  .visitor-counter-content {
    flex-direction: column;
    gap: 5px;
  }
}

/* --- Newsletter Popup Styles --- */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.5s ease;
}

.popup-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 450px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  font-weight: bold;
  color: #333;
}

.popup-content h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}

.popup-content p {
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.popup-content input[type="email"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.popup-content button {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  text-transform: uppercase;
  transition: background 0.3s;
}

.popup-content button:hover {
  background-color: var(--primary-dark);
}

/* --- Cookie Banner Styles --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2d3436;
  color: #fff;
  z-index: 9999;
  padding: 1rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
}

.cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.cookie-content p {
  margin: 0;
  font-size: 0.9rem;
  flex: 1;
}

.cookie-content a {
  color: var(--secondary-color);
  text-decoration: underline;
}

.cookie-content button {
  background: var(--success);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 100px;
  /* Above WhatsApp button (30px + 60px + 10px) */
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 999;
  /* Below overlays (10000) but above content */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  color: white;
}

/* Mobile adjustment */
@media (max-width: 480px) {
  .back-to-top {
    right: 20px;
    bottom: 90px;
    width: 45px;
    height: 45px;
  }
}
