/* preu.cl — sub-pagina, body usa tokens actuales */
body { background: var(--c-bg); color: var(--c-text); }

/* Mini-diagnostico — preu.cl Capa 2 */

.diag-wrap {
  max-width: 760px;
  margin: 32px auto 80px;
  padding: 0 16px;
}

.diag-head {
  text-align: center;
  margin-bottom: 32px;
}

.diag-head .kicker {
  display: inline-block;
  font-family: var(--f-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  background: var(--c-bg-2);
  border: 1px solid var(--c-brand);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.diag-head h1 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--c-text, #0a0a0a);
}

.diag-sub {
  font-size: 1.05rem;
  color: var(--c-text-muted, #4a4a4a);
  line-height: 1.5;
  max-width: 580px;
  margin: 0 auto;
}

/* Progreso */
.diag-progress {
  margin: 24px auto 28px;
  max-width: 480px;
}

.diag-bar {
  height: 6px;
  background: var(--c-surface-2, #f5f5f5);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.diag-bar span {
  display: block;
  height: 100%;
  background: var(--c-primary, #0a0a0a);
  width: 20%;
  border-radius: 3px;
  transition: width 0.3s;
}

.diag-counter {
  font-family: var(--f-mono, monospace);
  font-size: 0.8rem;
  color: var(--c-text-muted, #4a4a4a);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin: 0;
}

/* Pregunta */
.diag-pregunta {
  background: var(--c-surface, #ffffff);
  border: 1px solid var(--c-border, #e5e5e5);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--c-text, #0a0a0a);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .diag-pregunta {
    background: #1d142b !important;
    border-color: #413452 !important;
    color: #faf7ff !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-enunciado, :root:not([data-theme="light"]) .diag-pregunta .diag-opt-text, :root:not([data-theme="light"]) .diag-pregunta .diag-opt-letter {
    color: #faf7ff !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-contexto {
    background: #2a1f3d !important;
    color: #bdb3cc !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-opt {
    background: #2a1f3d !important;
    color: #faf7ff !important;
    border-color: #413452 !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-opt-letter {
    background: #413452 !important;
    color: #faf7ff !important;
    border-color: #413452 !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-opt:hover {
    background: #413452 !important;
    border-color: #faf7ff !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-opt.is-correct {
    background: #14532d !important;
    border-color: #15803d !important;
    color: #faf7ff !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-opt.is-wrong {
    background: #7f1d1d !important;
    border-color: #b91c1c !important;
    color: #faf7ff !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta .diag-opt.is-picked-correct {
    background: #14532d !important;
    border-color: #15803d !important;
    color: #faf7ff !important;
  }
  :root:not([data-theme="light"]) .diag-pregunta #btn-saltar {
    background: #2a1f3d !important;
    color: #faf7ff !important;
    border-color: #413452 !important;
  }
}

.diag-pregunta-materia {
  margin-bottom: 12px;
}

.diag-materia-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--c-bg-2);
  color: #92400e;
  border: 1px solid var(--c-brand);
  border-radius: 4px;
  font-family: var(--f-mono, monospace);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diag-contexto {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--c-text-muted, #4a4a4a);
  margin-bottom: 20px;
  padding: 16px;
  background: var(--c-surface-2, #fafafa);
  border-left: 3px solid var(--c-brand);
  border-radius: 4px;
}

.diag-enunciado {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 20px;
  color: var(--c-text, #0a0a0a);
}

.diag-opciones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.diag-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--c-surface, #ffffff);
  border: 1.5px solid var(--c-border, #e5e5e5);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--c-text, #0a0a0a);
  transition: all 0.15s;
}

.diag-opt:hover:not(:disabled) {
  border-color: var(--c-primary, #0a0a0a);
  background: var(--c-surface-2, #fafafa);
}

.diag-opt:disabled {
  cursor: default;
}

.diag-opt .diag-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--c-surface-2, #f5f5f5);
  color: var(--c-text-muted, #4a4a4a);
  font-family: var(--f-mono, monospace);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--c-border, #e5e5e5);
  margin-top: 1px;
}

.diag-opt.is-correct {
  border-color: #15803d;
  background: #f0fdf4;
}

.diag-opt.is-correct .diag-opt-letter {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
}

.diag-opt.is-wrong {
  border-color: #b91c1c;
  background: #fef2f2;
}

.diag-opt.is-wrong .diag-opt-letter {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
}

.diag-opt.is-picked-correct {
  border-color: #15803d;
  background: #f0fdf4;
}

.diag-opt.is-skipped {
  opacity: 0.5;
}

.diag-actions {
  display: flex;
  justify-content: flex-end;
}

/* Resultado */
.diag-resultado {
  background: var(--c-surface, #ffffff);
  border: 1px solid var(--c-border, #e5e5e5);
  color: var(--c-text, #0a0a0a);
  border-radius: 12px;
  padding: 32px;
}

.diag-resultado-head {
  text-align: center;
  margin-bottom: 28px;
}

.diag-resultado-head .kicker {
  display: inline-block;
  font-family: var(--f-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-primary, #0a0a0a);
  background: var(--c-bg-2, #ede9fe);
  border: 1px solid var(--c-brand);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.diag-resultado-head h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--c-text, #0a0a0a);
}

.diag-resultado-sub {
  font-size: 1rem;
  color: var(--c-text-muted, #4a4a4a);
  margin: 0;
  line-height: 1.5;
}

.diag-breaks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.diag-break {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--c-surface-2, #fafafa);
  border: 1px solid var(--c-border, #e5e5e5);
  border-radius: 8px;
}

.diag-break-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.diag-break-info strong {
  font-size: 0.95rem;
  color: var(--c-text, #0a0a0a);
}

.diag-break-info span {
  font-size: 0.8rem;
  color: var(--c-text-muted, #4a4a4a);
  font-family: var(--f-mono, monospace);
}

.diag-break-level {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--f-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diag-break-level.critica {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.diag-break-level.debil {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.diag-break-level.ok {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.diag-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.diag-cta .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 720px) {
  .diag-cta {
    flex-direction: row;
  }
  .diag-cta .btn {
    width: auto;
    flex: 1;
  }
}

/* Detail */
.diag-detail {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
}

.diag-detail summary {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text-muted, #4a4a4a);
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
}

.diag-detail summary::-webkit-details-marker {
  display: none;
}

.diag-detail summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s;
}

.diag-detail[open] summary::before {
  transform: rotate(90deg);
}

.diag-detail-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diag-detail-list li {
  padding: 10px 14px;
  background: var(--c-surface-2, #fafafa);
  border: 1px solid var(--c-border, #e5e5e5);
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--c-text-muted, #4a4a4a);
}

.diag-detail-list li strong {
  color: var(--c-text, #0a0a0a);
}

.diag-detail-list .ok {
  color: #15803d;
}

.diag-detail-list .wrong {
  color: #b91c1c;
}

.diag-detail-list .skipped {
  color: #92400e;
  font-style: italic;
}

/* Mobile */
@media (max-width: 600px) {
  .diag-pregunta,
  .diag-resultado {
    padding: 20px;
  }
}


/* Dark mode overrides - reforzar colores de cards/paneles */
[data-theme="dark"] .wiz-opt,
[data-theme="dark"] .diag-pregunta,
[data-theme="dark"] .diag-resultado,
[data-theme="dark"] .plan-empty,
[data-theme="dark"] .plan-summary,
[data-theme="dark"] .plan-timeline .plan-hito-content,
[data-theme="dark"] .plan-today,
[data-theme="dark"] .plan-summary-card .plan-summary-item,
[data-theme="dark"] .plan-tip,
[data-theme="dark"] .diag-break,
[data-theme="dark"] .diag-detail-list li,
[data-theme="dark"] .wiz-panel,
[data-theme="dark"] .wiz-custom,
[data-theme="dark"] .plan-summary li {
  background: #1d142b !important;
  color: #faf7ff !important;
  border-color: #413452 !important;
}
[data-theme="dark"] .wiz-opt strong,
[data-theme="dark"] .wiz-opt span,
[data-theme="dark"] .wiz-panel h2,
[data-theme="dark"] .wiz-panel .wiz-desc,
[data-theme="dark"] .wiz-custom label,
[data-theme="dark"] .wiz-custom input,
[data-theme="dark"] .diag-enunciado,
[data-theme="dark"] .diag-contexto,
[data-theme="dark"] .diag-opt .diag-opt-text,
[data-theme="dark"] .diag-opt .diag-opt-letter {
  color: #faf7ff !important;
}
[data-theme="dark"] .diag-opt {
  background: #1d142b !important;
  color: #faf7ff !important;
  border-color: #413452 !important;
}
[data-theme="dark"] .diag-contexto {
  background: #2a1f3d !important;
  color: #bdb3cc !important;
}