/* ==========================================================
   JulyMusic Pro — tokens compartidos (sitio y panel)
   Paleta: lila, celeste, azul, negro, blanco y rojo.
   Claro por defecto; oscuro con data-theme="dark" o, si la
   persona no eligió, según el sistema.
   ========================================================== */

:root {
  color-scheme: light;

  /* Superficies */
  --bg: #ffffff;
  --bg-alt: #f5f5fa;
  --surface: #ffffff;
  --surface-2: #f5f5fa;
  --field: #efeff6;

  /* Texto */
  --ink: #0b0b10;
  --ink-2: #4a4a58;
  --ink-3: #6b6b7a;

  /* Líneas */
  --line: rgba(11, 11, 16, 0.12);
  --line-2: rgba(11, 11, 16, 0.07);

  /* Color de marca */
  --blue: #0a5cff;            /* botones y selección (texto blanco encima) */
  --blue-text: #0a52e0;       /* enlaces y texto azul sobre la superficie */
  --blue-soft: rgba(10, 92, 255, 0.1);
  --lilac: #b9a4ff;
  --lilac-text: #6244e0;
  --lilac-soft: rgba(185, 164, 255, 0.22);
  --sky: #5cc2ff;
  --sky-soft: rgba(92, 194, 255, 0.2);
  --red: #e5192e;             /* botones rojos (texto blanco encima) */
  --red-text: #d0122a;
  --red-soft: rgba(229, 25, 46, 0.09);

  /* Detalles */
  --plate-a: #cfc1ff;
  --plate-b: #a9dcff;
  --case: #0b0b10;
  --nav: rgba(255, 255, 255, 0.72);
  --shadow: 0 1px 2px rgba(11, 11, 16, 0.05), 0 12px 32px rgba(11, 11, 16, 0.07);
  --shadow-lg: 0 2px 4px rgba(11, 11, 16, 0.06), 0 24px 60px rgba(11, 11, 16, 0.14);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050508;
  --bg-alt: #0d0d14;
  --surface: #14141d;
  --surface-2: #1b1b27;
  --field: #1f1f2d;
  --ink: #f5f5f7;
  --ink-2: #bdbdca;
  --ink-3: #8f8fa0;
  --line: rgba(255, 255, 255, 0.14);
  --line-2: rgba(255, 255, 255, 0.08);
  --blue: #0a5cff;
  --blue-text: #6aa8ff;
  --blue-soft: rgba(80, 140, 255, 0.18);
  --lilac: #b9a4ff;
  --lilac-text: #c9baff;
  --lilac-soft: rgba(185, 164, 255, 0.18);
  --sky: #6cc9ff;
  --sky-soft: rgba(108, 201, 255, 0.16);
  --red: #e5192e;
  --red-text: #ff6b79;
  --red-soft: rgba(255, 71, 87, 0.15);
  --plate-a: #4b36a8;
  --plate-b: #1b5fa8;
  --case: #0b0b10;
  --nav: rgba(8, 8, 12, 0.7);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 28px 70px rgba(0, 0, 0, 0.65);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #050508;
    --bg-alt: #0d0d14;
    --surface: #14141d;
    --surface-2: #1b1b27;
    --field: #1f1f2d;
    --ink: #f5f5f7;
    --ink-2: #bdbdca;
    --ink-3: #8f8fa0;
    --line: rgba(255, 255, 255, 0.14);
    --line-2: rgba(255, 255, 255, 0.08);
    --blue: #0a5cff;
    --blue-text: #6aa8ff;
    --blue-soft: rgba(80, 140, 255, 0.18);
    --lilac: #b9a4ff;
    --lilac-text: #c9baff;
    --lilac-soft: rgba(185, 164, 255, 0.18);
    --sky: #6cc9ff;
    --sky-soft: rgba(108, 201, 255, 0.16);
    --red: #e5192e;
    --red-text: #ff6b79;
    --red-soft: rgba(255, 71, 87, 0.15);
    --plate-a: #4b36a8;
    --plate-b: #1b5fa8;
    --case: #0b0b10;
    --nav: rgba(8, 8, 12, 0.7);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 28px 70px rgba(0, 0, 0, 0.65);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.ico { flex: none; }
::selection { background: var(--lilac-soft); }

:focus-visible { outline: 3px solid var(--blue-text); outline-offset: 2px; border-radius: 8px; }

/* Cambio de tema suave (solo mientras se alterna) */
html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px; border: 0;
  font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.18s var(--ease), background-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-primary, .btn-gold { background: var(--blue); color: #fff; }
.btn-primary:hover, .btn-gold:hover { background: #0849d1; }
.btn-secondary, .btn-soft { background: var(--blue-soft); color: var(--blue-text); }
.btn-secondary:hover, .btn-soft:hover { background: rgba(10, 92, 255, 0.18); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--field); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #c9142a; }
.btn-danger { background: var(--red-soft); color: var(--red-text); }
.btn-danger:hover { background: rgba(229, 25, 46, 0.16); }
.btn-wa { background: var(--sky-soft); color: var(--blue-text); }
.btn-wa:hover { background: rgba(92, 194, 255, 0.32); }
.btn-sm { min-height: 36px; padding: 6px 16px; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ---------- Selector de tema (claro / oscuro) ---------- */
.theme-toggle {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--field);
}
.theme-toggle button {
  display: grid; place-items: center; width: 32px; height: 28px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
:root[data-theme="dark"] .theme-toggle button[aria-pressed="true"] { background: #34344a; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
