/* =====================================================================
   camino.css — Camino de la Diplomatura
   Usa la paleta común de ../assets/sitio.css (variables --s-*).
   IMPORTANTE: los nombres de clases e ids los usa js/camino.js.
   Si cambiás estilos, no renombres selectores.
   ===================================================================== */

:root {
  --bg-main: var(--s-bg);
  --bg-card: var(--s-surface);
  --bg-header: rgba(255, 255, 255, 0.94);
  --text-primary: var(--s-ink);
  --text-muted: var(--s-muted);

  /* Estados del camino (nombres históricos, valores sobrios) */
  --duo-green: var(--s-success);
  --duo-green-shadow: #23633e;
  --duo-blue: var(--s-primary);
  --duo-blue-shadow: var(--s-primary-hover);
  --duo-gold: var(--s-warn);
  --duo-gold-shadow: #7a5405;
  --duo-purple: var(--s-violet);
  --duo-purple-shadow: #463a7c;
  --duo-locked: #e3e7ec;
  --duo-locked-shadow: #cdd3da;
  --duo-locked-text: var(--s-faint);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--s-font);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Barra superior */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--s-line);
}

.top-bar-inner {
  max-width: 1480px;
  width: 96%;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: var(--s-primary);
  color: #fff;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: var(--s-radius);
  font-size: 0.85rem;
}

.brand h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--s-warn-soft);
  border: 1px solid #ecdcb0;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--s-warn);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--s-surface-2);
  border: 1px solid var(--s-line);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--s-ink);
}

#link-admin.hidden,
.user-pill.hidden {
  display: none;
}

.btn-mini-link {
  background: var(--s-surface);
  border: 1px solid var(--s-line-strong);
  color: var(--s-primary);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}

/* Modal de ingreso por DNI */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-modal.hidden {
  display: none;
}

.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 36, 48, 0.55);
  backdrop-filter: blur(4px);
}

.login-modal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: var(--s-surface);
  border: 1px solid var(--s-line);
  border-radius: var(--s-radius-lg);
  padding: 28px 26px;
  box-shadow: var(--s-shadow-lg);
  text-align: center;
}

.login-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--s-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.login-modal-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.login-field {
  text-align: left;
  margin-bottom: 14px;
}

.login-field.hidden {
  display: none;
}

.login-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--s-ink);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  background: var(--s-surface);
  border: 1px solid var(--s-line-strong);
  color: var(--s-ink);
  padding: 11px 13px;
  border-radius: var(--s-radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
  border-color: var(--s-primary);
  box-shadow: 0 0 0 3px var(--s-primary-soft);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--s-muted);
  font-weight: 400;
}

.login-error {
  background: var(--s-danger-soft);
  border: 1px solid #ecc3bf;
  color: var(--s-danger);
  padding: 10px 12px;
  border-radius: var(--s-radius);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 14px;
  text-align: left;
}

.login-error.hidden {
  display: none;
}

.btn-login-primary {
  width: 100%;
  background: var(--s-primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--s-radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-login-primary:hover {
  background: var(--s-primary-hover);
}

.btn-login-primary:disabled {
  background: var(--duo-locked);
  color: var(--duo-locked-text);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--s-surface);
  color: var(--s-ink);
  border: 1px solid var(--s-line-strong);
  padding: 7px 13px;
  border-radius: var(--s-radius);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  background: var(--s-surface-2);
}

.btn-secondary:active {
  transform: translateY(1px);
}

/* Contenedor del camino */
.path-wrapper {
  max-width: 1120px;
  width: 94%;
  margin: 0 auto;
  padding: 105px 20px 90px;
}

.path-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  position: relative;
}

/* Meta superior: Trofeo de la Diplomatura */
.goal-banner {
  width: 100%;
  background: var(--s-surface);
  border: 1px solid #ecdcb0;
  border-top: 4px solid var(--s-warn);
  box-shadow: var(--s-shadow);
  border-radius: var(--s-radius-lg);
  padding: 26px 24px;
  text-align: center;
  position: relative;
}

.goal-banner.locked {
  border-color: var(--s-line);
  border-top-color: var(--s-line-strong);
  box-shadow: var(--s-shadow-sm);
}

.goal-trophy {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--s-warn-soft);
  border: 1px solid #ecdcb0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.goal-banner.locked .goal-trophy {
  background: var(--s-surface-2);
  border-color: var(--s-line);
  filter: grayscale(1);
  opacity: 0.6;
}

.goal-tag {
  display: inline-block;
  background: var(--s-warn-soft);
  color: var(--s-warn);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.goal-banner.locked .goal-tag {
  background: var(--s-surface-2);
  color: var(--s-muted);
}

.goal-banner h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.goal-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Punto de partida abajo de todo */
.start-banner {
  background: var(--s-surface);
  border: 1px solid var(--s-line);
  border-left: 4px solid var(--s-success);
  box-shadow: var(--s-shadow-sm);
  border-radius: var(--s-radius-lg);
  padding: 14px 24px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  color: var(--s-ink);
}

/* Bloques de cada Clase */
.class-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  position: relative;
}

.class-header-card {
  width: 100%;
  border-radius: var(--s-radius-lg);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--s-surface);
  border: 1px solid var(--s-line);
  border-left: 4px solid var(--s-primary);
  box-shadow: var(--s-shadow-sm);
  color: var(--s-ink);
}

.class-section.completed-class .class-header-card {
  border-left-color: var(--s-success);
}

.class-section.locked-class .class-header-card {
  background: var(--s-surface-2);
  border-left-color: var(--s-line-strong);
  box-shadow: none;
  color: var(--duo-locked-text);
}

.class-header-info .class-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--s-primary);
  background: var(--s-primary-soft);
  padding: 2px 9px;
  border-radius: var(--s-radius-sm);
  margin-bottom: 5px;
}

.class-section.completed-class .class-pill {
  color: var(--s-success);
  background: var(--s-success-soft);
}

.class-section.locked-class .class-pill {
  color: var(--s-muted);
  background: var(--s-surface);
}

.class-header-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.class-status-badge {
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--s-primary-soft);
  color: var(--s-primary);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.class-section.completed-class .class-status-badge {
  background: var(--s-success-soft);
  color: var(--s-success);
}

.class-section.locked-class .class-status-badge {
  background: var(--s-surface);
  color: var(--duo-locked-text);
}

/* Lista de nodos en orden ascendente (abajo hacia arriba dentro de cada clase) */
.nodes-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  width: 100%;
  padding: 12px 0;
  position: relative;
}

/* Envoltorio de cada nodo con desplazamiento zig-zag */
.node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease;
}

.node-wrapper.offset-left {
  transform: translateX(-56px);
}

.node-wrapper.offset-right {
  transform: translateX(56px);
}

.node-wrapper.offset-center {
  transform: translateX(0);
}

/* Conector vertical hacia el nodo de arriba */
.node-connector {
  width: 3px;
  height: 32px;
  border-radius: 999px;
  background: var(--s-line-strong);
  margin-bottom: -8px;
}

.node-connector.completed {
  background: var(--s-node-done);
}

.node-connector.active {
  background: linear-gradient(to top, var(--s-success), var(--s-primary));
}

/* Botón circular del nodo */
.step-node {
  width: 78px;
  height: 74px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.2s;
  user-select: none;
}

/* Brillo superior (efecto "botón con luz") */
.step-node::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 15px;
  right: 15px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

/* Estado 1: COMPLETADO (verde pastel) */
.step-node.completed {
  background: linear-gradient(180deg, #a6e2b9 0%, var(--s-node-done) 100%);
  box-shadow: 0 6px 0 var(--s-node-done-edge), 0 10px 20px rgba(95, 174, 124, 0.3);
  color: #fff;
}

/* Estado 2: DISPONIBLE / ACTUAL (celeste pastel con anillo que late) */
.step-node.available {
  background: linear-gradient(180deg, #a5d3f5 0%, var(--s-node-now) 100%);
  box-shadow: 0 6px 0 var(--s-node-now-edge), 0 0 0 7px rgba(90, 155, 208, 0.25);
  color: #fff;
  animation: pulseNode 2.2s ease-in-out infinite;
}

/* Estado 3: BLOQUEADO */
.step-node.locked {
  background: var(--duo-locked);
  box-shadow: 0 6px 0 var(--duo-locked-shadow);
  color: var(--duo-locked-text);
  cursor: not-allowed;
  filter: grayscale(1);
}

.step-node.locked::before {
  background: rgba(255, 255, 255, 0.35);
}

.step-node:not(.locked):hover {
  filter: brightness(1.05) saturate(1.1);
  transform: translateY(-1px);
}

.step-node.completed:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--s-node-done-edge);
}

.step-node.available:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--s-node-now-edge);
}

.step-node:focus-visible {
  outline: 3px solid var(--s-primary);
  outline-offset: 4px;
}

@keyframes pulseNode {
  0%, 100% {
    box-shadow: 0 6px 0 var(--s-node-now-edge), 0 0 0 6px rgba(90, 155, 208, 0.28);
  }
  50% {
    box-shadow: 0 6px 0 var(--s-node-now-edge), 0 0 0 14px rgba(90, 155, 208, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-node.available, .start-bubble { animation: none; }
}

/* Etiqueta flotante "¡Empezar acá!" sobre el nodo actual */
.start-bubble {
  position: absolute;
  top: -40px;
  background: var(--s-ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  border-radius: var(--s-radius-sm);
  box-shadow: var(--s-shadow);
  white-space: nowrap;
  animation: floatBubble 2s ease-in-out infinite;
  pointer-events: none;
}

.start-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: var(--s-ink) transparent transparent;
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Check en la esquina del nodo completado */
.node-check-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--s-node-done-edge);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--s-node-done-edge);
}

/* Etiqueta debajo del nodo */
.node-caption {
  margin-top: 12px;
  text-align: center;
  max-width: 230px;
}

.node-code {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--s-primary);
  background: var(--s-primary-soft);
  padding: 2px 8px;
  border-radius: var(--s-radius-sm);
  margin-bottom: 4px;
}

.node-wrapper.is-completed .node-code {
  color: var(--s-success);
  background: var(--s-success-soft);
}

.node-wrapper.is-locked .node-code {
  color: var(--duo-locked-text);
  background: var(--s-surface-2);
}

.node-title {
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary);
}

.node-wrapper.is-locked .node-title {
  color: var(--duo-locked-text);
}

/* Indicador de dirección hacia arriba */
.upward-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--s-faint);
  font-size: 0.8rem;
  font-weight: 500;
  gap: 2px;
}

.upward-arrow span {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.7;
}

/* Modal / Popup para abrir cada HTML de tarea (pantalla casi completa) */
.task-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.task-modal.hidden {
  display: none;
}

.task-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 36, 48, 0.55);
  backdrop-filter: blur(4px);
}

.task-modal-dialog {
  position: relative;
  z-index: 2;
  width: 98vw;
  max-width: 1820px;
  height: 97vh;
  background: var(--s-surface);
  border: 1px solid var(--s-line);
  border-radius: var(--s-radius-lg);
  box-shadow: var(--s-shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#task-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--s-bg);
}

/* Botones fijos en el costado derecho (Consultas y Glosario) */
.floating-side-actions {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 920;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.floating-help-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--s-surface);
  color: var(--s-ink);
  text-decoration: none;
  padding: 7px 14px 7px 7px;
  border-radius: 999px;
  border: 1px solid var(--s-line);
  box-shadow: var(--s-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.floating-help-btn:hover {
  border-color: var(--s-primary);
  box-shadow: var(--s-shadow-lg);
}

.floating-help-btn:active {
  transform: translateY(1px);
}

.floating-help-btn.floating-glossary-btn:hover {
  border-color: var(--s-violet);
}

.floating-help-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--s-primary);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.floating-glossary-btn .floating-help-icon {
  background: var(--s-violet-soft);
  color: var(--s-violet);
  font-size: 1.05rem;
}

.floating-help-label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
  padding-right: 2px;
}

.floating-help-label small {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--s-muted);
}

@media (max-width: 600px) {
  .floating-side-actions {
    top: auto;
    bottom: 14px;
    right: 12px;
    transform: none;
    gap: 8px;
  }
  .floating-help-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .top-bar-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
  }
  .stats-bar {
    justify-content: space-between;
  }
  .node-wrapper.offset-left {
    transform: translateX(-32px);
  }
  .node-wrapper.offset-right {
    transform: translateX(32px);
  }
  .task-modal {
    padding: 8px;
  }
  .task-modal-dialog {
    height: 94vh;
  }
}
