/* ==========================================================================
   MPconecta — styles.css
   Sistema de diseño del sitio. Tema oscuro premium. CSS puro, mobile-first.
   Breakpoints: 640px / 900px / 1120px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg-base: #0A0A0A;
  --bg-elevated: #141414;
  --bg-subtle: #1C1C1C;
  --text-primary: #F5F5F5;
  --text-secondary: #A3A3A3;
  --text-muted: #6B6B6B;
  --accent: #D97706;
  --accent-hover: #EA8613;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --container-width: 1120px;

  /* Derivados internos */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-height: 72px;
}

/* --------------------------------------------------------------------------
   2. Reset y base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1rem;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul[class],
ol[class] {
  list-style: none;
}

/* Scrollbar personalizado (ámbar) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 8px;
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
html {
  scrollbar-color: #2a2a2a var(--bg-base);
  scrollbar-width: thin;
}

/* Selección de texto */
::selection {
  background: var(--accent);
  color: #0A0A0A;
}

/* Focus visible accesible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   3. Tipografía fluida
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 5.5vw + 0.5rem, 4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw + 0.5rem, 2.6rem); }
h3 { font-size: clamp(1.2rem, 1.5vw + 0.5rem, 1.5rem); }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

.lead {
  font-size: clamp(1.05rem, 1vw + 0.75rem, 1.3rem);
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 42em;
}

.overline {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.text-accent { color: var(--accent); }

/* --------------------------------------------------------------------------
   4. Layout: container, section, grids
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.section {
  padding-block: clamp(4rem, 10vw, 7.5rem);
  position: relative;
}

.section-header {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section-header.is-centered {
  margin-inline: auto;
  text-align: center;
}

.grid-2,
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------------------------------------------------------
   5. Header fijo
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease,
              backdrop-filter 0.4s ease;
}

.site-header.is-scrolled {
  background: rgba(10, 10, 10, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

/* Logo wordmark */
.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  z-index: 102;
  white-space: nowrap;
}
.site-logo .logo-dot { color: var(--text-muted); font-weight: 400; }
.site-logo .logo-conecta { color: var(--accent); }

/* Navegación */
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  position: relative;
}

.site-nav a:hover { color: var(--text-primary); }

.site-nav a[aria-current="page"] { color: var(--text-primary); }

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.site-nav .nav-cta { margin-left: 0.5rem; }
.site-nav .nav-cta .btn { padding: 0.6rem 1.3rem; font-size: 0.9rem; }

/* Botón hamburguesa */
.nav-toggle {
  display: none;
  z-index: 102;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Menú móvil a pantalla completa */
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 101;
    background: rgba(10, 10, 10, 0.97);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease-out), visibility 0.4s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .site-nav a {
    font-size: 1.6rem;
    font-weight: 600;
  }

  .site-nav a[aria-current="page"]::after { bottom: -8px; }

  .site-nav .nav-cta { margin-left: 0; margin-top: 0.5rem; }
  .site-nav .nav-cta .btn { padding: 0.9rem 2rem; font-size: 1.05rem; }

  body.nav-open { overflow: hidden; }
}

/* --------------------------------------------------------------------------
   6. Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0A0A0A;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s ease, border-color 0.3s ease,
              transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.25);
}

.btn:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.3s ease, background-color 0.3s ease,
              transform 0.3s var(--ease-out);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform 0.4s var(--ease-out), border-color 0.4s ease,
              background-color 0.4s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(217, 119, 6, 0.45);
}

.card h3 { margin-bottom: 0.6rem; }
.card p { font-size: 0.98rem; }

/* Card de servicio con icono */
.service-card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.4rem;
  transition: transform 0.4s var(--ease-out);
}
.service-card:hover .card-icon { transform: scale(1.08); }
.service-card .card-icon svg { width: 26px; height: 26px; }

.service-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.3s var(--ease-out);
}
.service-card .card-link:hover { gap: 0.7rem; }

/* Card de blog con imagen */
.blog-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.blog-card .blog-card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-subtle);
}

.blog-card .blog-card-media img,
.blog-card .blog-card-media .img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.blog-card:hover .blog-card-media img { transform: scale(1.04); }

.blog-card .blog-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.blog-card .blog-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.blog-card .blog-tag {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.blog-card h3 { font-size: 1.15rem; line-height: 1.35; }

/* Card de testimonio */
.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.testimonial-card blockquote {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.testimonial-card blockquote::before {
  content: "\201C";
  display: block;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  font-family: Georgia, serif;
  margin-bottom: 0.25rem;
}

.testimonial-card .testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: auto;
}

.testimonial-card .author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.testimonial-card .author-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.testimonial-card .author-role {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Hero de home
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 4rem;
  overflow: hidden;
  isolation: isolate;
}

/* Hueco para vídeo de fondo:
   <video class="hero-video" autoplay muted loop playsinline poster="...">
   colócalo como primer hijo de .hero. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  z-index: -2;
}

/* Orbes de gradiente ámbar animados muy lentos */
.hero-orbs {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -12%;
  right: -8%;
  background: radial-gradient(circle at 30% 30%, rgba(217, 119, 6, 0.28), transparent 70%);
  animation: orb-float-1 26s ease-in-out infinite alternate;
}

.orb-2 {
  width: 420px;
  height: 420px;
  bottom: -15%;
  left: -10%;
  background: radial-gradient(circle at 60% 60%, rgba(234, 134, 19, 0.18), transparent 70%);
  animation: orb-float-2 32s ease-in-out infinite alternate;
}

.orb-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle at 50% 50%, rgba(217, 119, 6, 0.12), transparent 70%);
  animation: orb-float-3 38s ease-in-out infinite alternate;
}

@keyframes orb-float-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-60px, 50px, 0) scale(1.12); }
}
@keyframes orb-float-2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(70px, -40px, 0) scale(1.08); }
}
@keyframes orb-float-3 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-40px, -55px, 0) scale(1.15); }
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
  width: 100%;
}

.hero-content .overline { margin-bottom: 1.25rem; }
.hero-content h1 { margin-bottom: 1.5rem; }
.hero-content .lead { margin-bottom: 2.25rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-media {
  position: relative;
  max-width: 420px;
  justify-self: center;
  width: 100%;
}

.hero-media img,
.hero-media .img-placeholder {
  border-radius: var(--radius-lg);
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: -1.25rem -1.25rem auto auto;
  width: 60%;
  height: 60%;
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: var(--radius-lg);
  z-index: -1;
}

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; }
  .hero-media { justify-self: end; }
}

/* Hero interior compacto */
.page-hero {
  position: relative;
  padding-top: calc(var(--header-height) + clamp(3.5rem, 8vw, 6rem));
  padding-bottom: clamp(3rem, 7vw, 5rem);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--border-subtle);
}

.page-hero h1 {
  font-size: clamp(2rem, 4.2vw + 0.5rem, 3.2rem);
  margin-bottom: 1.25rem;
  max-width: 18em;
}

.page-hero .lead { max-width: 38em; }

.page-hero .hero-orbs .orb { opacity: 0.35; }

/* --------------------------------------------------------------------------
   9. Stats
   -------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat .stat-num {
  display: block;
  font-size: clamp(2.4rem, 5vw + 0.5rem, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat .stat-suffix { color: var(--accent); }

.stat .stat-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. Timeline / Proceso (.steps)
   -------------------------------------------------------------------------- */
.steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 3rem);
  counter-reset: step;
  max-width: 760px;
}

.steps::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom,
    rgba(217, 119, 6, 0.5),
    var(--border-subtle) 65%,
    transparent);
}

.step {
  position: relative;
  padding-left: 4.5rem;
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-elevated);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}

.step h3 { margin-bottom: 0.5rem; }
.step p { max-width: 36em; }

/* --------------------------------------------------------------------------
   11. FAQ
   -------------------------------------------------------------------------- */
.faq-list {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color 0.3s ease;
  overflow: hidden;
}

.faq-item[open] { border-color: rgba(217, 119, 6, 0.4); }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.15rem 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color 0.3s ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  transition: transform 0.35s var(--ease-out);
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item .faq-body {
  padding: 0 1.4rem 1.3rem;
  color: var(--text-secondary);
  font-size: 0.97rem;
}

/* --------------------------------------------------------------------------
   12. Carrusel arrastrable
   -------------------------------------------------------------------------- */
.drag-carousel {
  position: relative;
  overflow: hidden;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  /* permitir scroll vertical táctil, capturamos solo el horizontal */
  touch-action: pan-y;
}

.drag-carousel.is-dragging { cursor: grabbing; }

.drag-track {
  display: flex;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  will-change: transform;
  width: max-content;
  padding-block: 0.5rem;
}

.drag-item {
  flex: 0 0 auto;
  width: min(78vw, 340px);
}

.drag-carousel.is-dragging .drag-item { pointer-events: none; }

.drag-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: hint-sway 2.6s ease-in-out infinite;
}

@keyframes hint-sway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

/* --------------------------------------------------------------------------
   13. Marquee infinito
   -------------------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  position: relative;
  padding-block: 1.25rem;
  border-block: 1px solid var(--border-subtle);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}

/* El contenido de .marquee-track debe duplicarse en el HTML
   (dos bloques idénticos) para el bucle perfecto. */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.marquee-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   14. Formularios y formulario multi-paso
   -------------------------------------------------------------------------- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-field .field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

input::placeholder,
textarea::placeholder { color: var(--text-muted); }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-elevated);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A3A3A3' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
}

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

/* Estado de error simple */
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: #b91c1c;
}

/* Barra de progreso */
.form-progress {
  margin-bottom: 2rem;
}

.form-progress .progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.form-progress .progress-bar {
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.form-progress .progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 4px;
  transition: width 0.6s var(--ease-out);
}

/* Pasos */
fieldset.form-step {
  border: none;
  display: none;
}

fieldset.form-step.is-active {
  display: block;
  animation: step-in 0.5s var(--ease-out);
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

fieldset.form-step legend {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding: 0;
}

/* Sin JS: todos los pasos visibles para que el formulario siga siendo usable */
html:not(.is-animated) fieldset.form-step { display: block; }
html:not(.is-animated) .form-nav [data-step-next],
html:not(.is-animated) .form-nav [data-step-prev] { display: none; }

/* Píldoras de radio */
.choice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.choice-pills label {
  position: relative;
  cursor: pointer;
}

.choice-pills input[type="radio"],
.choice-pills input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.choice-pills .pill {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  transition: border-color 0.3s ease, color 0.3s ease,
              background-color 0.3s ease, transform 0.3s var(--ease-out);
}

.choice-pills label:hover .pill {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.choice-pills input:checked + .pill {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.choice-pills input:focus-visible + .pill {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Navegación del formulario */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.form-nav .btn-ghost[hidden],
.form-nav .btn[hidden] { display: none; }

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding-top: clamp(3.5rem, 8vw, 5.5rem);
  margin-top: clamp(4rem, 10vw, 7rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.4fr 0.8fr 0.8fr 1.2fr; }
}

.footer-brand .site-logo { display: inline-block; margin-bottom: 1rem; }

.footer-claim {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 30em;
  margin-bottom: 1.5rem;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s var(--ease-out);
}

.footer-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-social svg { width: 18px; height: 18px; }

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-col a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.footer-col a:hover { color: var(--accent); }

/* Newsletter del footer */
.footer-newsletter p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font-size: 0.92rem;
}

.newsletter-form .btn {
  padding: 0.7rem 1.2rem;
  font-size: 0.92rem;
  flex-shrink: 0;
}

/* Barra inferior */
.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-block: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; text-align: left; }
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.footer-legal a {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.footer-legal a:hover { color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   16. Placeholder de imagen
   -------------------------------------------------------------------------- */
.img-placeholder {
  width: 100%;
  min-height: 200px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at 25% 20%, rgba(217, 119, 6, 0.10), transparent 55%),
    linear-gradient(135deg, var(--bg-subtle), var(--bg-elevated));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   17. Intro overlay (solo index.html)
   -------------------------------------------------------------------------- */
#intro-mpconecta {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #0A0A0A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.25rem;
  transform: translateY(0);
}

#intro-mpconecta.is-done {
  display: none;
}

/* La animación solo corre con JS activo (html.is-animated) */
html.is-animated #intro-mpconecta {
  animation: intro-curtain 0.9s var(--ease-out) 2.4s forwards;
}

@keyframes intro-curtain {
  to { transform: translateY(-100%); visibility: hidden; }
}

.intro-wordmark {
  display: flex;
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  overflow: hidden;
}

.intro-wordmark .intro-letter {
  display: inline-block;
}

.intro-wordmark .intro-letter.is-amber { color: var(--accent); }

html.is-animated .intro-wordmark .intro-letter {
  opacity: 0;
  transform: translateY(110%);
  animation: intro-letter-up 0.7s var(--ease-out) forwards;
  animation-delay: calc(0.15s + var(--i, 0) * 0.055s);
}

@keyframes intro-letter-up {
  to { opacity: 1; transform: translateY(0); }
}

.intro-line {
  width: min(240px, 50vw);
  height: 2px;
  background: var(--bg-subtle);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

html.is-animated .intro-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
  animation: intro-sweep 1.1s var(--ease-out) 0.9s forwards;
}

@keyframes intro-sweep {
  to { transform: translateX(100%); }
}

/* Sin JS el overlay no debe bloquear la página */
html:not(.is-animated) #intro-mpconecta { display: none; }

/* --------------------------------------------------------------------------
   18. Animación reveal
   -------------------------------------------------------------------------- */
/* Estado final por defecto: la página se ve completa sin JS. */
.reveal {
  opacity: 1;
  transform: none;
}

/* Solo con JS activo se parte del estado oculto */
html.is-animated .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}

html.is-animated .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   19. Parallax
   -------------------------------------------------------------------------- */
[data-parallax] {
  will-change: transform;
}

/* --------------------------------------------------------------------------
   20. Utilidades
   -------------------------------------------------------------------------- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mt-8 { margin-top: 4rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   21. prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html.is-animated .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #intro-mpconecta { display: none !important; }

  .orb,
  .marquee-track,
  .drag-hint { animation: none !important; }

  [data-parallax] { transform: none !important; }
}
