/* SolarPro · Diagnóstico ISO 9001:2015
   Extiende los tokens de ../../_shared/styles.css */

.dx-shell { padding-bottom: 100px; }

.dx-intro {
  background: var(--sp-white);
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--sp-border);
}
.dx-intro h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--sp-ink);
  line-height: 1.25;
}
.dx-intro .lead {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--sp-body);
  line-height: 1.5;
}
.dx-intro .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--sp-muted);
}
.dx-intro .meta strong { color: var(--sp-body); font-weight: 600; }

/* ---------- Stats top bar ---------- */
.dx-progress-card {
  background: var(--sp-white);
  border: 1px solid var(--sp-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 20px 0;
  box-shadow: var(--shadow-sm);
}
.dx-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}
.dx-progress-stats {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--sp-muted);
}
.dx-progress-stats strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--sp-navy);
  line-height: 1.1;
  margin-bottom: 2px;
}
.dx-progress-stats .num-si { color: var(--sp-success); }
.dx-progress-stats .num-pa { color: #b78010; }
.dx-progress-stats .num-no { color: var(--sp-danger); }

.dx-progress-bar-wrap {
  background: var(--sp-bg);
  border-radius: 100px;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
}
.dx-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--sp-yellow), var(--sp-navy));
  border-radius: 100px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ---------- Section accordion ---------- */
.dx-section {
  background: var(--sp-white);
  border: 1px solid var(--sp-border);
  border-radius: var(--radius);
  margin: 14px 20px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dx-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background 0.15s;
}
.dx-section-head:hover { background: #f9fafc; }

.dx-section.open .dx-section-head {
  border-bottom-color: var(--sp-border);
}

.dx-section-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sp-navy);
  color: var(--sp-yellow);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
}

.dx-section-title {
  flex: 1;
  min-width: 0;
}
.dx-section-title h2 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--sp-ink);
  line-height: 1.3;
}
.dx-section-title p {
  margin: 0;
  font-size: 12px;
  color: var(--sp-muted);
  line-height: 1.4;
}

.dx-section-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--sp-bg);
  color: var(--sp-body);
  white-space: nowrap;
}
.dx-section-badge.complete {
  background: #e6f4ec;
  color: #1a7a50;
}
.dx-section-chevron {
  flex-shrink: 0;
  color: var(--sp-muted);
  font-size: 14px;
  transition: transform 0.2s;
}
.dx-section.open .dx-section-chevron { transform: rotate(180deg); }

.dx-section-body {
  display: none;
  padding: 4px 16px 12px;
}
.dx-section.open .dx-section-body { display: block; }

/* ---------- Question card ---------- */
.dx-q {
  padding: 16px 0 14px;
  border-bottom: 1px solid #f0f2f5;
}
.dx-q:last-child { border-bottom: none; }
.dx-q.answered { background: #fdfdfb; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }

.dx-q-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.dx-q-meta {
  flex: 1;
  min-width: 0;
}

.dx-q-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.dx-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--sp-bg);
  color: var(--sp-body);
}
.dx-tag.crit-alta { background: #fdecec; color: var(--sp-danger); }
.dx-tag.crit-media { background: #fff4dd; color: #b78010; }
.dx-tag.crit-baja { background: #eef1f5; color: var(--sp-muted); }
.dx-tag.clausula { background: #e7f0fa; color: var(--sp-navy); }
.dx-tag.excluible { background: #f3e8ff; color: #6b21a8; }

.dx-q-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--sp-ink);
  line-height: 1.45;
  margin: 0 0 6px;
}

.dx-q-evidence {
  font-size: 12px;
  color: var(--sp-muted);
  line-height: 1.45;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: var(--sp-bg);
  border-radius: 6px;
  border-left: 2px solid var(--sp-yellow);
}
.dx-q-evidence strong { color: var(--sp-body); font-weight: 600; }

/* Answer buttons */
.dx-answer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.dx-answer-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--sp-border);
  background: var(--sp-white);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--sp-body);
  padding: 9px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.dx-answer-btn:hover { border-color: var(--sp-navy); }
.dx-answer-btn.selected.si    { background: var(--sp-success); border-color: var(--sp-success); color: var(--sp-white); }
.dx-answer-btn.selected.parcial { background: #d99311; border-color: #d99311; color: var(--sp-white); }
.dx-answer-btn.selected.no    { background: var(--sp-danger); border-color: var(--sp-danger); color: var(--sp-white); }

/* Comment textarea */
.dx-comment {
  width: 100%;
  min-height: 60px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--sp-ink);
  background: var(--sp-white);
  border: 1px solid var(--sp-border);
  border-radius: 7px;
  resize: vertical;
  line-height: 1.4;
}
.dx-comment:focus {
  outline: none;
  border-color: var(--sp-navy);
  box-shadow: 0 0 0 3px rgba(11, 83, 163, 0.12);
}
.dx-comment::placeholder { color: var(--sp-muted); }

/* ---------- Bottom action bar ---------- */
.dx-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sp-white);
  border-top: 1px solid var(--sp-border);
  padding: 11px 20px calc(11px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(11, 83, 163, 0.08);
  z-index: 10;
}
.dx-actions-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}
.dx-actions-status {
  flex: 1;
  font-size: 12px;
  color: var(--sp-muted);
  align-self: center;
}
.dx-actions-status strong { color: var(--sp-navy); font-weight: 700; }
.dx-btn {
  appearance: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.dx-btn-primary {
  background: var(--sp-yellow);
  color: var(--sp-ink);
  box-shadow: 0 2px 0 var(--sp-yellow-dark);
}
.dx-btn-primary:active { transform: translateY(1px); box-shadow: 0 0 0 var(--sp-yellow-dark); }
.dx-btn-secondary {
  background: var(--sp-white);
  border: 1px solid var(--sp-border);
  color: var(--sp-body);
}
.dx-btn-secondary:hover { border-color: var(--sp-navy); color: var(--sp-navy); }

/* ---------- Toast (reused from _shared) ---------- */

/* Mobile tweaks */
@media (max-width: 480px) {
  .dx-progress-card { margin: 12px 14px 0; }
  .dx-section { margin: 12px 14px 0; }
  .dx-actions-inner { flex-direction: column; gap: 6px; }
  .dx-actions-status { text-align: center; }
}
