:root {
  color-scheme: light;
  --fondo: #f7f5f2;
  --texto: #22201d;
  --texto-suave: #5c574f;
  --borde: #ddd6cc;
  --acento: #b5471b;
  --acento-suave: #f0e2d8;
  --core: #22201d;
  --opcional: #6b6357;
  --cierre: #b5471b;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  background: var(--fondo);
  color: var(--texto);
  margin: 0;
  padding: 0 1rem 4rem;
  line-height: 1.5;
}

.envoltorio {
  max-width: 640px;
  margin: 0 auto;
}

header.marca {
  padding: 2rem 0 1rem;
}
header.marca h1 {
  font-size: 1.5rem;
  margin: 0;
}
header.marca p {
  color: var(--texto-suave);
  margin: 0.25rem 0 0;
}

[hidden] { display: none !important; }

fieldset {
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
}
legend {
  font-weight: 600;
  padding: 0 0.4rem;
}

label.opcion {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  cursor: pointer;
}
label.opcion:hover { background: var(--acento-suave); }
label.opcion input { margin-top: 0.25rem; }
label.opcion .titulo { font-weight: 600; }
label.opcion .desc { color: var(--texto-suave); font-size: 0.9rem; }

input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  font-size: 1rem;
}

button {
  background: var(--acento);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
}
button:hover { opacity: 0.92; }
button.secundario {
  background: transparent;
  color: var(--acento);
  border: 1px solid var(--acento);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

.resumen-plan {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: #fff;
}
.resumen-plan .horas { font-size: 1.4rem; font-weight: 700; }

.bloque-titulo {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--texto-suave);
  margin: 1.5rem 0 0.5rem;
}

ul.lista-modulos {
  list-style: none;
  margin: 0;
  padding: 0;
}
li.modulo {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
}
li.modulo.completado { border-color: #8fae7c; background: #f3f8ef; }

.modulo-fila {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.modulo-fila input[type="checkbox"] { margin-top: 0.3rem; }
.modulo-info { flex: 1; }
.modulo-info .nombre { font-weight: 600; }
.modulo-info .meta { color: var(--texto-suave); font-size: 0.85rem; }

button.nombre-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--texto);
  text-align: left;
  cursor: pointer;
}
button.nombre-link:hover { color: var(--acento); text-decoration: underline; }

.contenido-md { margin-top: 1rem; }
.contenido-md h1 { font-size: 1.3rem; margin: 1.2rem 0 0.6rem; }
.contenido-md h2 { font-size: 1.1rem; margin: 1.6rem 0 0.6rem; }
.contenido-md h3 { font-size: 1rem; margin: 1.2rem 0 0.5rem; color: var(--acento); }
.contenido-md p { margin: 0 0 0.9rem; }
.contenido-md ul, .contenido-md ol { margin: 0 0 0.9rem; padding-left: 1.4rem; }
.contenido-md li { margin-bottom: 0.3rem; }
.contenido-md blockquote {
  margin: 0 0 0.9rem;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--acento);
  background: var(--acento-suave);
  color: var(--texto-suave);
}
.contenido-md code {
  background: var(--acento-suave);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.contenido-md hr { border: none; border-top: 1px solid var(--borde); margin: 1.5rem 0; }
.contenido-md table { width: 100%; border-collapse: collapse; margin: 0 0 0.9rem; font-size: 0.9rem; }
.contenido-md th, .contenido-md td { border: 1px solid var(--borde); padding: 0.4rem 0.6rem; text-align: left; }
.contenido-md th { background: #fff; }
.contenido-md strong { font-weight: 700; }

.franja-bloque.core .nombre::before { content: "core · "; color: var(--core); font-weight: 700; }
.franja-bloque.cierre .nombre::before { content: "cierre · "; color: var(--cierre); font-weight: 700; }

button.ver-por-que {
  background: none;
  border: none;
  color: var(--acento);
  padding: 0.2rem 0;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.desglose {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--acento-suave);
  border-radius: 8px;
  font-size: 0.85rem;
}
.desglose table { width: 100%; border-collapse: collapse; }
.desglose td { padding: 0.15rem 0.3rem; }
.desglose td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.desglose tr.total td { font-weight: 700; border-top: 1px solid var(--borde); }

.pospuestos-toggle {
  margin-top: 2rem;
  background: none;
  border: 1px dashed var(--borde);
  color: var(--texto-suave);
  width: 100%;
  border-radius: 10px;
  padding: 0.7rem;
}

.certificacion {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--borde);
  background: #fff;
}
.certificacion .barra {
  height: 8px;
  border-radius: 4px;
  background: var(--borde);
  overflow: hidden;
  margin: 0.35rem 0 0.9rem;
}
.certificacion .barra > div {
  height: 100%;
  background: var(--acento);
}

.error-form {
  color: var(--cierre);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.pie-acciones {
  margin-top: 2rem;
  text-align: center;
}
