/* Estilos de la comunidad (paso 9, DC19, DC27): los de la muestra v2 aprobada (DC48 a DC58), por variables. Los colores,
   las letras y las pilas de letras (--letra-cuerpo, --letra-titulos) los pone la marca en un <style> del <head>
   (src/comunidad/marcas/index.ts); acá no va ningún color en hex. Seis tamaños de letra: 14, 16, 17, 20, 28 y 32 px (más 22 px para las flechas ‹ y ›). */
:root {
  --sombra: 0 1px 2px color-mix(in srgb, var(--texto) 8%, transparent), 0 4px 12px color-mix(in srgb, var(--texto) 6%, transparent);
  /* La estrella de Centro Sabama como contorno, para los adornos hechos con CSS (DC48). */
  --estrella: polygon(50.0% 0.0%, 53.5% 9.0%, 57.8% 17.2%, 62.9% 24.6%, 68.8% 31.3%, 75.4% 37.1%, 82.8% 42.2%, 91.0% 46.5%, 100.0% 50.0%, 91.0% 53.5%, 82.8% 57.8%, 75.4% 62.9%, 68.8% 68.8%, 62.9% 75.4%, 57.8% 82.8%, 53.5% 91.0%, 50.0% 100.0%, 46.5% 91.0%, 42.2% 82.8%, 37.1% 75.4%, 31.3% 68.8%, 24.6% 62.9%, 17.2% 57.8%, 9.0% 53.5%, 0.0% 50.0%, 9.0% 46.5%, 17.2% 42.2%, 24.6% 37.1%, 31.3% 31.3%, 37.1% 24.6%, 42.2% 17.2%, 46.5% 9.0%);
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font-family: var(--letra-cuerpo); font-size: 1.0625rem; line-height: 1.6; overflow-wrap: break-word;
}
a { color: var(--enlace); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* ---------- La cáscara de la comunidad ---------- */
.saltar { position: absolute; left: 16px; top: -100px; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--superficie); color: var(--texto); font-weight: 600; }
.saltar:focus { top: 64px; }
.app { min-height: 100dvh; }
.cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 16px; }
.marca { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; }
.logo { display: block; width: auto; height: 48px; }
.nombre-marca { margin-left: 10px; font-weight: 600; color: var(--texto); }
/* En el celular, si no entra, que corte parejo después de la coma ("Tu consultorio, / tu empresa"). */
@media (max-width: 600px) { .nombre-marca { line-height: 1.2; text-wrap: balance; } }
.estrella { width: 13px; height: 18px; margin-top: -6px; color: var(--dorado); flex: none; }
.principal { padding: 8px 16px 32px; max-width: 40rem; }
.con-menu .principal { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.pie { padding: 16px 0 0; margin-top: 32px; border-top: 1px solid var(--linea); font-size: 0.875rem; }

.sola .cabeza { justify-content: center; padding-top: 24px; }
.sola .principal { margin: 0 auto; max-width: 28rem; }
/* Acerca de sin sesión, como Skool (22/11): el encabezado a lo ancho, con el logo a la izquierda y "Entrar" a la derecha. */
.publica .cabeza { justify-content: space-between; padding: 8px 16px; background: var(--superficie); border-bottom: 1px solid var(--linea); }
@media (min-width: 768px) {
  .publica .cabeza { min-height: 72px; padding-inline: max(24px, calc(50% - 34.5rem)); }
  .publica .nombre-marca { font-size: 1.125rem; }
}

@media (min-width: 768px) {
  h1 { font-size: 2rem; }
  .sola .principal { padding-top: 24px; }
}

/* ---------- Texto ---------- */
h1, h2, h3 { font-family: var(--letra-titulos); font-weight: 600; letter-spacing: -0.01em; margin: 0; color: var(--texto); }
h1 { font-size: 1.75rem; line-height: 1.25; margin-bottom: 16px; }
h2 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 8px; }
h3 { font-size: 1.0625rem; line-height: 1.4; margin-bottom: 4px; }
.chico { font-size: 0.875rem; line-height: 1.5; color: var(--texto-2); }
.bajada { color: var(--texto-2); }
.texto-largo h2 { margin-top: 2rem; }
.etiqueta {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--superficie); border: 1px solid var(--dorado);
  color: var(--etiqueta); font-size: 0.875rem; line-height: 1.4; font-weight: 600; letter-spacing: 0.02em;
}
.bloque { margin-top: 32px; }
/* Todo lo que se toca mide 44 px o más (§6), también los enlaces sueltos. */
/* Con :where la regla pesa poco: las listas con su propio diseño (espacios, lecciones, filas) la pisan. */
:where(.principal) a:not([class]), .pie a { display: inline-flex; align-items: center; min-height: 44px; }
.miga { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 4px; font-weight: 600; text-decoration: none; }
.miga span { font-size: 1.375rem; line-height: 1; }

/* ---------- Botones ---------- */
.boton, .boton-2, .pastilla {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, transform 200ms ease-out;
}
.boton { border: 0; background: var(--accion); color: var(--accion-texto); }
.boton-2 { border: 1.5px solid var(--accion); background: var(--superficie); color: var(--accion); }
.pastilla { border: 0; background: var(--acento); color: var(--accion-texto); }
.boton:active { background: var(--enlace); transform: scale(0.97); }
.boton-2:active { background: var(--superficie-calida); transform: scale(0.97); }
.pastilla:active { transform: scale(0.97); }
/* Las filas y los enlaces que se tocan también responden (M14). */
.lecciones a:active, .filas a:active, .filas button:active, .navegacion-leccion .siguiente:active { background: var(--superficie-calida); }
@media (hover: hover) {
  .boton:hover { background: var(--enlace); }
  .boton-2:hover { background: var(--superficie-calida); }
  a.tarjeta:hover { box-shadow: 0 1px 2px color-mix(in srgb, var(--texto) 10%, transparent), 0 6px 16px color-mix(in srgb, var(--texto) 12%, transparent); }
}
@media (max-width: 480px) {
  /* En el celular, el botón principal va de lado a lado: se alcanza con el pulgar sin apuntar. */
  .boton, .pastilla, .sola .boton-2 { width: 100%; }
}
/* En la compu, el botón mide lo que dice (también "Siguiente", M9). */
@media (min-width: 481px) { .navegacion-leccion .boton { align-self: flex-start; } }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.boton-chico { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; transition: transform 200ms ease-out; }
.boton-chico:active { background: var(--superficie-calida); transform: scale(0.97); }
.boton-chico[disabled] { color: var(--texto-2); border-color: var(--linea); cursor: default; }

/* ---------- Tarjetas y cursos ---------- */
.tarjeta { display: block; padding: 20px; border-radius: 12px; background: var(--superficie); box-shadow: var(--sombra); color: var(--texto); text-decoration: none; }
.tarjeta + .tarjeta { margin-top: 12px; }
a.tarjeta:active { background: var(--superficie-calida); box-shadow: none; }
.tarjeta.calida { background: var(--superficie-calida); box-shadow: none; border: 1px solid var(--linea); }
.tarjeta p:last-child { margin-bottom: 0; }
.con-portada { padding: 0; overflow: hidden; }
.con-portada .cuerpo { padding: 16px 20px 20px; }
.portada { position: relative; height: 48px; background: var(--texto); overflow: hidden; }
.portada::after { content: ""; position: absolute; right: 8px; bottom: -28px; width: 60px; height: 82px; background: var(--dorado); clip-path: var(--estrella); }
.portada.p2 { background: var(--accion); }
.portada.p3 { background: var(--acento); }
.portada.p4 { background: var(--etiqueta); }
.portada.p4::after { background: var(--superficie-calida); }
.tarjeta.cerrada { box-shadow: none; border: 1.5px dashed var(--borde); background: var(--superficie); }
.tarjeta.cerrada .portada { display: none; }
.candado { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--texto-2); font-size: 0.875rem; font-weight: 600; }
.icono-candado { width: 16px; height: 16px; flex: none; color: var(--texto-2); }
.caja-candado { padding: 20px; border-radius: 12px; background: var(--superficie-calida); border: 1px solid var(--linea); }
.caja-candado .candado { margin: 0 0 8px; color: var(--texto); }
.caja-candado p { margin-bottom: 12px; }
.precio { font-size: 1.25rem; font-weight: 600; }
.avance { margin: 8px 0 0; font-size: 0.875rem; color: var(--texto-2); }
.avance progress, .barra-avance { display: block; width: 100%; height: 6px; margin-top: 6px; border: 0; border-radius: 999px; background: var(--linea); appearance: none; -webkit-appearance: none; overflow: hidden; }
.avance progress::-webkit-progress-bar, .barra-avance::-webkit-progress-bar { background: var(--linea); border-radius: 999px; }
.avance progress::-webkit-progress-value, .barra-avance::-webkit-progress-value { background: var(--accion); border-radius: 999px; }
.avance progress::-moz-progress-bar, .barra-avance::-moz-progress-bar { background: var(--accion); border-radius: 999px; }
.avance-arriba { margin: 0 0 12px; }

.seccion-curso { margin-top: 28px; }
.lecciones { margin-top: 8px; border-radius: 12px; background: var(--superficie); box-shadow: var(--sombra); }
.lecciones li { list-style: none; border-top: 1px solid var(--linea); }
.lecciones li:first-child { border-top: 0; }
.lecciones a { display: grid; grid-template-columns: 24px 1fr; gap: 14px; align-items: center; min-height: 64px; padding: 12px 16px; color: var(--texto); text-decoration: none; }
.lecciones .nombre-leccion { display: block; font-weight: 600; }
.lecciones .meta { display: flex; gap: 12px; font-size: 0.875rem; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.vista-texto { color: var(--texto); font-weight: 600; }
.cabeza-leccion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; }
.avance-chico { font-size: 0.875rem; color: var(--texto-2); }
.marca-leccion { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--borde); }
.marca-leccion.vista { width: 18px; height: 24px; margin: 0 3px; border: 0; border-radius: 0; background: var(--dorado); clip-path: var(--estrella); }

.caja-video {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  width: 100%; aspect-ratio: 16 / 9; margin: 4px 0 24px; border-radius: 12px; overflow: hidden;
  background: var(--texto); color: var(--accion-texto); text-decoration: none; font-weight: 600;
}
/* El reproductor de Stream llena la caja (18/11: sin esto quedaba en 300 × 150, el tamaño por defecto de un iframe). */
.caja-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Con portada (22/11, como Skool): la imagen llena la caja y encima va un círculo grande con el triángulo, al centro a lo
   ancho, en la lección, en Acerca de y en las publicaciones. A lo alto va más abajo que en Skool, al 80 %: con el
   encuadre del curso la cara de Vivi queda en el centro y el círculo la tapaba (medido en 6 lecciones, también a los
   5 s); así queda sobre el pecho. "Ver el video" queda para el lector de pantalla (es el nombre del enlace) y los chips
   suben a las esquinas de arriba. La portada es el cuadro de los 5 s (`urlDelReproductor`). */
.caja-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.caja-video:has(img) .reproducir { position: absolute; left: 50%; top: 80%; translate: -50% -50%; width: 84px; height: 84px; box-shadow: 0 4px 16px color-mix(in srgb, var(--texto) 35%, transparent); }
.caja-video:has(img) .reproducir::after { border-width: 15px 0 15px 24px; margin-left: 7px; }
.caja-video:has(img) .reproducir + span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.caja-video:has(img) .chip-video { top: 10px; bottom: auto; }
@media (max-width: 600px) {
  .caja-video:has(img) .reproducir { width: 56px; height: 56px; }
  .caja-video:has(img) .reproducir::after { border-width: 11px 0 11px 17px; margin-left: 5px; }
}
@media (hover: hover) and (pointer: fine) { a.caja-video:hover .reproducir { transform: scale(1.06); } }
@media (prefers-reduced-motion: no-preference) { .caja-video .reproducir { transition: transform 160ms ease-out; } }
.caja-video .reproducir { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accion-texto); }
.caja-video .reproducir::after { content: ""; width: 0; height: 0; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--texto); }
.chip-video { position: absolute; bottom: 10px; padding: 2px 10px; border-radius: 999px; background: var(--superficie); color: var(--texto); font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip-video.izq { left: 10px; }
.chip-video.der { right: 10px; }
.recuadro-prueba { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; margin: 0 0 12px; border-radius: 12px; border: 2px dashed var(--borde); background: var(--superficie); color: var(--texto-2); font-weight: 600; }
.preparando { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; margin: 0 0 12px; border-radius: 12px; background: var(--superficie-calida); color: var(--texto-2); }
.enlaces { margin-top: 24px; padding: 16px 20px; border-radius: 12px; background: var(--superficie); box-shadow: var(--sombra); }
.enlaces li { list-style: none; }
.ya-vista { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; font-weight: 600; }
.ya-vista::before { content: ""; width: 15px; height: 20px; background: var(--dorado); clip-path: var(--estrella); }
.navegacion-leccion { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; }
.navegacion-leccion .siguiente { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 20px; border-radius: 12px; background: var(--superficie); box-shadow: var(--sombra); color: var(--texto); text-decoration: none; font-weight: 600; }
.navegacion-leccion .flecha { color: var(--texto-2); font-size: 1.375rem; line-height: 1; }
.navegacion-leccion .anterior { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

/* ---------- Formularios ---------- */
.formulario { margin-top: 16px; }
.campo { margin-bottom: 20px; }
.campo label, .campo legend { display: block; margin-bottom: 6px; padding: 0; font-weight: 600; }
.campo input[type="text"], .campo input[type="email"], .campo input[type="tel"], .campo input[type="number"], .campo input[type="url"], .campo input[type="date"], .campo input[type="time"], .campo input[type="search"], .campo select, .campo textarea {
  display: block; width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--borde); background: var(--superficie); transition: border-color 150ms ease-out;
}
.campo textarea { min-height: 120px; resize: vertical; }
.campo textarea.texto-leccion { min-height: 14rem; }
.campo input.campo-codigo { min-height: 60px; padding-left: calc(14px + 0.4em); font-size: 1.75rem; font-weight: 600; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.campo input[type="file"] { display: block; max-width: 100%; padding: 4px 0; }
.campo input[type="file"]::file-selector-button { min-height: 44px; margin-right: 12px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--accion); background: var(--superficie); color: var(--accion); font: inherit; font-weight: 600; cursor: pointer; }
.campo .ayuda { margin: 6px 0 0; font-size: 0.875rem; color: var(--texto-2); }
.campo :is(input, select, textarea)[aria-invalid="true"] { border: 2px solid var(--error); }
/* El error de un campo, junto a él y con role="alert" (§6). */
.alerta { margin: 6px 0 0; color: var(--error); font-size: 0.875rem; font-weight: 600; }
fieldset.campo { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.opcion { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; }
.campo .opcion { display: flex; margin: 0; font-weight: 400; }
.opcion input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accion); flex: none; }
.ensayo { padding: 12px 16px; border-radius: 10px; border: 1px dashed var(--borde); background: var(--superficie); font-size: 0.875rem; }
.ensayo strong { font-size: 1.25rem; letter-spacing: 0.12em; }
.aviso { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; margin-bottom: 20px; border-radius: 12px; background: var(--superficie); box-shadow: var(--sombra); border-left: 4px solid var(--dorado); }
.aviso p { margin: 0; font-weight: 600; }

/* ---------- Equipo ---------- */
.estado { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.875rem; font-weight: 700; color: var(--texto); background: var(--superficie-calida); }
.vacio { color: var(--texto-2); }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.elegir-video { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.elegir-video .ayuda, .elegir-video progress, .elegir-video p { flex: 1 0 100%; margin: 0; }
.elegir-video .oculto:focus-visible + label { outline: 3px solid var(--foco); outline-offset: 2px; }
.elegir-video .oculto:disabled + label { opacity: 0.45; pointer-events: none; }
.nombre-archivo { font-size: 0.875rem; color: var(--texto-2); overflow-wrap: anywhere; }
#estado-subida:empty { display: none; }
.estado-video { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.estado-video::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--borde); flex: none; }
.estado-video.ok::before { background: var(--accion); }
.estado-video.error { color: var(--error); }
.estado-video.error::before { background: var(--error); }

/* ---------- Mi cuenta ---------- */
.chip-estado { display: inline-block; margin: 0 0 12px; padding: 2px 12px; border-radius: 999px; background: var(--texto); color: var(--accion-texto); font-size: 0.875rem; font-weight: 600; }
.chip-estado.vencida { background: var(--acento); }
.filas { margin-top: 16px; border-radius: 12px; background: var(--superficie); box-shadow: var(--sombra); }
.filas li { list-style: none; border-top: 1px solid var(--linea); }
.filas li:first-child { border-top: 0; }
.filas a, .filas button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; background: none; text-align: left; color: var(--texto); font-weight: 600; text-decoration: none; cursor: pointer; }
.filas .flecha { color: var(--texto-2); font-size: 1.375rem; line-height: 1; }

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

/* La cara (Miembros, Mapa, Clasificación y costado, 21/11): foto redonda o iniciales; el número de nivel (lo suma Clasificación) va abajo a la derecha. */
.cara { position: relative; display: inline-flex; flex: none; align-self: flex-start; height: max-content; }
.cara .iniciales, .foto-perfil { width: 48px; height: 48px; border-radius: 50%; }
.foto-perfil { display: block; object-fit: cover; border: 1px solid var(--linea); background: var(--superficie-calida); }
.cara-chica .iniciales, .cara-chica .foto-perfil { width: 32px; height: 32px; font-size: 0.75rem; }
/* El número de nivel como la chapita de Skool (22/11): chico, en la esquina de abajo a la derecha, apenas afuera del
   círculo y con un borde del color de la tarjeta, así no tapa las iniciales. */
.nivel-cara { position: absolute; right: -5px; bottom: -3px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; box-shadow: 0 0 0 2px var(--superficie); background: var(--accion); color: var(--accion-texto); font-size: 0.6875rem; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.cara-chica .nivel-cara { right: -4px; bottom: -2px; min-width: 15px; height: 15px; padding: 0 3px; font-size: 0.625rem; }
