/* =========================================================
   components.css
   Piezas reutilizables: botones, tarjetas, chips, formulario,
   acordeón, wordmark, botón flotante, placeholders de media.
   ========================================================= */

/* ---------- Wordmark (logo de texto, aislado y reemplazable) ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-head);
  font-weight: 700;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--grad-accent);
  color: var(--c-white);
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  box-shadow: var(--sh-glow);
}
.brand__text { font-size: var(--fs-lg); letter-spacing: -0.01em; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: 1;
  padding: 0.95em 1.6em;
  border-radius: var(--r-pill);
  transition: transform var(--t-fast), box-shadow var(--t-base), background var(--t-base), border-color var(--t-base);
  white-space: nowrap;
  text-align: center;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn--primary {
  background: var(--c-blue-royal);
  color: var(--c-white);
  box-shadow: 0 6px 20px -8px rgba(27, 63, 224, 0.7);
}
.btn--primary:hover {
  background: #2f54f0;                  /* azul rey un punto más claro */
  box-shadow: 0 10px 26px -8px rgba(27, 63, 224, 0.8);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { border-color: var(--c-cyan); color: var(--c-cyan); }

.btn--sm { padding: 0.6em 1.1em; font-size: var(--fs-sm); }
.btn--lg { padding: 1.05em 1.9em; font-size: var(--fs-lg); }
.btn--block { width: 100%; }

/* ---------- Chips / etiquetas ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.chip {
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 0.45em 1em;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Tarjetas ---------- */
.cards { display: grid; gap: var(--space-5); }
.cards--3 { grid-template-columns: 1fr; }
.cards--4 { grid-template-columns: 1fr; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--sh-md); }
/* Icono de tarjeta: SVG de linea monocromo (sustituye a los emojis de color) */
.card__icon {
  display: inline-grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: var(--space-4);
  border-radius: var(--r-md);
  background: var(--grad-accent-soft);
  border: 1px solid var(--border-strong);
  color: var(--c-cyan);
  transition: background var(--t-base), color var(--t-base);
}
.card__icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.card:hover .card__icon { background: var(--grad-accent); color: #fff; }
.card__title { font-size: var(--fs-xl); margin-bottom: var(--space-3); }
.card__text { color: var(--text-muted); font-size: var(--fs-base); }

/* Tarjeta de beneficio (con número) */
.card--benefit { display: flex; gap: var(--space-4); align-items: flex-start; }
.card--benefit p { color: var(--text-muted); }
.card__num {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  background: var(--grad-accent-soft);
  border: 1px solid var(--border-strong);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--c-cyan);
}

/* Tarjeta de metodología (borde superior de acento) */
.card--method { position: relative; overflow: hidden; }
.card--method::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-accent);
}

/* ---------- Placeholders de media ([PENDIENTE]) ---------- */
/* Slot de imagen intencional (duotono azul + grano), no un recuadro "sin terminar" */
.media-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 28% 0%, rgba(27, 63, 224, 0.22), transparent 60%),
    linear-gradient(160deg, var(--c-navy-deep) 0%, var(--c-ink-950) 100%);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-align: center;
  padding: var(--space-6);
  min-height: 220px;
  overflow: hidden;
}
/* grano sutil dentro del slot */
.media-placeholder::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: 0.4; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}
.media-placeholder--hero { aspect-ratio: 4 / 5; min-height: 340px; }
.media-placeholder--portrait { aspect-ratio: 4 / 5; }
.media-placeholder--video { aspect-ratio: 16 / 9; min-height: 0; border: none; background: transparent; }
.media-placeholder--video::after { display: none; }
.media-placeholder__tag {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-head);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  padding: 0.5em 0.9em;
  border-radius: var(--r-pill);
}
.media-placeholder__tag::before {
  content: ""; width: 14px; height: 11px; flex: none;
  border: 1.5px solid currentColor; border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0) ;
  background:
    radial-gradient(circle at 50% 55%, currentColor 1.6px, transparent 2px);
  opacity: 0.8;
}

/* Slot de media CON foto real: la imagen llena el marco (recorte centrado) */
.media-placeholder--filled { padding: 0; }
.media-placeholder--filled img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
/* El grano se mantiene muy sutil sobre la foto */
.media-placeholder--filled::after { opacity: 0.15; }

/* "Sobre mí": la foto va a color pero con la MISMA tinta azul del hero
   (degradado navy oscuro + brillo azul/cian de marca) por encima de la imagen.
   Se reutiliza el ::after para pintar la capa de color sobre la foto. */
#sobre-mi .media-placeholder--filled::after {
  opacity: 1;
  mix-blend-mode: normal;
  background-image:
    radial-gradient(110% 80% at 25% 8%, rgba(27, 63, 224, 0.46), transparent 58%),
    radial-gradient(90% 70% at 88% 100%, rgba(25, 212, 255, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(6, 12, 34, 0.28) 0%, rgba(6, 12, 34, 0.66) 100%);
  background-size: cover;
  background-repeat: no-repeat;
}

/* ---------- Testimonios ---------- */
.testimonials { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
}
.testimonial__quote { font-size: var(--fs-lg); line-height: var(--lh-snug); }
.testimonial__quote::before { content: "“"; color: var(--c-cyan); font-size: 2rem; font-family: var(--font-head); line-height: 0; vertical-align: -0.35em; margin-right: 0.1em; }
.testimonial__author { margin-top: var(--space-4); display: flex; flex-direction: column; }
.testimonial__name { font-family: var(--font-head); font-weight: 600; }
.testimonial__result { color: var(--c-cyan); font-size: var(--fs-sm); }
.testimonial--placeholder {
  border-color: var(--border);
  color: var(--text-dim);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(27, 63, 224, 0.1), transparent 55%),
    var(--surface);
}
.testimonial--placeholder .testimonial__quote { font-size: var(--fs-base); }
.testimonial--placeholder .testimonial__quote::before { content: ""; }

/* ---------- Transformaciones ---------- */
.transform { padding: var(--space-4); }
.transform__imgs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.transform__ph {
  display: grid; place-items: end center;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(27, 63, 224, 0.18), transparent 60%),
    linear-gradient(160deg, var(--c-navy-deep), var(--c-ink-950));
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: var(--space-4);
}
.transform__caption { margin-top: var(--space-4); color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- Certificaciones ---------- */
.certs { display: grid; gap: var(--space-4); grid-template-columns: 1fr; max-width: 720px; margin-inline: auto; }
.cert {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-4) var(--space-5);
  display: flex; align-items: center; gap: var(--space-4);
}
.cert::before { content: "✓"; color: var(--c-cyan); font-weight: 700; }
.cert--placeholder { border-style: dashed; border-color: var(--border-strong); color: var(--c-cyan); }

/* ---------- Acordeón FAQ ---------- */
.faq { display: grid; gap: var(--space-3); }
.faq__item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.faq__q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  text-align: left;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--fs-lg);
  padding: var(--space-5);
}
.faq__icon { position: relative; flex: none; width: 18px; height: 18px; }
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; background: var(--c-cyan);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  transition: transform var(--t-base);
}
.faq__icon::before { width: 14px; height: 2px; }
.faq__icon::after  { width: 2px; height: 14px; }
.faq__q[aria-expanded="true"] .faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.faq__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base);
}
.faq__a p { padding: 0 var(--space-5) var(--space-5); color: var(--text-muted); }

/* ---------- Formulario ---------- */
.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  box-shadow: var(--sh-md);
}
.form__title { font-size: var(--fs-xl); margin-bottom: var(--space-2); }
.form__subtitle { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--space-5); }
.form__field { margin-bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.form__field label { font-size: var(--fs-sm); font-weight: 600; }
.form__optional { color: var(--text-dim); font-weight: 400; }
.form__field input,
.form__field select,
.form__field textarea {
  background: var(--c-navy-ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0.85em 1em;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form__field input::placeholder,
.form__field textarea::placeholder { color: var(--text-dim); }
.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
  outline: none;
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 3px rgba(25, 212, 255, 0.18);
}
.form__field textarea { resize: vertical; }
.form__field.has-error input,
.form__field.has-error select { border-color: #ff6b6b; }
.form__error { color: #ff8a8a; font-size: var(--fs-xs); min-height: 1em; }
.form__status {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  text-align: center;
}
.form__status.is-ok  { background: rgba(25,212,255,.12); border: 1px solid var(--c-cyan); color: var(--c-cyan); }
.form__status.is-err { background: rgba(255,107,107,.1); border: 1px solid #ff6b6b; color: #ff9a9a; }

/* Honeypot anti-spam: fuera de pantalla (no display:none, para que los bots lo vean y lo rellenen) */
.form__hp {
  position: absolute !important;
  left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-float {
  position: fixed;
  right: clamp(1rem, 2vw, 1.5rem);
  bottom: calc(clamp(1rem, 2vw, 1.5rem) + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: grid; place-items: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25d366;             /* verde WhatsApp */
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  transition: transform var(--t-base);
}
.whatsapp-float::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: wa-pulse 2.4s infinite;
}
.whatsapp-float:hover { transform: scale(1.08); }
@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.55); }
  70%  { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float::after { animation: none; }
}

/* ---------- Barra fija de llamada (solo móvil, si hay teléfono) ---------- */
.mobile-call {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 59;
  display: none; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.9rem 1rem;
  padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
  background: var(--grad-accent); color: #fff;
  font-family: var(--font-head); font-weight: 600;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
}
@media (max-width: 900px) {
  .mobile-call:not([hidden]) { display: flex; }
  /* Si la barra de llamada está activa, subimos el botón flotante de WhatsApp para que no se solapen */
  body.has-callbar .whatsapp-float { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* =========================================================
   EFECTOS VISUALES (catalogo de la skill, en vanilla)
   ========================================================= */

/* ---------- 1. Barra de progreso de scroll (arriba) ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 200; background: rgba(255, 255, 255, 0.06); pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%;
  background: var(--grad-accent);
  transform-origin: 0 0; transform: scaleX(0);
  transition: transform 0.08s linear;
}

/* ---------- 2. Grano de pelicula (textura sutil, global) ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ---------- 3. Tilt 3D sutil en tarjetas ---------- */
.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-soft);
}
.has-tilt:hover { transition-duration: 0.15s; }

/* ---------- 4. Marquee de especialidades (CSS puro, infinito) ---------- */
.marquee {
  overflow: hidden; position: relative;
  border-block: 1px solid var(--border);
  padding-block: var(--space-4);
  background: var(--bg-alt);
}
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none;
}
.marquee::before { left: 0;  background: linear-gradient(90deg, var(--bg-alt), transparent); }
.marquee::after  { right: 0; background: linear-gradient(270deg, var(--bg-alt), transparent); }
.marquee__track {
  display: flex; gap: 2.5rem; width: max-content;
  will-change: transform;
  animation: marquee-scroll 28s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 2.5rem;
  white-space: nowrap;
}
.marquee__item::after {
  content: "·"; color: var(--c-cyan); font-size: 1.4em;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* la pista se duplica por JS → bucle perfecto */
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; }
}
