/* Musicaliza-t — paleta del sitio publicado */
:root {
  --paper: #f4f0e6;
  --surface: #fffdf8;
  --ink: #141414;
  --muted: #5c564c;
  --line: #14141414;
  --art: #f3eee6;
  --seal: #0e3f3c;
  --tide: #3d6d69;
  --gold: #d4bc7d;
  --danger: #8e1b12;
  --pending: #e6b325;
  --ok: #1b6b3a;
  --wa: #1fa855;
  --shadow: 0 0 0 1px #1414140d, 0 10px 24px -18px #14141459;
  --font-display: "Manrope", "Outfit", system-ui, sans-serif;
  --font-sans: "Outfit", system-ui, sans-serif;
  --header-h: 3.75rem;
  --radius: 1.25rem;
  --max: 64rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
  padding-top: var(--header-h);
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, .display { font-family: var(--font-display); }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: calc(var(--header-h) + 0.5rem);
  z-index: 60;
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--seal);
  color: var(--surface);
}
.site-header .bar {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.85rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-width: 0;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
.brand img {
  width: 2.55rem;
  height: 2.55rem;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.icon-btn {
  margin-left: auto;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}
.icon-btn:hover, .icon-btn:focus-visible { background: #ffffff1a; }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Menu drawer */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: #081c1acc;
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.menu-backdrop.open { opacity: 1; pointer-events: auto; }
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 88vw);
  background: var(--surface);
  color: var(--ink);
  z-index: 50;
  transform: translateX(110%);
  transition: transform 0.25s ease;
  box-shadow: -16px 0 40px #00000033;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem 2rem;
}
.menu-panel.open { transform: translateX(0); }
.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.menu-head strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.menu-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.menu-nav a, .menu-nav button {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  text-decoration: none;
  border: 0;
  background: none;
  padding: 0.85rem 0.9rem;
  border-radius: 0.9rem;
  font-weight: 600;
  font-size: 1.05rem;
}
.menu-nav a:hover, .menu-nav button:hover,
.menu-nav a:focus-visible, .menu-nav button:focus-visible {
  background: var(--art);
  outline: none;
}

/* Layout */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}
.stack { display: flex; flex-direction: column; gap: 2.25rem; }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  max-width: 36rem;
  margin: 0 auto;
  padding-top: 0.5rem;
}
.hero-logo {
  width: 12rem;
  height: auto;
  mix-blend-mode: multiply;
}
.kicker {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}
.hero h1 {
  font-size: clamp(1.85rem, 6vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0;
}
.hero .lead {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
}
.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.35rem;
}
.age-note {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--gold);
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 2.85rem;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-seal { background: var(--seal); color: var(--surface); }
.btn-tide { background: var(--tide); color: var(--surface); }
.btn-ink { background: var(--ink); color: var(--surface); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--seal);
  box-shadow: inset 0 0 0 1.5px var(--seal);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Sections */
.section-head { margin-bottom: 0.9rem; }
.section-head h2 {
  margin: 0 0 0.3rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}
.section-head p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.class-grid, .shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.class-card { display: flex; flex-direction: column; }
.class-card .art, .shop-card .art {
  aspect-ratio: 1;
  background: var(--art);
  display: flex;
  align-items: center;
  justify-content: center;
}
.class-card .art img, .shop-card .art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.class-card .body, .shop-card .body {
  padding: 0.85rem 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.class-card h3, .shop-card h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.muted, .desc { color: var(--muted); font-size: 0.92rem; }
.price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin: 0.25rem 0 0.55rem;
}
.class-card .btn, .shop-card .btn { margin-top: auto; }

/* How it works */
.steps {
  display: grid;
  gap: 0.75rem;
}
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem;
}
.step-num {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: var(--seal);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
}
.step h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Visit card */
.visit {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}
.visit h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.03em; }
.visit-block h3 {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  font-family: var(--font-sans);
}
.visit-block p { margin: 0; }
.map-row, .contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  background: var(--art);
  color: var(--seal);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}
.chip-seal { background: var(--seal); color: var(--surface); }
.chip-wa { background: var(--wa); color: #fff; }

/* Footer */
.site-footer {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding: 1.5rem 1rem 6.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.15rem;
  margin-bottom: 0.85rem;
}
.legal-nav a, .legal-nav button {
  background: none;
  border: 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  font-size: 0.88rem;
}
.credit { margin: 0.4rem 0 0.8rem; color: var(--ink); }
.admin-link {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.2rem;
}

/* Floating WhatsApp */
.wa-float {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  background: var(--wa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px #1fa85566;
  text-decoration: none;
}
.wa-float:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
.wa-float svg { width: 1.7rem; height: 1.7rem; fill: currentColor; }

/* Forms */
.form, .legal, .cuenta, .admin, .success-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.05rem 1.3rem;
}
.form h1, .legal h1, .cuenta h1, .admin h1, .page-title {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.8rem; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid #14141424;
  background: var(--paper);
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  min-height: 2.7rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--seal);
  border-color: var(--seal);
}
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.9rem;
  margin: 0.4rem 0 1rem;
}
.check input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; }
.class-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.7rem;
  margin: 0.2rem 0 0.3rem;
}
.error {
  background: #8e1b1214;
  color: var(--danger);
  border-radius: 0.7rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}
.hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 1rem; }

/* QR success */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0.8rem;
}
.qr-box .qr {
  width: 13rem;
  height: 13rem;
  background: #fff;
  padding: 0.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}
.qr-box .qr svg, .qr-box .qr img { width: 100%; height: 100%; }
.code-pill {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--art);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

/* Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.badge-ok { background: #1b6b3a1f; color: var(--ok); }
.badge-pend { background: #e6b32533; color: #7a5a00; }
.badge-moroso { background: #8e1b121f; color: var(--danger); }
.badge-ej { background: var(--art); color: var(--muted); text-transform: none; font-weight: 600; }

.state-card {
  border-radius: 1.4rem;
  padding: 1.3rem 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  background: var(--surface);
  text-align: center;
}
.state-card.ok { box-shadow: 0 0 0 3px var(--ok), var(--shadow); }
.state-card.pend { box-shadow: 0 0 0 3px var(--pending), var(--shadow); }
.state-card.moroso { box-shadow: 0 0 0 3px var(--danger), var(--shadow); }
.state-card .who { font-family: var(--font-display); font-size: 1.55rem; margin: 0.15rem 0 0.15rem; letter-spacing: -0.03em; }
.state-card .klass { color: var(--muted); margin: 0 0 0.8rem; }
.state-flag {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 1.1rem;
  padding: 1.1rem 0.8rem;
  margin: 0.4rem 0 1rem;
  color: #fff;
  font-family: var(--font-display);
}
.state-flag.ok { background: var(--ok); }
.state-flag.pend { background: var(--pending); color: #3a2c00; }
.state-flag.moroso { background: var(--danger); }
.state-flag .label { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.state-flag .amt { font-size: 1.15rem; font-variant-numeric: tabular-nums; margin-top: 0.2rem; }
.actions { display: flex; flex-direction: column; gap: 0.55rem; }

/* Admin */
.admin-tools {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.search {
  width: 100%;
  border: 1.5px solid #14141424;
  background: var(--paper);
  border-radius: 999px;
  padding: 0.7rem 1rem;
}
.filters, .admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.admin-tabs { margin-bottom: 1rem; }
.pill, .tab {
  border: 0;
  background: var(--art);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}
.pill.on, .tab.on { background: var(--seal); color: var(--surface); }
.total-owed {
  background: var(--seal);
  color: var(--surface);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
}
.total-owed span { font-family: var(--font-display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.student-list { display: flex; flex-direction: column; gap: 0.55rem; }
.student-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--paper);
  border-radius: 1rem;
  padding: 0.8rem 0.9rem;
}
.student-row .name { font-weight: 700; font-family: var(--font-display); }
.student-row .meta { font-size: 0.85rem; color: var(--muted); }
.student-row .right { text-align: right; flex-shrink: 0; }
.student-row .saldo { font-variant-numeric: tabular-nums; font-weight: 700; }

.history { list-style: none; margin: 1rem 0 0; padding: 0; }
.history li {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.history .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.history .cargo { color: var(--danger); }
.history .pago { color: var(--ok); }

/* Scanner */
.scanner {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.video-wrap {
  position: relative;
  background: #111;
  border-radius: 1.1rem;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 16rem;
}
.video-wrap video, .video-wrap canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-wrap canvas { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.scan-frame {
  position: absolute;
  inset: 18%;
  border: 3px solid #fff;
  border-radius: 1rem;
  box-shadow: 0 0 0 999px #00000055;
  pointer-events: none;
}
.manual { display: flex; gap: 0.45rem; }
.manual input { flex: 1; border: 1.5px solid #14141424; background: var(--paper); border-radius: 999px; padding: 0.7rem 1rem; }
.manual .btn { flex-shrink: 0; }

/* Carné print */
.carne-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.carne-sheet {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}
.carne {
  background: #fff;
  border: 1.5px solid #14141422;
  border-radius: 1rem;
  padding: 0.85rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.7rem;
  align-items: center;
  break-inside: avoid;
}
.carne .mark { width: 4.6rem; height: auto; }
.carne .qr { width: 6.2rem; height: 6.2rem; }
.carne .qr svg, .carne .qr img { width: 100%; height: 100%; }
.carne .who { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; margin: 0; letter-spacing: -0.02em; }
.carne .klass, .carne .code { margin: 0; font-size: 0.85rem; color: var(--muted); }
.carne .tag { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--seal); font-weight: 700; margin: 0; }

/* Legal */
.legal p { margin: 0 0 0.85rem; }
.legal h2 { font-size: 1.05rem; margin: 1.1rem 0 0.4rem; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #081c1acc;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}
.modal-card {
  background: var(--surface);
  border-radius: 1.3rem 1.3rem 1.1rem 1.1rem;
  width: min(28rem, 100%);
  padding: 1.15rem 1.1rem 1.2rem;
  max-height: 90dvh;
  overflow: auto;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 5.2rem;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  z-index: 70;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  max-width: 90vw;
}

body.menu-open, body.modal-open { overflow: hidden; }

@media (min-width: 640px) {
  .class-grid { grid-template-columns: 1fr 1fr; }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: center; }
  .carne-sheet { grid-template-columns: 1fr 1fr; }
  .video-wrap { aspect-ratio: 4 / 3; max-height: 420px; }
}
@media (min-width: 900px) {
  .class-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .wrap { padding: 1.75rem 1.5rem 2.5rem; }
  .visit { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
  .visit h2 { grid-column: 1 / -1; }
}

@media print {
  body { padding: 0; background: #fff; }
  .site-header, .site-footer, .wa-float, .carne-toolbar, .admin-tabs, .no-print { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .carne-sheet {
    grid-template-columns: 1fr 1fr;
    gap: 0.35in;
  }
  .carne {
    box-shadow: none;
    border: 1px solid #bbb;
    height: 3.2in;
    align-content: center;
  }
  @page { size: letter; margin: 0.5in; }
}
