:root {
  --bg: #ffffff;
  --surface: rgba(60, 60, 60, 0.06);
  --surface-2: rgba(60, 60, 60, 0.09);
  --text: #3c3c3c;
  --muted: rgba(60, 60, 60, 0.72);
  --primary: #3c3c3c;
  --primary-2: #6a6a6a;
  --border: rgba(60, 60, 60, 0.18);
  --shadow: 0 18px 50px rgba(60, 60, 60, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1120px;
  --header-height: 205px;
  --header-redline-offset: calc(var(--header-height) - 3px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-redline-offset);
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: #ffffff;
  color: var(--text);
  line-height: 1.45;
}

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

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 10px 12px;
  background: #ffffff;
  color: #3c3c3c;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus {
  left: 10px;
}

/* Header */
.site-header {
  position: relative;
  top: auto;
  z-index: 9999;
  /* Header tipo barra blanca (referencia visual) */
  backdrop-filter: none;
  background: #ffffff;
  border-bottom: none;
  box-shadow: none;
  overflow: visible;
  /* Asegura que el fondo de ::before/::after no se “interponga” con el contenido */
  isolation: isolate;
  height: 205px;
  padding-top: 35px;
  margin: 0;
  width: 100%;
  transition: box-shadow 0.25s ease;
}

main#contenido {
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 0;
  scroll-behavior: smooth;
}

/* Anclas y saltos de navegación: dejar el contenido debajo de la línea roja */
main#contenido section {
  scroll-margin-top: var(--header-redline-offset);
}

/* Fondo de ancho completo (viewport) */
.site-header-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #ffffff;
  z-index: 0;
  pointer-events: none;
  transition: background-color 0.25s ease;
}

/* Franja superior (35px) */
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 35px;
  background: #515151;
  z-index: 1;
  pointer-events: none;
}

/* Franja inferior (50px) + línea roja (3px) */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px;
  background: linear-gradient(
    180deg,
    #efefef 0%,
    #efefef calc(100% - 3px),
    #c30010 calc(100% - 3px),
    #c30010 100%
  );
  z-index: 1;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  gap: 0;
  padding: 0;
  position: relative;
  z-index: 2;
  transition: transform 0.25s ease;
}

/* ES | EN — franja gris superior (.site-header::before); hijo directo de .site-header */
.site-header > nav.header-lang {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--max), calc(100% - 2rem));
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-height: 35px;
  padding: 0;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: auto;
  box-sizing: border-box;
}

.header-lang-sep {
  color: rgba(255, 255, 255, 0.45);
  user-select: none;
  font-weight: 600;
}

.header-lang-link {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.header-lang-link:hover,
.header-lang-link:focus-visible {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
  outline: none;
}

.header-lang-link[aria-current="page"] {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.65);
}

.site-header.is-scrolled {
  box-shadow: 0 12px 40px rgba(60, 60, 60, 0.14);
}

.site-header.is-scrolled .site-header-bg {
  background: #ffffff;
}

.site-header.is-scrolled .header-inner {
  transform: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  justify-content: flex-start;
  height: 120px;
  width: 100%;
  background: transparent;
  position: relative;
  z-index: 3;
}

.brand-logo {
  /* Mostrar el logo sin “envolvente” (sin padding/fondo) */
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  /* Límite de seguridad para que el header no se desborde */
  max-height: 98px;
}

.brand-text {
  /* Para igualar el header de Moodle de tu referencia */
  display: none;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  justify-content: flex-start;
  height: 50px;
  position: relative;
  overflow: visible;
}

/* Línea divisoria debajo del menú */
.nav::after {
  /* La linea divisoria roja ahora vive en .site-header::after (100% ancho) */
  display: none;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(60, 60, 60, 0.045);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  cursor: pointer;
}

.nav-toggle-lines {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(60, 60, 60, 0.9);
  position: relative;
  margin: 0 auto;
}
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: rgba(60, 60, 60, 0.9);
}
.nav-toggle-lines::before {
  top: -6px;
}
.nav-toggle-lines::after {
  top: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
}

.nav-link {
  text-decoration: none;
  color: rgba(60, 60, 60, 0.88);
  font-weight: 400;
  font-size: 0.93rem;
  padding: 0.35rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 12px;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background-color: rgba(60, 60, 60, 0.06);
}

.nav-link:hover .nav-icon,
.nav-link:focus-visible .nav-icon {
  color: inherit;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: inherit;
}

/* Buttons / Links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 720;
  letter-spacing: 0.2px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  border-color: rgba(60, 60, 60, 0.35);
}

.btn-secondary {
  background: rgba(60, 60, 60, 0.045);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(60, 60, 60, 0.08);
}

.btn-wide {
  min-width: 220px;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.link:hover,
.link:focus-visible {
  text-decoration: underline;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font-weight: 720;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(60, 60, 60, 0.35);
}

/* Hero */
.hero {
  padding: 3.2rem 0 2.4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.6rem;
  align-items: start;
}

.hero-copy {
  padding: 0.3rem 0;
}

.pill {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(60, 60, 60, 0.055);
  border: 1px solid var(--border);
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.hero-title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.3px;
}

.hero-text {
  margin: 0 0 1.3rem;
  color: var(--muted);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.meta-item {
  background: rgba(60, 60, 60, 0.045);
  border: 1px solid rgba(60, 60, 60, 0.1);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.meta-value {
  font-weight: 780;
  font-size: 0.95rem;
}

/* Card */
.hero-card {
  background: rgba(60, 60, 60, 0.05);
  border: 1px solid rgba(60, 60, 60, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-weight: 850;
  letter-spacing: 0.2px;
}

.card-badge {
  font-weight: 820;
  color: rgba(60, 60, 60, 0.9);
  background: rgba(60, 60, 60, 0.08);
  border: 1px solid rgba(60, 60, 60, 0.12);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 1rem;
  display: grid;
  gap: 0.6rem;
}

.card-list-item {
  color: var(--muted);
  display: flex;
  gap: 0.6rem;
}
.card-list-item::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  flex: 0 0 auto;
  margin-top: 0.25rem;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.section {
  padding: 2.4rem 0;
}

.section-head {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.section-cta {
  padding: 2.1rem 0 2.7rem;
}

.section-title {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.section-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

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

.feature {
  padding: 1.1rem;
  background: rgba(60, 60, 60, 0.045);
  border: 1px solid rgba(60, 60, 60, 0.1);
  border-radius: var(--radius-sm);
}

.feature-title {
  margin: 0 0 0.4rem;
  font-weight: 850;
}

.feature-text {
  margin: 0;
  color: var(--muted);
}

.cta-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(60, 60, 60, 0.12);
  background: linear-gradient(180deg, rgba(60, 60, 60, 0.06), rgba(60, 60, 60, 0.03));
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.2rem;
  align-items: start;
}

.contact-details {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 1rem;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(60, 60, 60, 0.1);
  background: rgba(60, 60, 60, 0.045);
}

.contact-label {
  color: var(--muted);
  font-weight: 650;
}

.contact-value {
  font-weight: 820;
}

.fineprint {
  color: var(--muted);
  margin: 0;
}
.small {
  font-size: 0.92rem;
}

.contact-card {
  position: relative;
  padding: 1.1rem;
  background: rgba(60, 60, 60, 0.045);
  border: 1px solid rgba(60, 60, 60, 0.1);
  border-radius: var(--radius);
}

.form-row {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

/* Campo trampa anti-spam (no visible para usuarios) */
.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 680;
}

input,
textarea {
  width: 100%;
  border-radius: 14px;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(60, 60, 60, 0.14);
  background: rgba(60, 60, 60, 0.045);
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
textarea:focus {
  border-color: rgba(60, 60, 60, 0.55);
  box-shadow: 0 0 0 3px rgba(60, 60, 60, 0.18);
}

.toast {
  margin-top: 0.8rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: rgba(60, 60, 60, 0.1);
  border: 1px solid rgba(60, 60, 60, 0.25);
  color: rgba(60, 60, 60, 0.9);
}

.toast.toast--success {
  background: rgba(34, 160, 80, 0.16);
  border: 1px solid rgba(22, 120, 62, 0.45);
  color: #0f4d28;
  font-weight: 680;
}

.toast.toast--error {
  background: rgba(179, 0, 0, 0.09);
  border: 1px solid rgba(179, 0, 0, 0.38);
  color: #6a0f0f;
  font-weight: 650;
}

@media (prefers-color-scheme: dark) {
  .toast.toast--success {
    background: rgba(46, 180, 100, 0.18);
    border-color: rgba(80, 220, 130, 0.35);
    color: #c8f0d8;
  }

  .toast.toast--error {
    background: rgba(255, 90, 90, 0.12);
    border-color: rgba(255, 120, 120, 0.35);
    color: #ffd4d4;
  }
}

/* Footer */
.site-footer {
  background: #424242;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem 0 2.4rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-brand {
  color: #ffffff;
  font-weight: 850;
}

.footer-link {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-weight: 720;
  margin-left: 1rem;
}
.footer-link:hover,
.footer-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.footer-right {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(60, 60, 60, 0.82);
  z-index: 80;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100% - 2rem));
  z-index: 90;
  border-radius: var(--radius);
  border: 1px solid rgba(60, 60, 60, 0.15);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(60, 60, 60, 0.12);
}

.modal-footer {
  border-top: 1px solid rgba(60, 60, 60, 0.08);
  border-bottom: none;
}

.modal-body {
  padding: 1rem 1.1rem 0.2rem;
  color: var(--muted);
}

.modal-title {
  font-weight: 900;
  color: var(--text);
}

.icon-button {
  border: 1px solid rgba(60, 60, 60, 0.14);
  background: rgba(60, 60, 60, 0.05);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-steps {
  padding-left: 1.1rem;
  margin: 0 0 0.9rem;
}

.modal-help {
  margin: 0 0 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid,
  .cta-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .cta-actions {
    justify-content: flex-start;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    height: auto;
    overflow: visible;
  }

  .site-header.is-scrolled .header-inner {
    transform: none;
  }

  .nav {
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .nav-links {
    display: none;
    height: auto;
    max-height: none;
  }

  .nav-links.is-open {
    display: flex;
    position: relative;
    z-index: 30;
    isolation: isolate;
    flex: 1 1 100%;
    width: 100%;
    height: auto;
    max-height: none;
    margin-top: 0.55rem;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 0.75rem;
    border-radius: 16px;
    background-color: #ffffff;
    background: #ffffff;
    opacity: 1;
    mix-blend-mode: normal;
    /* Límite visual muy suave + sin transparencias */
    border: 1px solid rgba(60, 60, 60, 0.07);
    box-shadow:
      0 0 0 1px rgba(60, 60, 60, 0.05),
      0 12px 40px rgba(0, 0, 0, 0.1);
    overflow: visible;
    min-width: 0;
    align-items: stretch;
  }

  /* Filas del menú con fondo sólido para que no se vea el contenido detrás */
  .nav-links.is-open .nav-link {
    background-color: #ffffff;
    border-radius: 12px;
    opacity: 1;
    mix-blend-mode: normal;
  }

  .nav-links.is-open .nav-link.active,
  .nav-links.is-open .nav-link[aria-current="page"] {
    background-color: #b30000;
  }
}

