/* =========================================
   PLANTILLA STORY MODE — v2
   Formato inmersivo tipo Instagram/TikTok
   3 slides adaptativas, densas y accionables
   ========================================= */

:root {
  --color-principal: #d92332;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);
  --story-ink: #f8fafc;
  --story-muted: rgba(255, 255, 255, 0.55);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  background: #0a0a0a;
  color: var(--story-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── SHELL (marco del story) ──────────────────── */
.story-shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #0a0a0a;
}

/* ── BARRA DE PROGRESO ────────────────────────── */
.story-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  gap: 5px;
  padding: 12px 14px 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%);
}

.prog-seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  transition: background 0.35s ease;
  cursor: pointer;
  position: relative;
}

/* Zona táctil más generosa sin engordar la barra */
.prog-seg::after {
  content: '';
  position: absolute;
  inset: -10px 0;
}

.prog-seg.done {
  background: rgba(255, 255, 255, 0.9);
}

.prog-seg.active {
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255,255,255,0.5);
}

/* ── CONTENEDOR PRINCIPAL (scroll-snap) ───────── */
.story-container {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.story-container::-webkit-scrollbar { display: none; }
.story-container { -ms-overflow-style: none; scrollbar-width: none; }

/* ── SLIDE BASE ───────────────────────────────── */
.story-slide {
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── ANIMACIONES DE ENTRADA POR SLIDE ─────────── */
.anim {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 0.8, 0.32, 1);
  transition-delay: var(--d, 0s);
}

.story-slide.in-view .anim {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .anim { opacity: 1; transform: none; transition: none; }
  .story-container { scroll-behavior: auto; }
  .swipe-hint i { animation: none; }
}

/* ─────────────────────────────────────────────── */
/* SLIDE 1 — HERO                                  */
/* ─────────────────────────────────────────────── */
.slide-hero {
  background: #0a0a0a;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.38) saturate(1.25);
  z-index: 0;
  transform: scale(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5,5,8,0.94) 0%,
    rgba(5,5,8,0.5) 48%,
    rgba(5,5,8,0.18) 100%
  );
  z-index: 1;
}

.hero-color-glow {
  position: absolute;
  bottom: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 340px;
  background: var(--color-principal);
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.2;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 44px 26px 0;
  width: 100%;
  max-width: 480px;
}

/* Avatar con anillo degradado */
.story-avatar-ring {
  width: 116px;
  height: 116px;
  margin: 0 auto 18px;
  border-radius: 50%;
  padding: 4px;
  background: var(--color-gradiente, var(--color-principal));
  box-shadow:
    0 0 0 6px rgba(255,255,255,0.05),
    0 20px 50px rgba(0,0,0,0.6);
}

.story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #0a0a0a;
  display: block;
}

.hero-name {
  font-size: clamp(1.8rem, 7.5vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 10px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
}

.hero-job {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-icono, var(--color-principal));
  margin-bottom: 4px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.hero-company {
  font-size: 0.9rem;
  color: var(--story-muted);
  letter-spacing: 0.01em;
}

/* Acciones rápidas del hero */
.hero-actions {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
}

.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--story-ink);
  -webkit-tap-highlight-color: transparent;
  min-width: 58px;
  max-width: 78px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.qa-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 1.25rem;
  transition: transform 0.13s ease, background 0.13s ease;
}

.qa-btn:active .qa-circle {
  transform: scale(0.9);
  background: rgba(255,255,255,0.16);
}

.qa-btn.qa-primary .qa-circle {
  background: var(--color-cta, var(--color-principal));
  border-color: transparent;
  color: var(--color-cta-text, #fff);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.qa-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.25;
}

/* Botón "Enviar consulta" en el hero (mismo pill que la última slide) */
.hero-leads {
  width: 100%;
  max-width: 340px;
  margin: 18px auto 0;
}

.hero-nfc-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 6px 15px;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 28px;
}

.hero-nfc-badge i {
  color: var(--color-icono, var(--color-principal));
}

/* ─────────────────────────────────────────────── */
/* SLIDES INTERNAS — scroll propio + centrado      */
/* ─────────────────────────────────────────────── */
.slide-inner {
  width: 100%;
  max-width: 480px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.slide-inner::-webkit-scrollbar { display: none; }
.slide-inner { -ms-overflow-style: none; scrollbar-width: none; }

/* margin auto vertical: centra cuando hay poco contenido,
   scrollea normal cuando hay mucho */
.slide-inner-content {
  margin: auto 0;
  width: 100%;
  padding: 56px 20px 40px;
}

/* ─────────────────────────────────────────────── */
/* SLIDE 2 — SOBRE MÍ + CONTACTO & LINKS           */
/* ─────────────────────────────────────────────── */
.slide-links {
  background:
    radial-gradient(circle at 85% -10%, rgba(255,255,255,0.05), transparent 45%),
    #0b0d14;
}

/* Header con contexto (avatar + nombre) */
.slide-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.slide-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.14);
  flex-shrink: 0;
}

.slide-header-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--story-ink);
  letter-spacing: -0.01em;
}

.slide-kicker {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-icono, var(--color-principal));
  margin-bottom: 2px;
}

/* Tarjeta "Sobre mí" */
.bio-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin-bottom: 18px;
}

.bio-kicker {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-icono, var(--color-principal));
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.bio-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.82);
}

.bio-text p { margin-bottom: 0.6em; }
.bio-text p:last-child { margin-bottom: 0; }

/* ── Cards de links (HTML generado por el server) ── */
.links-list .info-item {
  background: rgba(255,255,255,0.055) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 16px !important;
  margin-bottom: 10px !important;
  padding: 14px 16px !important;
  min-height: 56px;
  color: var(--story-ink);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform 0.12s ease, background 0.12s ease;
}

.links-list .info-item:active {
  transform: scale(0.985);
  background: rgba(255,255,255,0.09) !important;
}

/* Icono con el color del perfil (versión legible en oscuro) */
.links-list .info-item i:not(.fa-chevron-right):not(.arrow-icon),
.links-list .info-item svg {
  color: var(--color-icono, var(--color-principal)) !important;
}

/* Label principal */
.links-list .info-item strong {
  color: var(--story-ink) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

/* Valor / handle secundario */
.links-list .info-item .widget-value {
  color: rgba(255,255,255,0.5) !important;
  font-size: 0.83rem !important;
  opacity: 1 !important;
}

/* Chevron discreto */
.links-list .info-item .fa-chevron-right {
  color: rgba(255,255,255,0.28) !important;
  opacity: 1 !important;
  font-size: 0.78rem !important;
}

/* Bloques especiales dentro de la lista */
.links-list .bloque-presentacion {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px;
  margin-top: 8px !important;
  margin-bottom: 14px !important;
}

.links-list .bloque-presentacion h2 {
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.links-list .bloque-presentacion p {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  line-height: 1.65;
}

.links-list .bloque-presentacion img {
  border: 1px solid rgba(255,255,255,0.08);
}

.links-list .bloque-video,
.links-list .bloque-mapa {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}

.links-list .bloque-texto p {
  color: rgba(255,255,255,0.72);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-top: 6px;
}

.links-list .pdf-container h3 {
  color: rgba(255,255,255,0.85) !important;
}

/* ─────────────────────────────────────────────── */
/* SLIDE FINAL — REDES + VCF + CONSULTA            */
/* ─────────────────────────────────────────────── */
.slide-social {
  background: #0a0a0a;
}

.social-glow {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: var(--color-principal);
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.13;
  pointer-events: none;
}

.slide-social .slide-inner {
  position: relative;
  z-index: 1;
}

.social-content {
  text-align: center;
  padding-left: 26px;
  padding-right: 26px;
}

.social-mini-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.16);
  margin: 0 auto 12px;
  display: block;
}

.social-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.social-company {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.45);
}

.social-icons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 24px 0 26px;
  flex-wrap: wrap;
}

.social-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  color: var(--story-ink);
  font-size: 1.25rem;
  text-decoration: none;
  transition: transform 0.13s ease, background 0.13s ease;
  -webkit-tap-highlight-color: transparent;
}

.social-icon-link:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.1);
}

.story-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 8px;
  background: var(--color-cta, var(--color-principal));
  color: var(--color-cta-text, #fff);
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: 18px;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  transition: transform 0.13s ease;
  -webkit-tap-highlight-color: transparent;
}

.story-save-btn:active {
  transform: scale(0.97);
}

/* ── Formulario de consulta (leads) ───────────── */
.leads-section {
  width: 100%;
  max-width: 340px;
  margin: 14px auto 0;
}

.leads-toggle {
  width: 100%;
  padding: 13px 20px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.leads-toggle.open,
.leads-toggle:active {
  background: rgba(255,255,255,0.15);
}

#leadsStoryForm { margin-top: 14px; }

#leadsStoryForm form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lf-story-input, .lf-story-textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.lf-story-input::placeholder, .lf-story-textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

.lf-story-input:focus, .lf-story-textarea:focus {
  border-color: var(--color-icono, #fff);
}

.lf-story-textarea { resize: none; min-height: 70px; }
.lf-story-row { display: flex; gap: 8px; }
.lf-story-row .lf-story-input { flex: 1; }

.lf-story-submit {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--color-cta, var(--color-principal));
  color: var(--color-cta-text, #fff);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.lf-story-feedback {
  text-align: center;
  font-size: 0.82rem;
  margin: 0;
  min-height: 16px;
  color: #fff;
}

.tapp-story-footer {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.04em;
  margin-top: 26px;
}

/* ── SWIPE HINT ───────────────────────────────── */
.swipe-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.66rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 3;
  transition: opacity 0.4s ease;
}

.swipe-hint i {
  font-size: 0.9rem;
  animation: bounceUp 2s ease infinite;
}

@keyframes bounceUp {
  0%, 100% { transform: translateY(0);    opacity: 0.4; }
  50%       { transform: translateY(-5px); opacity: 0.9; }
}

/* ── DESKTOP: marco tipo teléfono ─────────────── */
@media (min-width: 520px) {
  body {
    background:
      radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--color-principal) 14%, transparent), transparent 60%),
      #101014;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .story-shell {
    width: 390px;
    height: min(92vh, 820px);
    height: min(92dvh, 820px);
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow:
      0 0 0 10px rgba(255,255,255,0.03),
      0 40px 90px rgba(0,0,0,0.75);
  }
}
