/* Clases en vivo · Star Studio — misma línea de la marca: oscuro, violeta y acento amarillo */
:root {
  --bg: #07050d;
  --surface: #100d1c;
  --surface-2: #171329;
  --surface-3: #221c3c;
  --line: #2a2443;
  --fg: #f4f0ff;
  --muted: #a59cc0;
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --violet-soft: rgba(139, 92, 246, .14);
  --yellow: #facc15;
  --yellow-soft: rgba(250, 204, 21, .12);
  --ink: #14110a;
  --rec: #ff4d5e;
  --ok: #3ddc97;
  --display: "Montserrat", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radio: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 50vh at 85% -10%, rgba(139, 92, 246, .22), transparent 65%),
    radial-gradient(50vw 40vh at -10% 100%, rgba(139, 92, 246, .10), transparent 60%);
  pointer-events: none;
}
[hidden] { display: none !important; }
img, svg, iframe { max-width: 100%; }
a { color: var(--violet-2); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h1 em { font-style: normal; color: var(--yellow); }
p { margin: 0; }
code { font: 500 .88em var(--mono); background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
.contenedor { width: 100%; max-width: 960px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.tenue { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .9em; white-space: nowrap; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- marca ---------- */
.marca { display: inline-flex; align-items: center; gap: 10px; }
.marca svg { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--violet); fill: #fff; flex: none; }
.marca span { display: grid; line-height: 1.1; }
.marca b { font: 800 15px var(--display); letter-spacing: -.01em; }
.marca i { font: 500 11px var(--mono); font-style: normal; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  font: 700 15px var(--display); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn-primario { background: var(--yellow); color: var(--ink); }
.btn-primario:hover { filter: brightness(1.08); }
.btn-secundario { background: var(--violet-soft); color: var(--fg); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .5); }
.btn-secundario:hover { background: rgba(139, 92, 246, .24); }
.btn-grande { min-height: 56px; font-size: 16px; width: 100%; }
.btn-salir, .btn-peligro {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: 600 13px var(--body); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.btn-salir:hover { color: var(--fg); border-color: var(--violet); }
.btn-peligro { color: #ff8d98; border-color: rgba(255, 77, 94, .35); }
.btn-peligro:hover { background: rgba(255, 77, 94, .12); }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--violet-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.enlace:hover { color: var(--fg); }

/* ---------- formularios ---------- */
label { display: block; font: 600 13px var(--body); color: var(--muted); margin: 16px 0 6px; }
label small { font-weight: 400; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px;
  font: 500 16px var(--body); /* 16px evita el zoom automático en iPhone */
  transition: border-color .15s ease, box-shadow .15s ease;
  color-scheme: dark;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #6f678a; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
input[type=file] { padding: 10px; font-size: 14px; }
input[type=file]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--surface-3); color: var(--fg); font: 600 13px var(--body); cursor: pointer; }
.acepto { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 14px; font-weight: 400; color: var(--fg); cursor: pointer; }
.acepto input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--violet); flex: none; }
.ayuda { font-size: 13px; color: var(--muted); margin-top: 6px; }
.fila { display: grid; gap: 0 14px; }
.acciones { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- avisos ---------- */
.aviso {
  position: sticky; top: 0; z-index: 30; padding: 12px 16px; text-align: center;
  font: 600 14px var(--body); transition: opacity .4s ease, transform .4s ease;
}
.aviso-ok { background: #123b2c; color: #b8f5da; }
.aviso-error { background: #45141b; color: #ffc2c8; }
.aviso.fuera { opacity: 0; transform: translateY(-100%); pointer-events: none; position: absolute; left: 0; right: 0; }

/* ---------- acceso / registro ---------- */
.acceso { min-height: calc(100dvh - 48px); display: grid; place-items: center; padding: 24px 16px; }
.acceso-tarjeta {
  width: 100%; max-width: 420px; padding: 28px 22px 24px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 30px 80px -30px rgba(139, 92, 246, .45);
}
.sobre { margin-top: 26px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--violet-2); }
.acceso h1 { font-size: clamp(28px, 8vw, 36px); font-weight: 900; margin-top: 8px; }
.bajada { color: var(--muted); margin-top: 10px; font-size: 15px; }
.acceso form { margin-top: 8px; }
.acceso .btn { width: 100%; margin-top: 22px; min-height: 54px; }
.campo-tel { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.campo-tel:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.campo-tel span { display: grid; place-items: center; padding: 0 12px 0 14px; font: 500 15px var(--mono); color: var(--muted); border-right: 1px solid var(--line); }
.campo-tel input { border: 0; background: transparent; box-shadow: none !important; font: 700 20px var(--mono); letter-spacing: .04em; min-height: 56px; }
.nota { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.salir-mini { margin-top: 16px; text-align: center; font-size: 13px; }

/* ---------- barra ---------- */
.barra { position: sticky; top: 0; z-index: 20; background: rgba(7, 5, 13, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.barra-interior { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.barra-usuario { display: flex; align-items: center; gap: 8px; margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--violet-2); font: 800 13px var(--display); }
.barra-nombre { font-weight: 600; font-size: 14px; display: none; }

/* ---------- portal ---------- */
.portal { padding-top: 20px; padding-bottom: 40px; }
.hero {
  display: grid; gap: 22px; padding: 24px 20px;
  background: linear-gradient(135deg, #1d1438 0%, var(--surface-2) 55%, var(--surface) 100%);
  border: 1px solid rgba(139, 92, 246, .35); border-radius: 24px;
  position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(250, 204, 21, .16), transparent 70%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; min-width: 0; }
.hero h1 { font-size: clamp(26px, 7vw, 40px); font-weight: 900; margin-top: 12px; }
.hero-fecha { margin-top: 10px; font-weight: 600; color: var(--fg); }
.hero-fecha small { color: var(--muted); font-weight: 400; }
.hero-desc { margin-top: 10px; color: var(--muted); max-width: 52ch; }
.hero-nota { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; }
.hero-nota strong { color: var(--fg); }
.pastilla { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-2); font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.pastilla-vivo { background: rgba(255, 77, 94, .14); color: #ff9aa4; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: pulso 1.4s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: .35; transform: scale(.8); } }
.cuenta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.cuenta div { background: rgba(7, 5, 13, .55); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.cuenta b { display: block; font: 700 26px var(--mono); font-variant-numeric: tabular-nums; }
.cuenta span { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.lista { margin-top: 30px; }
.lista-cabeza { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lista-cabeza h2 { font-size: 20px; font-weight: 800; }
.conteo { font: 700 12px var(--mono); background: var(--surface-3); color: var(--violet-2); padding: 3px 9px; border-radius: 999px; }
.vacio { padding: 28px 20px; border: 1px dashed var(--line); border-radius: var(--radio); color: var(--muted); text-align: center; }
.vacio strong { color: var(--fg); }
.vacio p + p { margin-top: 6px; font-size: 14px; }

.clase { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); margin-bottom: 12px; overflow: hidden; transition: border-color .2s ease; }
.clase[open] { border-color: rgba(139, 92, 246, .45); }
.clase summary { list-style: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.clase summary::-webkit-details-marker { display: none; }
.clase-fecha { width: 48px; height: 52px; border-radius: 12px; background: var(--surface-3); display: grid; place-content: center; text-align: center; line-height: 1; }
.clase-fecha b { font: 800 19px var(--display); }
.clase-fecha span { font: 500 10px var(--mono); text-transform: uppercase; color: var(--violet-2); margin-top: 3px; }
.clase-titulo { min-width: 0; display: grid; gap: 3px; }
.clase-titulo strong { font: 700 16px/1.25 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.clase-titulo small { color: var(--muted); font-size: 13px; }
.flecha { width: 22px; height: 22px; color: var(--muted); transition: transform .2s ease; }
.clase[open] .flecha { transform: rotate(180deg); }
.clase summary .etiqueta { grid-column: 2; justify-self: start; grid-row: 2; margin-top: -4px; }
.clase summary .flecha { grid-column: 3; grid-row: 1; }
.etiqueta { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.etiqueta-proxima { background: var(--yellow-soft); color: var(--yellow); }
.etiqueta-en_vivo { background: rgba(255, 77, 94, .16); color: #ff9aa4; }
.etiqueta-grabada { background: var(--violet-soft); color: var(--violet-2); }
.etiqueta-finalizada { background: var(--surface-3); color: var(--muted); }
.clase-cuerpo { padding: 4px 14px 20px; border-top: 1px solid var(--line); }
.clase-cuerpo > .btn { margin-top: 16px; width: 100%; }
.clase-cuerpo h3 { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--violet-2); margin: 24px 0 10px; }
.clase-desc { margin-top: 14px; color: var(--muted); }
.pendiente { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.prosa { color: #d9d2ee; overflow-wrap: anywhere; }
.prosa p { margin: 0 0 10px; }
.prosa h4 { font-size: 16px; font-weight: 800; color: var(--fg); margin: 18px 0 8px; }
.prosa h4:first-child { margin-top: 0; }
.prosa ul { margin: 0 0 12px; padding-left: 20px; }
.prosa li { margin-bottom: 6px; }
.prosa li::marker { color: var(--yellow); }
.prosa strong { color: var(--fg); }
.resumen { background: var(--surface-2); border-radius: 14px; padding: 16px; }
.resumen > :last-child { margin-bottom: 0; }

.materiales { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.material { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; min-height: 60px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; color: var(--fg); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.material:hover { border-color: var(--violet); background: var(--surface-3); }
.material > svg { width: 22px; height: 22px; color: var(--yellow); }
.material-icono { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet-2); font: 700 10px var(--mono); }
.material-skill .material-icono { background: var(--yellow-soft); color: var(--yellow); }
.material-texto { min-width: 0; display: grid; gap: 2px; }
.material-texto strong { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.material-texto small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

.pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 18px; padding-bottom: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- pop-up ---------- */
.modal { width: min(560px, calc(100vw - 24px)); max-height: min(86dvh, 720px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface-2); color: var(--fg); overflow: hidden; }
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(7, 5, 13, .78); backdrop-filter: blur(4px); }
.modal-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px 22px; border-bottom: 1px solid var(--line); }
.modal-cabeza h2 { font-size: 18px; font-weight: 800; }
.modal-cerrar { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--fg); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-cuerpo { padding: 18px 22px; overflow-y: auto; font-size: 15px; -webkit-overflow-scrolling: touch; }
.modal-pie { padding: 14px 18px; border-top: 1px solid var(--line); }
.modal-pie .btn { width: 100%; }

/* ---------- administrador ---------- */
.admin { padding-top: 18px; padding-bottom: 56px; }
.admin h1 { font-size: 26px; font-weight: 900; margin: 6px 0 16px; }
.admin h2 { font-size: 18px; font-weight: 800; }
.pestanas { display: flex; gap: 6px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 20px; overflow-x: auto; }
.pestanas a { flex: 1; text-align: center; padding: 10px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font: 700 14px var(--display); white-space: nowrap; }
.pestanas a[aria-current] { background: var(--violet); color: #fff; }
.titulo-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.titulo-fila h1 { margin: 0; }
.volver a { color: var(--muted); text-decoration: none; font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 18px 16px; margin-bottom: 16px; }
.panel > h2 + .ayuda { margin-bottom: 8px; }
.formulario > label:first-of-type { margin-top: 4px; }
.subir { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.zona-peligro { margin-top: 28px; text-align: center; }
.materiales-admin li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.materiales-admin { margin-top: 14px; }
.cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.cifras div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.cifras b { display: block; font: 800 24px var(--display); }
.cifras span { color: var(--muted); font-size: 12px; }

.admin-clases { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.admin-clases a { display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); color: var(--fg); text-decoration: none; transition: border-color .15s ease; }
.admin-clases a:hover { border-color: var(--violet); }
.admin-clases .etiqueta { justify-self: start; }
.chequeo { display: flex; flex-wrap: wrap; gap: 6px; }
.chequeo span { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chequeo .si { border-color: rgba(61, 220, 151, .4); color: var(--ok); }
.chequeo .si::before { content: "✓ "; }
.chequeo .no::before { content: "○ "; }

/* tabla → tarjetas en celular */
.tabla-envoltura { padding: 0; overflow: hidden; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla thead { display: none; }
.tabla tr { display: grid; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tabla tr:last-child { border-bottom: 0; }
.tabla td { display: flex; justify-content: space-between; gap: 12px; padding: 0; text-align: right; overflow-wrap: anywhere; }
.tabla td::before { content: attr(data-t); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
.tabla td:first-child { display: grid; text-align: left; font-size: 15px; }
.tabla td:first-child::before { display: none; }
.tabla td small { color: var(--muted); font-weight: 400; }
.tabla tr.inactivo { opacity: .5; }
.celda-acciones { justify-content: flex-start !important; gap: 8px; margin-top: 6px; }
.celda-acciones::before { display: none; }
.celda-acciones form { margin: 0; }

/* ---------- escritorio ---------- */
@media (min-width: 720px) {
  .contenedor { padding-left: 28px; padding-right: 28px; }
  .barra-nombre { display: inline; }
  .barra-interior { min-height: 68px; }
  .acceso-tarjeta { padding: 40px 36px 32px; }
  .fila { grid-template-columns: 1fr 1fr; }
  .portal { padding-top: 32px; }
  .hero { grid-template-columns: 1.3fr 1fr; align-items: center; padding: 40px; gap: 36px; }
  .clase summary { grid-template-columns: auto 1fr auto auto; padding: 18px 20px; gap: 16px; }
  .clase summary .etiqueta { grid-column: 3; grid-row: 1; margin: 0; }
  .clase summary .flecha { grid-column: 4; }
  .clase-cuerpo { padding: 6px 20px 26px; }
  .clase-cuerpo > .btn { width: auto; }
  .materiales { grid-template-columns: 1fr 1fr; }
  .materiales-admin { grid-template-columns: 1fr; }
  .panel { padding: 24px; }
  .admin-clases a { grid-template-columns: 1.4fr 1.6fr auto; align-items: center; }
  .pestanas { display: inline-flex; }
  .pestanas a { flex: none; padding: 10px 22px; }
  .tabla thead { display: table-header-group; }
  .tabla tr { display: table-row; }
  .tabla th { text-align: left; padding: 12px 16px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
  .tabla td, .tabla td:first-child { display: table-cell; padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .tabla tr:last-child td { border-bottom: 0; }
  .tabla td::before { display: none; }
  .tabla td small { display: block; }
  .celda-acciones { white-space: nowrap; }
  .celda-acciones form { display: inline-block; margin-left: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
