/* =========================================================
   Roadmaps IRN Devs — mapa visual (tema claro legível)
   Classes mm-* (mapa mental) + rm-* (legado)
   ========================================================= */

/* ---- Badges compartilhados ---- */
.rm-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #F5F3FF;
  color: #5B21B6;
  border: 1px solid #E9E5FF;
  display: inline-block;
}
.rm-badge.time {
  color: #92400E;
  border-color: #FDE68A;
  background: #FFFBEB;
}
.rm-badge.level {
  color: #1E40AF;
  border-color: #BFDBFE;
  background: #EFF6FF;
}

.rm-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }

.rm-checklist { list-style: none; padding: 0; margin: 16px 0; }
.rm-checklist li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #E9E5FF;
  font-size: 14.5px;
  color: #0F0A1F;
}
.rm-checklist li::before {
  content: "☐";
  color: #7C3AED;
  font-size: 16px;
  line-height: 1.3;
  flex-shrink: 0;
}

/* =========================================================
   MAPA MENTAL (mm-*) — tronco central + ramos — TEMA CLARO
   ========================================================= */
.mm-map {
  --mm-accent: #7C3AED;
  --mm-accent2: #B45309;
  --mm-line: #CFC8E8;
  --mm-card: #FFFFFF;
  --mm-card-border: #E3DFF1;
  --mm-text: #0F0A1F;
  --mm-muted: #4A4560;
  --mm-surface: #F7F6FB;
  position: relative;
  margin: 28px 0 48px;
  padding: 16px 12px 28px;
  background: linear-gradient(180deg, #F7F6FB 0%, #FFFFFF 40%, #F7F6FB 100%);
  border: 1px solid #E3DFF1;
  border-radius: 16px;
}

/* Hub central no topo */
.mm-hub {
  position: relative;
  z-index: 2;
  max-width: 440px;
  margin: 0 auto 8px;
  text-align: center;
  background: linear-gradient(160deg, #FFFFFF 0%, #F5F3FF 100%);
  border: 2px solid #7C3AED;
  border-radius: 16px;
  padding: 18px 20px 16px;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1), 0 8px 28px rgba(109, 40, 217, 0.1);
}
.mm-hub-kicker {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #B45309;
  margin-bottom: 6px;
}
.mm-hub-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0F0A1F;
  line-height: 1.3;
  margin-bottom: 6px;
}
.mm-hub-sub {
  display: block;
  font-size: 13px;
  color: #2E2942;
  line-height: 1.45;
  margin-bottom: 10px;
}
.mm-hub-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Tronco vertical */
.mm-trunk {
  position: absolute;
  left: 50%;
  top: 110px;
  bottom: 40px;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #7C3AED, #C4B5FD 40%, #E9E5FF);
  border-radius: 2px;
  z-index: 0;
  pointer-events: none;
}
.mm-bus { display: none; }

/* Ramos (fases) */
.mm-branches {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 28px;
  padding: 0 4px;
}

.mm-branch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0;
}

/* Cabeçalho da fase */
.mm-branch-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1.5px solid #F59E0B;
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
  z-index: 2;
}
.mm-branch-head .num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F59E0B;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.mm-branch-head .t {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.mm-branch-head .t b {
  font-size: 14px;
  font-weight: 700;
  color: #0F0A1F;
  line-height: 1.2;
}
.mm-branch-head .t span {
  font-size: 11.5px;
  color: #4A4560;
}

/* Nós da fase */
.mm-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 4px 0 0;
  position: relative;
}

/* Nó (details/summary) */
.mm-node {
  background: #FFFFFF;
  border: 1.5px solid #E3DFF1;
  border-radius: 12px;
  min-width: 140px;
  max-width: 200px;
  flex: 1 1 140px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  list-style: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.mm-node::-webkit-details-marker { display: none; }
.mm-node > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  user-select: none;
  color: #0F0A1F;
}
.mm-node > summary::-webkit-details-marker { display: none; }
.mm-node > summary::after {
  content: "+";
  float: right;
  font-weight: 700;
  color: #7C3AED;
  font-size: 14px;
  line-height: 1.2;
}
.mm-node[open] > summary::after { content: "−"; }
.mm-node:hover {
  border-color: #C4B5FD;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.12);
  transform: translateY(-2px);
}
.mm-node.core {
  border-color: #7C3AED;
  background: #F5F3FF;
}
.mm-node.optional {
  border-style: dashed;
  border-color: #CFC8E8;
  opacity: 0.95;
}
.mm-node.done {
  border-color: #10B981;
  background: #ECFDF5;
}
.mm-node.done > summary::after {
  content: "✓";
  color: #059669;
}

.mm-node-name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #0F0A1F;
  line-height: 1.35;
  padding-right: 18px;
}
.mm-node-sub {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: #4A4560;
  margin-top: 4px;
  line-height: 1.35;
}

.mm-node-detail {
  padding: 0 14px 14px;
  font-size: 13px;
  color: #2E2942;
  line-height: 1.5;
  border-top: 1px solid #E9E5FF;
  margin-top: 0;
  padding-top: 10px;
  background: #FAFAFF;
}
.mm-node-detail p { margin: 0 0 8px; color: #2E2942; }
.mm-node-detail ul {
  margin: 6px 0 8px;
  padding-left: 1.15em;
  color: #2E2942;
}
.mm-node-detail li { margin-bottom: 4px; }
.mm-node-detail a {
  color: #6D28D9;
  font-weight: 600;
  text-decoration: none;
}
.mm-node-detail a:hover { text-decoration: underline; }

.mm-toggle-done {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #E3DFF1;
  background: #FFFFFF;
  color: #2E2942;
  cursor: pointer;
  transition: .15s ease;
}
.mm-toggle-done:hover {
  border-color: #7C3AED;
  color: #7C3AED;
  background: #F5F3FF;
}
.mm-node.done .mm-toggle-done {
  border-color: #10B981;
  color: #059669;
  background: #ECFDF5;
}

/* Legenda */
.rm-legend, .mm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 16px 0 8px;
  font-size: 12.5px;
  color: #4A4560;
}
.rm-legend i, .mm-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid #E3DFF1;
  background: #FFFFFF;
  margin-right: 6px;
  vertical-align: -1px;
}
.rm-legend i.core, .mm-legend i.core {
  border-color: #7C3AED;
  background: #F5F3FF;
}
.rm-legend i.optional, .mm-legend i.optional {
  border-style: dashed;
}
.rm-legend i.done, .mm-legend i.done {
  border-color: #10B981;
  background: #ECFDF5;
}

/* Barra de progresso */
.mm-progress {
  max-width: 420px;
  margin: 0 auto 20px;
  text-align: center;
}
.mm-progress-label {
  font-size: 12px;
  color: #4A4560;
  margin-bottom: 6px;
  font-family: ui-monospace, monospace;
}
.mm-progress-bar {
  height: 8px;
  background: #E9E5FF;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #E3DFF1;
}
.mm-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7C3AED, #10B981);
  border-radius: 999px;
  transition: width .35s ease;
}

/* ---- Legado rm-* ---- */
.rm-map { margin: 28px 0 40px; padding: 8px 0; }
.rm-phase { margin-bottom: 28px; }
.rm-phase-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 0 14px;
}
.rm-phase-title .num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F59E0B;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
}
.rm-nodes { display: flex; flex-wrap: wrap; gap: 10px; }
.rm-node {
  background: #FFFFFF;
  border: 1.5px solid #E3DFF1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0F0A1F;
  min-width: 120px;
  max-width: 220px;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.rm-node.core {
  border-color: #7C3AED;
  background: #F5F3FF;
}
.rm-node.optional {
  border-style: dashed;
  opacity: 0.95;
}
.rm-node .sub {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: #4A4560;
  margin-top: 4px;
}
.rm-connector {
  display: flex;
  justify-content: center;
  height: 20px;
  color: #C4B5FD;
  font-size: 18px;
}

/* Mobile */
@media (max-width: 700px) {
  .mm-trunk { left: 16px; transform: none; }
  .mm-hub { margin-left: 28px; max-width: none; text-align: left; }
  .mm-hub-meta { justify-content: flex-start; }
  .mm-branch-head { margin-left: 28px; margin-right: 0; }
  .mm-nodes { justify-content: flex-start; padding-left: 28px; }
  .mm-node { max-width: none; flex: 1 1 calc(50% - 10px); min-width: 120px; }
  .mm-progress { margin-left: 28px; max-width: none; }
  .mm-map { padding: 12px 8px 24px; }
}
@media (max-width: 420px) {
  .mm-node { flex: 1 1 100%; }
}

/* =========================================================
   Detalhamento por fase, tags e FAQ (mm-deep / mm-topic / mm-faq)
   ========================================================= */
.mm-tag,
.mm-topic-kind {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .02em;
  background: #EFEAFD;
  color: #5B21B6;
  border: 1px solid #DDD3FA;
  margin: 0 0 8px;
}
.mm-tag.essencial,
.mm-topic-kind.essencial { background: #EFEAFD; color: #5B21B6; }
.mm-tag.complementar,
.mm-topic-kind.complementar { background: #FEF3E2; color: #92400E; border-color: #F6DDB4; }

.mm-deep { margin: 16px 0 32px; }
.mm-deep h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 8px;
  font-size: 1.1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mm-deep h3 .n {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #7C3AED;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.mm-deep .phase-intro { margin: 0 0 12px; color: #4A4560; }
.mm-topic {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #E3DFF1;
  border-radius: 12px;
  min-width: 0;
}
.mm-topic h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.mm-topic h4 small { font-weight: 400; font-size: .85em; color: #4A4560; }
.mm-topic h4 .mm-topic-kind { margin: 0 0 0 auto; }
.mm-topic p { margin: 0; font-size: 14px; line-height: 1.55; color: #2E2942; }

.mm-faq { margin: 12px 0 32px; display: grid; gap: 8px; }
.mm-faq details {
  background: #fff;
  border: 1px solid #E3DFF1;
  border-radius: 12px;
  padding: 0;
  min-width: 0;
}
.mm-faq summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.mm-faq details[open] summary { border-bottom: 1px solid #E9E5FF; }
.mm-faq details p { margin: 0; padding: 10px 14px 14px; color: #2E2942; line-height: 1.55; }
.mm-node-detail .mm-tag { margin-bottom: 6px; }

@media (max-width: 420px) {
  .mm-topic h4 .mm-topic-kind { margin-left: 0; }
}
