/* ===== VARIABLES Y FUENTES ===== */
:root {
  --primary: #3c92dd;
  --primary-dark: #0593c2;
  --secondary: #13d06b;
  --accent: #e40606;
  --text: #333;
  --light-bg: #f8fbff;
  --white: #fff;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.15);
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--light-bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

.container {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

/* ===== ENCABEZADO COMPACTO ===== */
.top-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 1.6rem 0;
  box-shadow: var(--shadow);
}

.header-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

/* 🔹 Animación de entrada */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🔹 Título principal */
.top-header h1 {
  font-size: clamp(3.5rem, 10vw, 6rem); /* AUMENTADO */
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  animation: fadeUp 1s ease-out forwards;
}

.top-header h1:hover {
  text-shadow: 0 8px 18px rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}

/* 🔹 Subtítulo o párrafo */
.top-header p {
  font-size: clamp(1.4rem, 4.5vw, 2rem); /* AUMENTADO */
  margin-top: 0.8rem;
  opacity: 0.95;
  font-weight: 400;
  color: #f0f0f0;
  transition: all 0.3s ease;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  animation: fadeUp 1.4s ease-out forwards;
}

.top-header p:hover {
  opacity: 1;
  text-shadow: 0 5px 12px rgba(255, 255, 255, 0.6);
  transform: scale(1.04);
}


/* ===== NAVEGACIÓN ===== */
.main-nav {
  background-color: var(--primary-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-links {
  display: flex;
  list-style: none;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 1rem;
  margin: 0;
}

.nav-links a {
  color: white;
  padding: 0.8rem 1.2rem;
  text-decoration: none;
  font-weight: 600;
  border-radius: 50px;
  transition: var(--transition);
  text-align: center;
  min-width: 100px;
  max-width: 180px;
  flex: 1;
}

.nav-links a:hover,
.nav-links a:focus {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-links a.active {
  background-color: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(19, 208, 107, 0.4);
}

/* ===== MENÚ HAMBURGUESA ===== */
.menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  z-index: 1001;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-dark);
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 999;
    gap: 10px;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li, .nav-links a {
    width: 90%;
    max-width: none;
    text-align: center;
    padding: 0.9rem;
    flex: none;
  }

  /* Animación del botón hamburguesa → X */
  .menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}

/* ===== SECCIONES ===== */
main > section {
  padding: 4rem 0;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--primary-dark);
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 700;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--secondary);
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-items: center;
}

/* ===== TARJETAS DE CURSOS ===== */
.course-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  width: 100%;
  max-width: 350px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.course-card:hover::before {
  transform: scaleX(1);
}

.course-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.course-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain; /* ← clave: no recorta, mantiene proporción */
  border-radius: 12px;
  margin-bottom: 1.2rem;
  background: #f1f5f9;
  padding: 10px;
  transition: var(--transition);
}

.course-card:hover img {
  transform: scale(1.03);
}

.course-card h3 {
  font-size: 1.4rem;
  margin: 1rem 0;
  color: var(--primary-dark);
}

.course-card p {
  color: #555;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.cta-button {
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  color: white;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  display: inline-block;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(60, 146, 221, 0.3);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(60, 146, 221, 0.5);
}

/* ===== TESTIMONIOS ===== */
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  transition: var(--transition);
}

.testimonial-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.testimonial-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.2rem;
  border: 3px solid var(--primary);
}

.testimonial-card blockquote p {
  font-style: italic;
  color: #444;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.testimonial-card footer {
  font-weight: 600;
  color: var(--primary);
}

/* ===== CONTACTO ===== */
#contacto .container {
  max-width: 600px;
  text-align: center;
}

#contacto h3 {
  margin-top: 1.5rem;
  font-size: 1.5rem;
}

#contacto p {
  margin: 0.8rem auto 2rem;
  max-width: 500px;
}

.form-container {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}

.form-container label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.form-container textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  transition: var(--transition);
}

.form-container textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(60, 146, 221, 0.2);
}

.btn-send {
  background: linear-gradient(to right, #25d366, #128c7e);
  color: white;
  border: none;
  padding: 0.9rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-send:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
}

/* ===== PIE DE PÁGINA ===== */
footer {
  background: linear-gradient(to right, #333, #555);
  color: white;
  text-align: center;
  padding: 1.8rem 1rem;
  margin-top: 4rem;
}

footer .container {
  max-width: 800px;
}