/* =========================================================
   OnListMusic: estilos
   Mobile first. Colores en variables para modo claro/oscuro.
   ========================================================= */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #e9ecf2;
  --surface: #f7f8fb;
  --ink: #161a2e;
  --muted: #545b74;
  --line: #cdd2de;
  --accent: #3346d3;
  --accent-ink: #ffffff;
  --accent-soft: #dcd5fb;
  --bar-off: #c3c8d6;
  --danger: #b3261e;
  --ok: #1d7a4c;
  --focus: #3346d3;

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;

  --wrap: 68rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --radius-field: 0.6rem;
  --radius-panel: 1.25rem;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121527;
    --surface: #1a1e34;
    --ink: #e8eaf4;
    --muted: #a3aac4;
    --line: #2c3150;
    --accent: #8f9dff;
    --accent-ink: #121527;
    --accent-soft: #2e2a5c;
    --bar-off: #2f3454;
    --danger: #ff8a80;
    --ok: #6fd6a1;
    --focus: #8f9dff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121527;
  --surface: #1a1e34;
  --ink: #e8eaf4;
  --muted: #a3aac4;
  --line: #2c3150;
  --accent: #8f9dff;
  --accent-ink: #121527;
  --accent-soft: #2e2a5c;
  --bar-off: #2f3454;
  --danger: #ff8a80;
  --ok: #6fd6a1;
  --focus: #8f9dff;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 5rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; border-radius: 999px; }
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); }

/* ---------- Tipografía ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 9vw, 5.2rem); font-weight: 800; letter-spacing: -0.035em; font-stretch: 88%; }
h2 { font-size: clamp(1.9rem, 5.5vw, 2.9rem); font-stretch: 92%; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }
.lead { font-size: clamp(1.1rem, 2.6vw, 1.3rem); color: var(--muted); max-width: 38rem; }
.section-intro { color: var(--muted); max-width: 36rem; margin-top: 0.75rem; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
body:has(.topbar)::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.topbar__inner { display: flex; align-items: center; gap: 0.75rem; min-height: 4rem; }
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; margin-right: auto;
}
.brand__mark { width: 1.4rem; height: 1.4rem; color: var(--accent); flex: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.7rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn--small { min-height: 2.5rem; padding: 0.45rem 1.05rem; font-size: 0.95rem; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); filter: none; }
.btn--block { width: 100%; }

.theme-toggle {
  width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer;
}
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 10vw, 6.5rem) clamp(3rem, 8vw, 5rem); }
.hero__grid { display: grid; gap: clamp(2.5rem, 6vw, 4rem); align-items: center; }
.hero__kicker { color: var(--muted); font-weight: 500; margin-bottom: 1.25rem; max-width: 30rem; }
.hero__h1 { max-width: 12ch; }
.hero__echo {
  margin-top: 1.5rem; padding-left: 1rem; border-left: 3px solid var(--accent);
  font-family: var(--font-display); font-size: clamp(1.2rem, 3.2vw, 1.55rem); line-height: 1.3;
  font-weight: 600; letter-spacing: -0.015em; max-width: 30rem;
}
.hero__echo span { display: block; }
.hero__echo span + span { color: var(--muted); }
.hero .lead { margin-top: 1.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero__note { margin-top: 1.5rem; font-size: 0.95rem; color: var(--muted); max-width: 32rem; }

/* El filtro: ecualizador donde solo se encienden "tus" barras */
.eq { margin: 0; }
.eq__svg { display: block; width: 100%; height: auto; overflow: visible; }
.eq__bar { fill: var(--bar-off); }
.eq__bar--on { fill: var(--accent); }
.eq__band { fill: var(--accent-soft); }
.eq__caption { display: block; margin-top: 0.9rem; font-size: 0.9rem; color: var(--muted); }
.eq__caption strong { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .eq__bar--on { transform-box: fill-box; transform-origin: 50% 100%; animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 45ms + 250ms); }
  .eq__band { animation: band 0.7s ease-out both 0.1s; }
}
@keyframes rise { from { transform: scaleY(0.12); } to { transform: scaleY(1); } }
@keyframes band { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 56rem) {
  .hero__grid { grid-template-columns: 1.15fr 1fr; }
}

/* ---------- Secciones ---------- */
.section { padding-block: clamp(3.5rem, 9vw, 6rem); }
.section--surface { background: var(--surface); }
.section__head { margin-bottom: clamp(2rem, 5vw, 3rem); }

/* Pasos: es una secuencia real, por eso va numerada */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; counter-reset: paso; }
.step { position: relative; padding-left: 3.5rem; counter-increment: paso; }
.step::before {
  content: counter(paso); position: absolute; left: 0; top: -0.1rem;
  width: 2.4rem; height: 2.4rem; border-radius: 999px; display: grid; place-items: center;
  font: 700 1.05rem/1 var(--font-display); background: var(--accent); color: var(--accent-ink);
}
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 1.15rem; top: 2.6rem; bottom: -1.8rem; width: 2px; background: var(--line);
}
.step p { color: var(--muted); margin-top: 0.4rem; max-width: 34rem; }
@media (min-width: 56rem) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .step { padding-left: 0; padding-top: 3.6rem; }
  .step::before { top: 0; }
  .step:not(:last-child)::after { left: 3rem; right: -2rem; top: 1.15rem; bottom: auto; width: auto; height: 2px; }
}

/* Beneficios */
.benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.benefit { display: grid; gap: 0.35rem; padding-block: 1.4rem; border-bottom: 1px solid var(--line); }
.benefit p { color: var(--muted); max-width: 36rem; }
@media (min-width: 48rem) {
  .benefit { grid-template-columns: 16rem 1fr; gap: 2rem; align-items: baseline; }
}

.promise {
  margin-top: clamp(2.5rem, 6vw, 3.5rem); padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: var(--radius-panel); background: var(--accent-soft);
}
.promise h3 { font-size: 1.35rem; }
.promise ul { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.promise li { padding-left: 1.6rem; position: relative; }
.promise li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 0.8rem; height: 2px; background: var(--ink);
}

/* ---------- Formulario ---------- */
.form-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel);
  padding: clamp(1.25rem, 5vw, 2.5rem); max-width: 44rem;
}
.section--surface .form-panel { background: var(--bg); }
.field { display: grid; gap: 0.4rem; margin: 0 0 1.5rem; border: 0; padding: 0; min-width: 0; }
.field > legend, .field > label, .label { font-weight: 600; padding: 0; margin-bottom: 0.15rem; }
.req { color: var(--accent); }
.opt { color: var(--muted); font-weight: 400; }
.hint { font-size: 0.92rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="url"], select, textarea {
  width: 100%; min-height: 3rem; padding: 0.7rem 0.9rem;
  font: 400 1rem/1.4 var(--font-body); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-field);
}
.section--surface input[type="text"], .section--surface input[type="email"], .section--surface input[type="url"],
.section--surface select, .section--surface textarea { background: var(--surface); }
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.error { color: var(--danger); font-size: 0.92rem; font-weight: 500; min-height: 0; }
.error:empty { display: none; }

.playlist-row { display: flex; gap: 0.5rem; align-items: center; }
.playlist-row + .playlist-row { margin-top: 0.5rem; }
.icon-btn {
  flex: none; width: 3rem; height: 3rem; border-radius: var(--radius-field); border: 1.5px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 1.3rem;
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.add-link {
  justify-self: start; margin-top: 0.4rem; background: none; border: 0; padding: 0.3rem 0;
  color: var(--accent); font: 600 0.98rem var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em;
}
.add-link[hidden] { display: none; }

/* Chips de géneros: checkboxes reales con aspecto de pastilla */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 0.5rem 0.95rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 0.97rem; user-select: none; transition: background 0.12s, border-color 0.12s;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip:hover span { border-color: var(--ink); }

/* Envíos por semana: botones segmentados */
.segments { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.3rem; }
@media (min-width: 34rem) { .segments { grid-template-columns: repeat(4, 1fr); } }
.segment { position: relative; }
.segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segment span {
  display: grid; place-items: center; min-height: 3rem; padding: 0.5rem; text-align: center;
  border-radius: var(--radius-field); border: 1.5px solid var(--line); background: var(--surface); font-weight: 500;
}
.segment input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 700; }
.segment input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.two-col { display: grid; gap: 0 1rem; }
@media (min-width: 40rem) { .two-col { grid-template-columns: 1fr 1fr; } }

.check { display: flex; gap: 0.75rem; align-items: flex-start; }
.check input { flex: none; width: 1.35rem; height: 1.35rem; margin: 0.15rem 0 0; accent-color: var(--accent); cursor: pointer; }
.check label { font-weight: 400; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-box { margin-bottom: 1.25rem; min-height: 65px; }
.form-status { margin-top: 1rem; font-weight: 500; }
.form-status--error { color: var(--danger); }

.success { text-align: left; }
.success__icon { width: 3rem; height: 3rem; color: var(--ok); margin-bottom: 1rem; }
.success h3 { font-size: clamp(1.5rem, 4vw, 2rem); }
.success p { margin-top: 0.75rem; color: var(--muted); max-width: 34rem; }
.success p strong { color: var(--ink); }

/* ---------- Preguntas frecuentes ---------- */
.faq { max-width: 46rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.2rem 2.5rem 1.2rem 0; position: relative;
  font: 600 1.1rem/1.35 var(--font-display); letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  font: 400 1.6rem/1 var(--font-body); color: var(--accent); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding-bottom: 1.3rem; color: var(--muted); max-width: 40rem; }

/* ---------- Pie ---------- */
.footer { padding-block: 3rem; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); }
.footer__grid { display: grid; gap: 1.5rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer__links a { color: var(--ink); }
.footer__legal { font-size: 0.88rem; }
@media (min-width: 48rem) { .footer__grid { grid-template-columns: 1fr auto; align-items: start; } }

/* ---------- Páginas de texto (privacidad, baja) ---------- */
.page { padding-block: clamp(2.5rem, 8vw, 5rem); }
.page__head { margin-bottom: 2.5rem; max-width: 44rem; }
.page__head p { margin-top: 1rem; }
.prose { max-width: 44rem; }
.prose h2 { font-size: clamp(1.35rem, 3.5vw, 1.7rem); margin-top: 2.75rem; margin-bottom: 0.75rem; }
.prose p, .prose ul { margin-bottom: 1rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .legal { padding: 1.25rem; border-radius: var(--radius-field); background: var(--surface); border: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); }
.meta { color: var(--muted); font-size: 0.95rem; }

/* ---------- Panel de administración ---------- */
.admin table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin th, .admin td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin th { font-weight: 600; background: var(--surface); position: sticky; top: 0; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-field); margin-block: 1rem 2.5rem; }
.admin td a { word-break: break-all; }
.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; background: var(--accent-soft); }
