:root {
  --ifc-red: #A9232B;
  --ifc-red-dark: #87171E;
  --ifc-red-light: #FDF2F2;
  --ifc-green: #5B8528;
  --ifc-green-dark: #45661D;
  --ifc-green-light: #F4F8EE;
  --ifc-blue: #0277BD;
  --whatsapp-green: #25D366;
  --slate-900: #0B1120;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;
  --white: #FFFFFF;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: #F8FAFC;
  color: var(--slate-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(at 0% 0%, rgba(91, 133, 40, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(169, 35, 43, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
}

/* CINTILLO SUPERIOR DE CONVOCATORIA */
.top-announcement {
  background: linear-gradient(90deg, #87171E 0%, #A9232B 50%, #5B8528 100%);
  color: var(--white);
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.announcement-dot {
  width: 8px;
  height: 8px;
  background-color: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  flex-shrink: 0;
}

/* HEADER */
header {
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-width: 0;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ifc-red);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.brand-tag {
  background-color: var(--ifc-green);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-nav {
  background-color: var(--ifc-red);
  color: var(--white);
  text-decoration: none;
  padding: 0.5rem 0.95rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.btn-nav:hover { background-color: var(--ifc-red-dark); }

/* HERO PRINCIPAL */
.hero {
  padding: 3.5rem 1.25rem 2.5rem;
  text-align: center;
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(248,250,252,0) 100%);
}

.hero-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-title {
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  text-align: center;
}

.hero-desc {
  font-size: clamp(0.95rem, 2.5vw, 1.12rem);
  color: var(--slate-600);
  max-width: 720px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
  text-align: center;
}

.hero-slogan {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ifc-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

/* BARRA DE NORMAS (TRUST BAR) */
.trust-bar {
  max-width: 1240px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
  width: 100%;
}

.trust-container {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  text-align: center;
}

.trust-pill {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--slate-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.trust-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  background-color: var(--ifc-green);
  border-radius: 50%;
}

/* CONTENEDOR PRINCIPAL */
.main-wrapper {
  max-width: 1240px;
  margin: 0 auto 3.5rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
}

.catalog-header {
  margin-bottom: 1.25rem;
}

.catalog-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.catalog-header p {
  font-size: 0.88rem;
  color: var(--slate-500);
  margin-top: 0.15rem;
}

/* TARJETA DESTACADA */
.card-featured {
  background: var(--white);
  border: 2px solid var(--ifc-green);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 25px rgba(91, 133, 40, 0.06);
  position: relative;
}

.badge-featured {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--ifc-green);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
}

.tag-standard {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ifc-red);
  margin-bottom: 0.35rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--slate-600);
  margin-bottom: 1rem;
  line-height: 1.55;
}

.meta-grid {
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.meta-item span {
  display: block;
  font-size: 0.68rem;
  color: var(--slate-500);
  text-transform: uppercase;
  font-weight: 700;
}

.meta-item strong {
  color: var(--slate-800);
  font-weight: 700;
}

details.temario-dropdown {
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

details.temario-dropdown summary {
  font-weight: 700;
  color: var(--slate-800);
  cursor: pointer;
}

details.temario-dropdown[open] summary {
  margin-bottom: 0.5rem;
  color: var(--ifc-green-dark);
}

.temario-list {
  list-style-position: inside;
  color: var(--slate-600);
  line-height: 1.55;
}

.temario-list li {
  margin-bottom: 0.3rem;
}

.card-footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* OTRAS TARJETAS SECUNDARIAS */
.card-secondary {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-secondary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}

.badge-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-status.free {
  background-color: var(--ifc-green-light);
  color: var(--ifc-green-dark);
}

.badge-status.incompany {
  background-color: var(--slate-100);
  color: var(--slate-700);
}

.card-secondary h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.35rem;
}

.card-secondary p {
  font-size: 0.85rem;
  color: var(--slate-600);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.card-secondary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-100);
  padding-top: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-select-course {
  background: none;
  border: 1px solid var(--slate-300);
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-select-course:hover {
  background-color: var(--ifc-red);
  color: var(--white);
  border-color: var(--ifc-red);
}

/* FORMULARIO */
.form-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 4.5rem;
  width: 100%;
}

.form-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.form-header p {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-top: 0.2rem;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  background-color: var(--white);
  color: var(--slate-800);
  font-size: 0.88rem;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--ifc-red);
  box-shadow: 0 0 0 3px rgba(169, 35, 43, 0.1);
}

.hp-field {
  display: none !important;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--slate-600);
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
}

.checkbox-group input {
  margin-top: 0.15rem;
  accent-color: var(--ifc-red);
}

.btn-submit {
  width: 100%;
  background-color: var(--ifc-red);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.btn-submit:hover { background-color: var(--ifc-red-dark); }

.direct-contact-note {
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.8rem;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--slate-600);
  text-align: center;
}

.direct-contact-note strong { color: var(--slate-800); }

.alert-success {
  display: none;
  background-color: var(--ifc-green-light);
  border: 1px solid var(--ifc-green);
  color: var(--ifc-green-dark);
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.25rem;
}

/* SECCIÓN BOLETÍN / NEWSLETTER */
.section-newsletter {
  max-width: 1240px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  width: 100%;
}

.newsletter-card {
  background: linear-gradient(135deg, var(--slate-900) 0%, #172554 100%);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  color: var(--white);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  border-left: 5px solid var(--ifc-green);
}

.newsletter-info h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.newsletter-info p {
  font-size: 0.88rem;
  color: #CBD5E1;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  gap: 0.6rem;
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 0.88rem;
  font-family: inherit;
}

.newsletter-input::placeholder { color: #94A3B8; }

.newsletter-input:focus {
  outline: none;
  background: rgba(255,255,255,0.2);
  border-color: var(--ifc-green);
}

.newsletter-btn {
  background-color: var(--ifc-green);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.newsletter-btn:hover { background-color: var(--ifc-green-dark); }

/* INSTRUCTOR */
.section-instructor {
  max-width: 1240px;
  margin: 0 auto 3.5rem;
  padding: 0 1rem;
  width: 100%;
}

.instructor-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.75rem;
  align-items: center;
}

.instructor-avatar {
  width: 130px;
  height: 130px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-900) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  border: 2px solid var(--slate-200);
  margin: 0 auto;
}

.instructor-avatar-initials {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ifc-green);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.instructor-avatar-role {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  font-weight: 700;
}

.instructor-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 0.2rem;
}

.instructor-info .instructor-lead {
  color: var(--ifc-red);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.instructor-info p {
  color: var(--slate-600);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.instructor-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge-chip {
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--slate-200);
}

/* FOOTER */
footer {
  background-color: #070D18;
  color: #F1F5F9;
  padding: 3.5rem 1.25rem 2.5rem;
  width: 100%;
  border-top: 3px solid var(--ifc-red);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #1E293B;
}

.footer-brand h4 {
  color: #FFFFFF;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.footer-brand p {
  font-size: 0.88rem;
  color: #CBD5E1;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.footer-brand .slogan {
  font-weight: 700;
  color: #38BDF8;
  font-size: 0.85rem;
}

.footer-column h5 {
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--ifc-green);
  padding-bottom: 0.35rem;
  display: inline-block;
}

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

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

.footer-links a {
  color: #E2E8F0;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease;
  cursor: pointer;
}

.footer-links a:hover {
  color: #F87171;
}

.contact-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.85rem;
}

.contact-item span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94A3B8;
  letter-spacing: 0.05em;
}

.contact-item a, .contact-item strong {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.contact-item a:hover {
  color: #F87171;
}

.footer-bottom {
  max-width: 1200px;
  margin: 1.75rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: #94A3B8;
  text-align: center;
}

/* BOTÓN FLOTANTE WHATSAPP */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--whatsapp-green);
  color: var(--white);
  border-radius: 50px;
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 999;
}

.whatsapp-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* MEDIA QUERIES RESPONSIVAS */
@media (max-width: 992px) {
  .main-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .form-card { position: static; }
  .instructor-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .instructor-badges { justify-content: center; }
  .newsletter-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .top-announcement { font-size: 0.74rem; padding: 0.55rem 0.75rem; text-align: center; }
  .brand-subtitle { display: none; }
  .meta-grid { grid-template-columns: 1fr; }
  .form-group-row { grid-template-columns: 1fr; }
  
  .trust-container {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }
  .trust-pill {
    width: 100%;
    justify-content: center;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .footer-column h5 {
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-bottom: 2px solid var(--ifc-green);
    width: fit-content;
  }
  .contact-item {
    align-items: center;
  }
  .footer-bottom {
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .whatsapp-float span { display: none; }
  .whatsapp-float {
    padding: 0.75rem;
    border-radius: 50%;
    bottom: 16px;
    right: 16px;
  }
}

/* Regla estricta para impresión limpia de comprobante */
@media print {
  body * {
    visibility: hidden;
  }
  #registro-exito, #registro-exito * {
    visibility: visible;
  }
  #registro-exito {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    border: none !important;
    background: transparent !important;
  }
  header, footer, nav, .hero, .cursos-grid, #catalogo, details, button, a {
    display: none !important;
  }
}

/* ========================================================
   MODO OSCURO EQUILIBRADO (SLATE / NAVY SOFT)
   ======================================================== */
body.dark-mode {
  background-color: #0b1320;
  color: #cbd5e1;
  background-image:
    radial-gradient(at 0% 0%, rgba(91, 133, 40, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(169, 35, 43, 0.10) 0px, transparent 50%);
}

body.dark-mode header {
  background-color: rgba(15, 23, 42, 0.95);
  border-bottom-color: #1e293b;
}

body.dark-mode .hero {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(11, 19, 32, 0) 100%);
}

body.dark-mode .hero-title,
body.dark-mode .catalog-header h2,
body.dark-mode .form-header h3,
body.dark-mode .card-title,
body.dark-mode .card-secondary h3,
body.dark-mode .instructor-info h3,
body.dark-mode details summary {
  color: #f1f5f9 !important;
}

body.dark-mode .hero-desc,
body.dark-mode .card-desc,
body.dark-mode .card-secondary p,
body.dark-mode .instructor-info p,
body.dark-mode .catalog-header p,
body.dark-mode .form-header p {
  color: #94a3b8 !important;
}

body.dark-mode .trust-container,
body.dark-mode .card-featured,
body.dark-mode .card-secondary,
body.dark-mode .form-card,
body.dark-mode .instructor-card,
body.dark-mode .gallery-card,
body.dark-mode details {
  background-color: #131d2e !important;
  border-color: #243247 !important;
  color: #e2e8f0;
}

body.dark-mode .trust-pill {
  color: #cbd5e1;
}

body.dark-mode .meta-grid,
body.dark-mode details.temario-dropdown,
body.dark-mode .direct-contact-note {
  background-color: #0d1522 !important;
  border-color: #223044 !important;
}

body.dark-mode .meta-item strong {
  color: #f1f5f9;
}

body.dark-mode .form-control {
  background-color: #0d1522;
  border-color: #2b3b52;
  color: #f1f5f9;
}

body.dark-mode .form-control:focus {
  border-color: var(--ifc-red);
}

body.dark-mode .form-label {
  color: #94a3b8;
}

body.dark-mode .btn-select-course {
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .btn-theme-toggle {
  background: #1e293b;
  border-color: #334155;
  color: #fbbf24;
}

/* BOTÓN SWITCH DE TEMA */
.btn-theme-toggle {
  background: var(--slate-100);
  border: 1px solid var(--slate-300);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1rem;
  line-height: 1;
}

/* SECCIÓN GALERÍA / EXPERIENCIA EN CAMPO */
.section-gallery {
  max-width: 1240px;
  margin: 0 auto 3.5rem;
  padding: 0 1rem;
  width: 100%;
}

.gallery-header {
  text-align: center;
  margin-bottom: 2rem;
}

.gallery-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ifc-green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gallery-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.gallery-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.gallery-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery-info {
  padding: 1rem 1.15rem;
}

.gallery-info h4 {
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.gallery-info p {
  font-size: 0.82rem;
  color: var(--slate-500);
  line-height: 1.45;
}

/* SWITCH DE MODO OSCURO (TOGGLE PILL) */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #E2E8F0;
  border: 1px solid #CBD5E1;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.slider .icon-sun, .slider .icon-moon {
  font-size: 12px;
  line-height: 1;
  user-select: none;
}

.slider .icon-sun { opacity: 1; transition: opacity 0.2s; }
.slider .icon-moon { opacity: 0.35; transition: opacity 0.2s; }

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  z-index: 2;
}

input:checked + .slider {
  background-color: #1E293B;
  border-color: #334155;
}

input:checked + .slider .icon-sun { opacity: 0.35; }
input:checked + .slider .icon-moon { opacity: 1; }

input:checked + .slider:before {
  transform: translateX(24px);
  background-color: #F8FAFC;
}

/* FONDO HERO EMPRESARIAL CON OVERLAY PROFESIONAL */
.hero {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 58, 95, 0.88) 100%),
              url('../img/invernadero2.jpg') center/cover no-repeat !important;
  color: #ffffff;
  padding: 4.5rem 1.5rem 4rem 1.5rem;
  border-bottom: 3px solid #A9232B;
}

.hero-title {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.hero-desc {
  color: #e2e8f0 !important;
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
  font-size: 1.15rem;
  line-height: 1.6;
}

/* GALERÍA CORPORATIVA MULTICOLUMNA */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.gallery-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery-info {
  padding: 1.2rem;
}

.gallery-info h4 {
  margin: 0 0 0.4rem 0;
  font-size: 1.05rem;
  color: var(--text-primary, #0f172a);
}

.gallery-info p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
}

/* Catálogo a ancho completo al desacoplar el formulario */
.main-grid {
  display: block !important;
  max-width: 1200px;
  margin: 0 auto;
}
.courses-column {
  width: 100% !important;
  max-width: 100% !important;
}

/* ==========================================================
   ESTILOS MEJORADOS Y EFECTOS DE ILUMINACIÓN EN TARJETAS
   ========================================================== */

/* Tarjeta Destacada */
.card-featured {
  position: relative;
  background: var(--card-bg, #FFFFFF);
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.card-featured:hover {
  border-color: #CBD5E1;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
  transform: translateY(-3px);
}

/* Tarjetas Secundarias */
.card-secondary {
  position: relative;
  background: var(--card-bg, #FFFFFF);
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.card-secondary:hover {
  border-color: #94A3B8;
  box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

/* EFECTO DE ILUMINACIÓN ACTIVA AL SELECCIONAR */
.card-featured.is-active,
.card-secondary.is-active,
.card-selected {
  border-color: #A9232B !important;
  box-shadow: 0 0 0 3px rgba(169, 35, 43, 0.25), 0 16px 32px -4px rgba(169, 35, 43, 0.15) !important;
  transform: translateY(-4px) scale(1.005);
}

/* Botón de acción con estilo institucional llamativo */
.btn-select-course {
  background: linear-gradient(135deg, #A9232B 0%, #881C22 100%);
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(169, 35, 43, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-select-course:hover {
  background: linear-gradient(135deg, #BE2A33 0%, #9E1F27 100%);
  box-shadow: 0 4px 14px rgba(169, 35, 43, 0.35);
  transform: scale(1.02);
}

.btn-select-course:active {
  transform: scale(0.98);
}

/* ==========================================================================
   ESTILOS VISUALES PARA PORTADAS WEBP Y TARJETAS DE CURSOS
   ========================================================================== */
.card-featured.visual-enhanced {
  background: var(--card-bg, #ffffff);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color, #E2E8F0);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  margin-bottom: 2rem;
}

.card-featured.visual-enhanced:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -10px rgba(169, 35, 43, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
  border-color: #A9232B;
}

.card-cover-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 380px;
  overflow: hidden;
  position: relative;
  background-color: #0F172A;
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.card-featured:hover .card-cover-img {
  transform: scale(1.03);
}

.card-secondary.visual-enhanced {
  display: flex;
  flex-direction: row;
  background: var(--card-bg, #ffffff);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color, #E2E8F0);
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-secondary.visual-enhanced:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1);
  border-color: #CBD5E1;
}

.card-secondary-cover {
  width: 260px;
  min-width: 260px;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background-color: #0F172A;
}

.card-secondary-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card-secondary:hover .card-secondary-cover img {
  transform: scale(1.04);
}

.default-banner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-tag-overlay {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.cover-tag-mini {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .card-secondary.visual-enhanced {
    flex-direction: column;
  }
  .card-secondary-cover {
    width: 100%;
    min-width: 100%;
    max-height: 200px;
  }
}

/* ==========================================================================
   AJUSTE DE ENCUADRE Y PROPORCIÓN PARA BANNER 16:9 (SIN BORDES MOCHOS)
   ========================================================================== */
.card-featured {
  padding: 0 !important;
  overflow: hidden !important;
  position: relative !important;
  border-radius: 16px !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #E2E8F0) !important;
}

.card-featured .badge-featured {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  background: #DCFCE7 !important;
  color: #166534 !important;
  border: 1px solid #86EFAC !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.card-cover-wrapper {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  max-height: 380px !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #0F172A !important;
  border-top-left-radius: 15px !important;
  border-top-right-radius: 15px !important;
  border-bottom: 1px solid #E2E8F0 !important;
}

.card-cover-wrapper img,
.card-cover-img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center 25% !important;
  border-radius: 0 !important;
}

.card-featured-content {
  padding: 1.5rem 1.75rem !important;
}

/* Tarjetas secundarias: asegurar que la miniatura lateral ocupe toda la altura */
.card-secondary.visual-enhanced {
  padding: 0 !important;
  overflow: hidden !important;
}

.card-secondary-cover {
  margin: 0 !important;
  padding: 0 !important;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden !important;
}

.card-secondary-cover img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* REDES SOCIALES OFICIALES IFC */
.footer-social-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.footer-social-btn:hover {
  background: #FFFFFF;
  color: #A9232B;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  border-color: #CBD5E1;
}
.footer-social-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ========================================================
   MODO OSCURO - CORRECCIÓN INTEGRAL DE CONTRASTE Y LECTURA
   ======================================================== */
body.dark-mode {
  background-color: #0b1320 !important;
  color: #e2e8f0 !important;
}

/* Cintillo superior dinámico */
body.dark-mode .top-announcement {
  background: #1e1b4b !important;
  border-bottom: 1px solid #3730a3 !important;
  color: #e0e7ff !important;
}
body.dark-mode #top-announcement-text,
body.dark-mode .top-announcement a {
  color: #f8fafc !important;
}

/* Títulos principales y de sección (incluso con estilos inline) */
body.dark-mode main h2,
body.dark-mode .section-faq h2,
body.dark-mode .section-instructor h3,
body.dark-mode .gallery-info h4,
body.dark-mode .card-title,
body.dark-mode .catalog-header h2 {
  color: #f8fafc !important;
}

/* Subtítulos y textos descriptivos */
body.dark-mode main > div > p,
body.dark-mode .gallery-info p,
body.dark-mode .section-instructor p:not([style*="color: #b91c1c"]):not([style*="color:#b91c1c"]) {
  color: #cbd5e1 !important;
}

/* Subtítulo del instructor (rojo suave de alto contraste) */
body.dark-mode .section-instructor p[style*="#b91c1c"],
body.dark-mode .instructor-info .instructor-lead {
  color: #f87171 !important;
}

/* Tarjeta del instructor y galerías */
body.dark-mode .instructor-card,
body.dark-mode .gallery-card {
  background: #131d2e !important;
  border-color: #243247 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}

/* Chips / Badges del instructor */
body.dark-mode .section-instructor span,
body.dark-mode .section-instructor div[style*="background"] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* Sección de Preguntas Frecuentes (FAQ / details) */
body.dark-mode details {
  background: #131d2e !important;
  border: 1px solid #243247 !important;
}
body.dark-mode details summary {
  color: #f8fafc !important;
}
body.dark-mode details p,
body.dark-mode details div {
  color: #cbd5e1 !important;
}

/* Etiquetas previas rojas de categoría / subtítulos de sección */
body.dark-mode div[style*="color: #A9232B"],
body.dark-mode div[style*="color:#A9232B"] {
  color: #f87171 !important;
}

/* Corrección de contraste en sección Galería / Respaldo Técnico */
body.dark-mode .gallery-title,
body.dark-mode .gallery-header h3,
body.dark-mode .section-gallery h3 {
  color: #f8fafc !important;
}

body.dark-mode .gallery-header p {
  color: #cbd5e1 !important;
}

body.dark-mode .gallery-tag {
  background: #0c4a6e !important;
  color: #38bdf8 !important;
}
