/* ==========================================================================
   LOOPY — LANDING — TEMA
   ==========================================================================
   Paleta rediseñada: un solo acento dominante (violeta) para todo lo
   interactivo (links, foco, CTAs), un cálido de apoyo para gradientes y
   highlights, y verde/ámbar/coral solo para estados (disponible, pendiente,
   error). El tratamiento arcoíris del logo (anteojos cian + cejas cian/rosa
   + "py" en degradé) se deja intacto — es la firma del isotipo y por eso se
   queda como el único lugar del sitio con esa paleta completa; el resto de
   la UI es deliberadamente más comedido para que el logo siga siendo lo que
   más llama la atención, no uno más entre varios elementos de colores.
   ========================================================================== */

:root {
  --color-bg: #100E1C;
  --color-bg-alt: #17142A;
  --color-surface: #1C1830;
  --color-surface-2: #241F3D;
  --color-text: #F5F3FA;
  --color-text-muted: #A79FC2;
  --color-border: #2E2847;

  /* Colores del isotipo — usados solo por el SVG del logo y su degradé "py" */
  --color-pink: #F5479C;
  --color-lime: #CBF135;
  --color-orange: #FF8A4C;

  /* Acento único de marca (interactivo: links, foco, CTAs) */
  --color-primary: #7C5CFC;
  --color-primary-dark: #6344E0;

  /* Acento cálido de apoyo, para el degradé de marca y el highlight del hero */
  --color-accent-warm: #FF8A4C;

  /* Estados */
  --color-success: #2DD4A7;
  --color-online: var(--color-success);
  --color-danger: #FF6B81;
  --color-amber: #FFB454;

  --gradient-brand: linear-gradient(135deg, var(--color-primary), var(--color-accent-warm));
  --gradient-warm: linear-gradient(90deg, var(--color-orange), var(--color-pink) 55%, var(--color-lime));

  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  --glow-purple: 0 0 0 1px rgba(124, 92, 252, 0.35), 0 8px 30px rgba(124, 92, 252, 0.25);

  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; color: var(--color-text); }
p { margin: 0 0 1em; color: var(--color-text-muted); line-height: 1.6; }

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--glow-purple);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(245, 71, 156, 0.4), 0 10px 34px rgba(245, 71, 156, 0.32); }

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------------- LOOPY LOGO (interactive) ---------------- */
.loopy-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo-glyph { display: flex; align-items: center; margin: 0 1px; transform: translateY(6%); }
.logo-word { display: inline-flex; align-items: center; gap: 1px; font-weight: 800; font-size: 21px; letter-spacing: -0.01em; }
.logo-word-lg { font-size: 40px; }
.logo-l { color: var(--color-primary); }
.logo-py {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.loopy-pupil { transition: transform 0.05s linear; }

.tagline-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-primary);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
  position: relative;
}

.sparkle { position: absolute; animation: sparkle-pulse 2.6s ease-in-out infinite; }
.sparkle-1 { top: -18px; left: 210px; animation-delay: 0.3s; }
.sparkle-2 { top: 30px; left: 0; animation-delay: 1.1s; }
@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(12deg); }
}
@media (prefers-reduced-motion: reduce) {
  .sparkle { animation: none; }
}

/* ---------------- HEADER ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(11, 11, 29, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 600;
  font-size: 15px;
  margin-left: auto;
}
.main-nav a { color: var(--color-text-muted); transition: color 0.15s ease; }
.main-nav a:hover { color: var(--color-primary); }
.nav-cta {
  background: var(--gradient-brand);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-left: 18px;
  flex-shrink: 0;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn:hover { color: var(--color-text); }
.lang-btn.active { background: var(--gradient-brand); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 22px; background: var(--color-text); margin: 0 auto; }

/* ---------------- HERO ---------------- */
.hero { padding: 64px 0 96px; position: relative; overflow: hidden; }
.hero::before {
  content: '';
  position: absolute;
  top: -220px; left: 50%;
  width: 900px; height: 500px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(124, 92, 252, 0.22), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  position: relative;
}

.eyebrow {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(32px, 4.4vw, 50px);
  letter-spacing: -0.02em;
}
.hero h1 .highlight {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 18px;
  max-width: 46ch;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 14px; }
.hero-note { font-size: 13px; color: var(--color-text-muted); }

/* --- Formulario embebido en el hero (reemplaza al chat que estaba acá) --- */
.hero-form-wrap { width: 100%; }
.hero-form-title { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 20px; }

/* --- Chat panel de la sección "Ver a Loopy en acción" --- */
.chat-demo-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.chat-demo-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.chat-panel {
  width: 100%;
  max-width: 420px;
  height: 520px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--gradient-brand);
  color: #fff;
}
.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.chat-header-text { display: flex; flex-direction: column; line-height: 1.3; }
.chat-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: 0.9; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-amber); flex-shrink: 0; }
.status-dot.online { background: var(--color-online); }
.status-dot.offline { background: var(--color-danger); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-bg-alt);
}

.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg-assistant {
  align-self: flex-start;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}
.msg-user {
  align-self: flex-end;
  background: var(--gradient-brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-system {
  align-self: center;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12.5px;
  text-align: center;
  max-width: 100%;
}

.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-text-muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.chat-input-row input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 14.5px;
  background: var(--color-bg-alt);
  color: var(--color-text);
}
.chat-input-row input::placeholder { color: var(--color-text-muted); }
.chat-input-row input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.chat-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}
.chat-send-btn:hover { opacity: 0.88; }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-caption { font-size: 13px; color: var(--color-text-muted); text-align: center; max-width: 380px; }

/* ---------------- SECTIONS ---------------- */
.section { padding: 88px 0; }
.section-alt { background: var(--color-bg-alt); }

.section-eyebrow {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.section-title { font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.01em; max-width: 20ch; }
.section-lead { font-size: 17px; max-width: 62ch; }

/* --- Cómo funciona --- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 44px;
}
.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 26px 22px;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-weight: 800;
  margin-bottom: 16px;
}
.step-cyan .step-number { background: rgba(124, 92, 252, 0.16); color: var(--color-primary); }
.step-pink .step-number { background: rgba(255, 138, 76, 0.16); color: var(--color-accent-warm); }
.step-lime .step-number { background: rgba(45, 212, 167, 0.16); color: var(--color-success); }
.step-orange .step-number { background: rgba(255, 180, 84, 0.16); color: var(--color-amber); }
.step-card h3 { font-size: 17px; margin-bottom: 8px; }
.step-card p { font-size: 14.5px; margin: 0; }

/* --- Roadmap --- */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 44px;
}
.roadmap-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 26px;
}
.roadmap-live { border-color: rgba(45, 212, 167, 0.45); background: linear-gradient(180deg, rgba(45, 212, 167, 0.08), transparent 60%), var(--color-surface); }
.roadmap-card h3 { font-size: 18px; margin: 10px 0 8px; }
.roadmap-card p { margin: 0; font-size: 14.5px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-live { background: var(--color-success); color: #0F1B17; }
.badge-soon { background: rgba(124, 92, 252, 0.18); color: #C9BBFF; }

/* --- Waitlist (el form vive ahora en el hero, ver arriba) --- */
.waitlist-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row-full { grid-column: 1 / -1; }
.form-row label { font-size: 13.5px; font-weight: 700; }
.optional { font-weight: 400; color: var(--color-text-muted); }
.form-row input, .form-row textarea {
  font-family: inherit;
  font-size: 14.5px;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text);
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

.form-status { font-size: 14px; font-weight: 600; min-height: 20px; }
.form-status.success { color: var(--color-success); }
.form-status.error { color: var(--color-danger); }

/* ---------------- FOOTER ---------------- */
.site-footer { background: var(--color-bg-alt); color: var(--color-text-muted); padding: 56px 0 24px; border-top: 1px solid var(--color-border); }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-border);
}
.footer-brand p { color: var(--color-text-muted); margin-top: 10px; font-size: 14px; }

.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-title { font-weight: 700; color: var(--color-text); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.footer-col a { color: var(--color-text-muted); font-size: 14.5px; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--color-primary); }

.footer-bottom { padding-top: 22px; font-size: 13px; color: #6A6790; }
.footer-bottom p { margin: 0; color: inherit; }

/* ---------------- FLOATING ACTIONS (WhatsApp / Instagram / chat) ---------------- */
.floating-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.floating-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.floating-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.floating-btn.is-hidden { display: none; }

.floating-btn-chat {
  background: var(--gradient-brand);
  color: #fff;
}
.floating-btn-whatsapp {
  width: 58px;
  height: 58px;
  background: #25D366;
  color: #fff;
}
.floating-btn-instagram {
  background: radial-gradient(circle at 30% 110%, #FFD879 0%, #FF7950 30%, #E0286B 55%, #C42A93 70%, #8C3AAF 100%);
  color: #fff;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .chat-demo-inner { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .roadmap-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .tagline-bubble { display: none; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  .main-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-toggle { display: flex; }
  .nav-cta { width: 100%; text-align: center; }
  .lang-switch { margin-left: auto; }

  .steps-grid { grid-template-columns: 1fr; }
  .waitlist-form { grid-template-columns: 1fr; }
  .chat-panel { height: 460px; max-width: 100%; }
  .section { padding: 64px 0; }
  .logo-word-lg { font-size: 30px; }
}
