/* ========= VARIABLES Y BASE ========= */

:root {
  --bg: #020617;
  --bg-alt: #0b1530;
  --surface: #0f172a;
  --surface-soft: #141c31;
  --border-soft: rgba(148, 163, 184, 0.4);
  --text: #f9fafb;
  --muted: #9ca3af;
  --accent: #3b82f6;
  --accent-alt: #22d3ee;
  --accent-soft: rgba(37, 99, 235, 0.22);
  --radius: 18px;
  --shadow: 0 24px 55px rgba(15, 23, 42, 0.9);
  --maxw: 1120px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: radial-gradient(circle at top, #0b1120 0, #020617 55%);
  color: var(--text);
  line-height: 1.6;
}

/* ========= LAYOUT ========= */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========= CABECERA / NAV ========= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(2, 6, 23, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(248, 250, 252, 0.6);
  overflow: hidden;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  max-width: 100%;
  display: block;
}

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

.brand-title {
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-sub {
  font-size: 0.85rem;
  color: #e5e7eb;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 6px 0;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  transition: width 0.2s ease-out;
}

.main-nav a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

/* ========= BOTONES ========= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  background-image: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: #020617;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.9);
}

.btn-ghost {
  background-image: none;
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text);
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: var(--accent-alt);
}

.btn-small {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}

/* ========= LOGOS INSTITUCIONALES EN HERO ========= */

.hero-logos {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.hero-logos img {
  display: block;
  max-height: 42px;
  width: auto;
  opacity: 0.95;
}

.hero-logos a {
  display: inline-flex;
  align-items: center;
}

.hero-logos a:hover img {
  opacity: 1;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .hero-logos {
    gap: 10px;
  }

  .hero-logos img {
    max-height: 34px;
  }
}

/* ===== Logo MARES sobre fondo blanco ===== */

.hero-logos .logo-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.35);
}

.hero-logos .logo-card img {
  max-height: 34px; /* un poco más pequeño que el otro logo */
  width: auto;
}

.hero-logos img {
  max-height: 42px;
}

.hero-logos .logo-card img {
  max-height: 32px;
}

/* ========= DIRECCIÓN EN HERO ========= */

.hero-directors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 16px;
}

.director-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.director-photo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.65);
}

.director-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.director-text {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.2;
}

/* ========= HERO ========= */

.hero {
  padding: 60px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-alt);
  margin: 0 0 6px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 3vw, 2.3rem);
}

.hero-subtitle {
  margin: 0 0 18px;
  font-size: 0.98rem;
  color: var(--muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.badge strong {
  color: var(--text);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-media {
  position: relative;
}

.hero-image {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(248, 250, 252, 0.55);
  box-shadow: var(--shadow);
  object-fit: cover;
}

/* ========= BLOQUE INSTITUCIONAL HERO ========= */

.hero-institutions {
  margin-bottom: 10px;
}

.institutions-card {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 10px 18px;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
}

.institution-logo {
  display: block;
  max-height: 52px;
  width: auto;
}

.institution-logo-link {
  display: inline-flex;
  align-items: center;
}

.institution-logo-link:hover {
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .institutions-card {
    gap: 18px;
    padding: 8px 14px;
    border-radius: 16px;
  }

  .institution-logo {
    max-height: 40px;
  }
}

/* ========= BLOQUE INSTITUCIONAL EN ORGANIZACIÓN ========= */

.org-institutions {
  margin-top: 16px;
}

.org-institutions .institutions-card {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

@media (max-width: 600px) {
  .org-institutions {
    margin-top: 12px;
  }
}

/* ========= SECCIONES GENERALES ========= */

.section {
  padding: 52px 0;
}

.section-alt {
  background: radial-gradient(circle at top left, #0b1120 0, #020617 65%);
}

.section-header {
  max-width: 640px;
  margin-bottom: 22px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.section-intro {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.section-note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.subheading {
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 0.96rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

/* ========= LISTAS ========= */

.list-check,
.list-dot {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-check li,
.list-dot li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.list-check li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 0.7rem;
  color: var(--accent-alt);
}

.list-dot li::before {
  content: "•";
  position: absolute;
  left: 4px;
  top: 1px;
  font-size: 1.1rem;
  color: var(--accent-alt);
}

.pill-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-list li {
  font-size: 0.86rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid var(--border-soft);
}

/* ========= ACORDEÓN PROGRAMA ========= */

.accordion {
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.75);
  overflow: hidden;
}

.accordion-item + .accordion-item {
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

.accordion-header {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 14px 18px;
  color: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header span:first-child {
  font-weight: 600;
  font-size: 0.98rem;
}

.accordion-icon {
  font-size: 1.1rem;
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease-out, padding 0.18s ease-out;
  padding: 0 18px;
}

.accordion-panel.open {
  padding: 4px 18px 14px;
}

.accordion-panel h3 {
  font-size: 0.95rem;
  margin: 10px 0 4px;
}

/* ========= MATRÍCULA / PRECIO ========= */

.price-card {
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.7);
}

.price-text {
  margin: 0 0 8px;
  font-size: 0.94rem;
}

.small-list li {
  font-size: 0.86rem;
}

/* ========= TESTIMONIOS ========= */

.testimonials-top {
  padding-top: 30px;
  padding-bottom: 40px;
}

.testimonial-carousel {
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.t-nav {
  border: none;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  border: 1px solid var(--border-soft);
}

.t-nav:hover {
  border-color: var(--accent-alt);
}

.t-window {
  overflow: hidden;
  position: relative;
  min-height: 160px;
}

.testimonial-card {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.testimonial-card.active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}

.t-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.t-photo {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.7);
}

.t-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.t-quote {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--text);
}

.t-more {
  margin-top: 4px;
  align-self: flex-start;
  border: none;
  background: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--accent-alt);
  cursor: pointer;
  text-decoration: underline;
}

.testimonial-full {
  display: none; /* se usa solo para el modal */
}

.t-dots {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.t-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.4);
  cursor: pointer;
}

.t-dot.active {
  background: var(--accent-alt);
}

/* ===== MODAL TESTIMONIOS ===== */

.testimonial-modal[hidden] {
  display: none;
}

.testimonial-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.tm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
}

.tm-dialog {
  position: relative;
  max-width: 640px;
  margin: 40px auto;
  padding: 0 16px;
}

.tm-content {
  position: relative;
  background: #020617;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
}

.tm-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.tm-role,
.tm-location {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.tm-location {
  margin-bottom: 8px;
}

.tm-body p {
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--text);
}

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

  .t-nav {
    display: none;
  }

  .t-window {
    margin-top: 4px;
  }

  .testimonial-card {
    position: relative;
  }

  .tm-dialog {
    margin: 20px auto;
  }
}


/* ========= SATISFACCIÓN ========= */

.satisfaction {
  padding-top: 30px;
  padding-bottom: 40px;
}

.satisfaction-figure {
  margin: 18px auto 0;
  max-width: 900px;
  text-align: center;
}

.satisfaction-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
}

.satisfaction-figure figcaption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}


/* ========= PROFESORADO ========= */

/* ========= PROFESORADO CON BIO DESPLEGABLE ========= */

.prof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.prof-card {
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.prof-toggle {
  margin: 0;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.prof-toggle:hover {
  background: rgba(15, 23, 42, 0.9);
}

.prof-photo {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.7);
}

.prof-summary h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
}

.prof-role {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.prof-bio {
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease-out, padding 0.18s ease-out;
  font-size: 0.85rem;
  color: var(--muted);
}

.prof-card.open .prof-bio {
  padding: 0 12px 10px;
}

.prof-bio p {
  margin: 6px 0 0;
}

@media (max-width: 1024px) {
  .prof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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


/* ========= CONTACTO / ORGANIZACIÓN ========= */

.note {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ========= COSTE / MATRÍCULA ========= */

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.price-card {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.price-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.price-main {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.price-extra {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.price-note {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--accent-alt);
  font-weight: 600;
}

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

/* ========= FOOTER ========= */

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  background: #020617;
  padding: 16px 0 20px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer-small {
  opacity: 0.9;
}


/* ========= LOGOS ORGANIZACIÓN ========= */

.org-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.org-logo {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-soft);
}

.org-logo img {
  display: block;
  max-height: 60px;
  width: auto;
}

@media (max-width: 600px) {
  .org-logos {
    justify-content: flex-start;
  }

  .org-logo img {
    max-height: 48px;
  }
}



/* ========= RESPONSIVE ========= */

@media (max-width: 900px) {
  .hero-grid,
  .grid-2,
  .prof-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-media {
    order: -1;
  }

  .prof-card {
    padding: 10px 12px;
  }
}

@media (max-width: 768px) {
  .main-nav {
    position: absolute;
    right: 20px;
    top: 56px;
    background: #020617;
    border-radius: 16px;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 1);
    padding: 10px 14px;
    display: none;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

.main-nav .btn-small {
  padding: 0.42rem 1.1rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 999px;
  background-image: none;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text);
  box-shadow: none;
}

/* quitar la rayita inferior de los enlaces de menú en este botón */
.main-nav .btn-small::after {
  display: none;
}

/* hover: se rellena con el degradado bonito del resto de botones */
.main-nav .btn-small:hover {
  background-image: linear-gradient(135deg, var(--accent), var(--accent-alt));
  border-color: transparent;
  color: #020617;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.9);
  transform: translateY(-1px);
}
