/* ─────────────────────────────────────────────
   HazMiCancion — Tema "estudio oscuro"
   Fondo noche, acentos morado→rosa neón
   ───────────────────────────────────────────── */
:root {
  --bg: #0a0a16;
  --panel: #14142a;
  --panel-2: #1a1a36;
  --borde: rgba(139, 92, 246, 0.25);
  --texto: #ecebf5;
  --apagado: #9a99b8;
  --morado: #8b5cf6;
  --rosa: #ec4899;
  --grad: linear-gradient(90deg, #8b5cf6, #ec4899);
  --radio: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--texto);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Navegación ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.8rem 5vw;
  background: rgba(10, 10, 22, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--borde);
}
.logo {
  font-size: 1.3rem; font-weight: 800; text-decoration: none;
  color: var(--texto); letter-spacing: -0.02em;
}
.logo-icon { filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.6)); }
.nav-links { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.nav-links a { color: var(--apagado); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--texto); }
.lang-switch { color: var(--apagado); font-size: 0.9rem; }
.lang-switch a { padding: 0 0.25rem; }
.lang-switch a.activo { color: var(--texto); font-weight: 700; }

/* ── Botones ── */
.btn {
  display: inline-block;
  background: var(--grad);
  color: #fff !important;
  border: none; cursor: pointer;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 700; font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(236, 72, 153, 0.45); }
.btn-grande { padding: 0.9rem 2.2rem; font-size: 1.15rem; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn-full { width: 100%; }
.btn-alt { background: var(--panel-2); border: 1px solid var(--borde); box-shadow: none; }
.btn-wsp { background: linear-gradient(90deg, #16a34a, #22c55e); box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3); }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 6rem 5vw 4rem;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 45% at 20% 0%, rgba(139, 92, 246, 0.22), transparent),
    radial-gradient(ellipse 60% 45% at 80% 10%, rgba(236, 72, 153, 0.16), transparent);
}
.hero-inner { max-width: 780px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 1.2rem;
}
.hero-sub { color: var(--apagado); font-size: 1.15rem; margin-bottom: 2rem; }
.hero-nota { color: var(--apagado); font-size: 0.9rem; margin-top: 1rem; }

/* Ecualizador animado */
.ecualizador {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 5px; height: 64px; margin-top: 3rem;
}
.ecualizador span {
  width: 6px; height: 100%;
  background: var(--grad);
  border-radius: 3px;
  opacity: 0.85;
  animation: barra 1.1s ease-in-out infinite alternate;
  transform-origin: bottom;
}
.ecualizador.chico { height: 40px; margin: 1.5rem 0; }
@keyframes barra {
  from { transform: scaleY(0.15); }
  to   { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ecualizador span { animation: none; transform: scaleY(0.6); }
}

/* ── Secciones ── */
.seccion { padding: 4rem 5vw; max-width: 1080px; margin: 0 auto; }
.seccion-angosta { max-width: 640px; }
.seccion h1, .seccion h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 2rem; text-align: center; letter-spacing: -0.02em;
}

/* Tarjetas "cómo funciona" */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.tarjeta {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.8rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tarjeta:hover { transform: translateY(-4px); border-color: rgba(236, 72, 153, 0.5); }
.tarjeta-icono { font-size: 2rem; margin-bottom: 0.8rem; }
.tarjeta h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.tarjeta p { color: var(--apagado); font-size: 0.95rem; }

/* Precios */
.precio-caja {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 2.5rem; text-align: center;
  max-width: 640px; margin: 0 auto;
}
.precio-desc { color: var(--apagado); margin-bottom: 1.5rem; }
.precio-opciones { display: flex; justify-content: center; align-items: center; gap: 2rem; flex-wrap: wrap; }
.precio-opcion { display: flex; flex-direction: column; }
.precio-monto { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; }
.precio-medio { color: var(--apagado); font-size: 0.9rem; }
.precio-sep { width: 1px; height: 60px; background: var(--borde); }
.precio-incluye { color: var(--apagado); font-size: 0.9rem; margin-top: 1.5rem; }

/* ── Formulario ── */
.formulario {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 2rem;
  max-width: 640px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.formulario label, .formulario .etiqueta {
  font-weight: 600; font-size: 0.95rem; margin-top: 1rem;
}
.formulario input[type="text"], .formulario input[type="email"],
.formulario input[type="password"], .formulario select, .formulario textarea {
  background: var(--bg);
  border: 1px solid var(--borde);
  border-radius: 10px;
  color: var(--texto);
  padding: 0.7rem 0.9rem;
  font-size: 1rem; font-family: inherit;
  width: 100%;
}
.formulario input:focus, .formulario select:focus, .formulario textarea:focus {
  outline: 2px solid var(--morado); border-color: transparent;
}
.radio-grupo { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.radio-opcion {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  cursor: pointer; font-size: 0.95rem;
}
.radio-opcion:has(input:checked) {
  border-color: var(--rosa);
  box-shadow: 0 0 0 1px var(--rosa);
}
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 1rem; font-size: 0.9rem; color: var(--apagado); cursor: pointer; }
.check input { margin-top: 0.3rem; }
.formulario button { margin-top: 1.5rem; }

/* Alerta de error */
.alerta {
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid var(--rosa);
  border-radius: 10px;
  color: var(--texto);
  padding: 0.9rem 1.2rem;
  max-width: 640px; margin: 1rem auto; text-align: center;
}

/* Buscar pedido */
.buscar-caja {
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 1.8rem; text-align: center;
}
.buscar-form { display: flex; gap: 0.8rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.buscar-form input {
  background: var(--bg); border: 1px solid var(--borde); border-radius: 999px;
  color: var(--texto); padding: 0.65rem 1.2rem; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.15em; width: 140px; text-align: center;
}

/* FAQ */
.faq-item {
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: 12px; padding: 1rem 1.3rem; margin-bottom: 0.8rem;
}
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { color: var(--apagado); margin-top: 0.6rem; }
.faq-item code { word-break: break-all; color: var(--rosa); }

/* ── Página de pedido ── */
.pedido-caja {
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 2.5rem; text-align: center;
}
.pedido-guarda { color: var(--apagado); font-size: 0.85rem; }
.pedido-codigo { font-size: 2.6rem; font-weight: 800; letter-spacing: 0.2em; }
.pedido-titulo { font-size: 1.2rem; color: var(--apagado); font-weight: 500; margin-bottom: 2rem; }
.estado-msg { font-size: 1.3rem; margin: 1.5rem 0 1rem; }
.pago-metodo {
  background: var(--bg); border: 1px solid var(--borde);
  border-radius: 12px; padding: 1.2rem; margin: 1rem 0;
}
.pago-precio { font-size: 2rem; font-weight: 800; display: block; }
.nota { color: var(--apagado); font-size: 0.9rem; margin-top: 1rem; }
.descargas { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1.5rem; }
.demo-player { width: 100%; margin: 1.2rem 0; }
.letra-caja {
  margin-top: 1.8rem; text-align: left;
  background: var(--bg); border: 1px solid var(--borde);
  border-radius: 12px; padding: 1rem 1.3rem;
}
.letra-caja summary { cursor: pointer; font-weight: 700; }
.letra-texto {
  white-space: pre-wrap; font-family: inherit;
  color: var(--apagado); margin-top: 0.8rem; line-height: 1.7;
}
.letra-editor {
  width: 100%; margin-top: 1rem;
  background: var(--bg); border: 1px solid var(--borde);
  border-radius: 12px; color: var(--texto);
  padding: 1rem 1.2rem; font-family: inherit; font-size: 1rem;
  line-height: 1.7; text-align: left; resize: vertical;
}
.letra-editor:focus { outline: 2px solid var(--morado); border-color: transparent; }

/* ── Popup de letra al instante ── */
.modal-fondo {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 5, 12, 0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
/* REGLA DE ORO: el atributo hidden SIEMPRE gana, aunque otro estilo
   declare display:flex/grid — sin esto, elementos "ocultos" seguirían
   visibles y hasta bloquearían clics (nos pasó con este modal). */
[hidden] { display: none !important; }
.modal {
  position: relative;
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 2rem;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.modal h3 { font-size: 1.3rem; }
.modal textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--borde);
  border-radius: 10px; color: var(--texto);
  padding: 0.8rem 1rem; font-family: inherit; font-size: 1rem;
  line-height: 1.6; resize: vertical;
}
.modal textarea:focus { outline: 2px solid var(--morado); border-color: transparent; }
.modal .btn { margin-top: 0.4rem; }
.modal-cerrar {
  position: absolute; top: 0.8rem; right: 1rem;
  background: none; border: none; color: var(--apagado);
  font-size: 1.2rem; cursor: pointer;
}
.modal-cerrar:hover { color: var(--texto); }
#ml-paso1, #ml-espera, #ml-resultado { display: flex; flex-direction: column; gap: 0.8rem; }
.badge-ok {
  display: inline-block; margin-top: 0.6rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #4ade80; font-weight: 600;
  padding: 0.5rem 1rem; border-radius: 999px;
}
.badge-ok a { color: var(--apagado); }
.pedido-caja form { margin-top: 1.2rem; }
.precio-gratis {
  display: inline-block; margin-bottom: 1.2rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #4ade80; font-weight: 700;
  padding: 0.5rem 1.2rem; border-radius: 999px;
}

/* Línea de tiempo */
.timeline { display: flex; justify-content: space-between; margin: 1.5rem 0; }
.timeline-paso {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  position: relative; color: var(--apagado); font-size: 0.8rem;
}
.timeline-paso::before {
  content: ""; position: absolute; top: 8px; left: -50%; width: 100%;
  height: 2px; background: var(--panel-2); z-index: 0;
}
.timeline-paso:first-child::before { display: none; }
.timeline-paso.hecho::before { background: var(--morado); }
.punto {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--panel-2); z-index: 1;
  border: 2px solid var(--panel-2);
}
.timeline-paso.hecho .punto { background: var(--grad); border-color: transparent; }
.timeline-paso.actual .punto { box-shadow: 0 0 12px rgba(236, 72, 153, 0.8); }
.timeline-paso.hecho { color: var(--texto); }

/* ── Admin ── */
.admin-resumen { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.5rem; }
.admin-stat {
  background: var(--panel); border: 1px solid var(--borde); border-radius: 12px;
  padding: 0.8rem 1.4rem; display: flex; flex-direction: column; align-items: center;
}
.admin-stat strong { font-size: 1.5rem; }
.admin-stat span { color: var(--apagado); font-size: 0.8rem; }
.tabla-envoltura { overflow-x: auto; margin-top: 1rem; }
.admin-tabla { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-tabla th, .admin-tabla td {
  padding: 0.6rem 0.8rem; text-align: left;
  border-bottom: 1px solid var(--borde); vertical-align: top;
}
.admin-tabla a { color: var(--rosa); }
.chip {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
.chip-letra_lista { background: rgba(96, 165, 250, 0.15); color: #93c5fd; }
.chip-demo_lista { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.chip-pendiente_pago { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.chip-en_cola { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.chip-generando { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.chip-completado { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.chip-fallido { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.chip-reembolsado { background: rgba(154, 153, 184, 0.15); color: var(--apagado); }
.letra-pre {
  white-space: pre-wrap; background: var(--bg); border-radius: 8px;
  padding: 0.8rem; font-size: 0.8rem; max-width: 400px;
}

/* ── Pie ── */
.footer {
  border-top: 1px solid var(--borde);
  padding: 2rem 5vw; text-align: center;
  color: var(--apagado); font-size: 0.85rem;
}
.legal-ia { margin-bottom: 0.5rem; }

@media (max-width: 600px) {
  .nav { justify-content: center; }
  .precio-sep { display: none; }
  .hero { padding-top: 4rem; }
}
