/* ══════════════════════════════════════════
   DIAGNÓSTICO INTERACTIVO DE MADUREZ EN IA
   ══════════════════════════════════════════ */

/* Local tokens for this component */
.diagnostico-wrapper,
#page-diagnostico {
  --diag-accent: var(--navy-800);
  --diag-accent-hover: #162a48;
  --diag-teal: #2B9E8B;
  --diag-teal-hover: #249A82;
  --diag-border: rgba(220,230,243,0.6);
}

/* .diagnostico-wrapper uses .section-narrow (max-width:640px) from layout.css */
.diag-screen { scroll-margin-top: 80px; }
.diag-screen[hidden] { display: none; }

/* ── BUTTON TEAL ── */
.btn-teal {
  background: #2B9E8B;
  color: #fff;
}
.btn-teal:hover {
  background: #249A82;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(43,158,139,0.25);
}

/* ── INTRO ── */
.diag-intro-content { text-align: center; }
.diag-intro-features {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 32px;
}
.diag-intro-features li {
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.diag-check { color: var(--diag-accent); font-weight: 700; }
.diag-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
}
.diag-disclaimer {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 16px;
  opacity: 0.7;
}

/* ── PROGRESS ── */
.diag-header { margin-bottom: 48px; }
.diag-progress-bar {
  height: 4px;
  background: var(--diag-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}
.diag-progress-fill {
  height: 100%;
  background: var(--diag-accent);
  border-radius: 2px;
  transition: width 400ms ease;
  width: 0%;
}
.diag-progress-label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ── QUESTION ── */
.diag-question-text {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(20px, 4vw, 26px);
  color: var(--navy-800);
  line-height: 1.35;
  margin-bottom: 32px;
}
.diag-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.diag-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border: 1.5px solid var(--diag-border);
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  transition: border-color 200ms ease,
              background 200ms ease,
              transform 150ms ease;
}
.diag-option:hover {
  border-color: var(--diag-accent);
  background: rgba(30,51,84,0.04);
  transform: translateX(3px);
}
.diag-option.selected {
  border-color: var(--diag-accent);
  background: rgba(30,51,84,0.07);
}
.diag-option-letter {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--diag-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: border-color 200ms ease,
              background 200ms ease,
              color 200ms ease;
}
.diag-option:hover .diag-option-letter,
.diag-option.selected .diag-option-letter {
  border-color: var(--diag-accent);
  background: var(--diag-accent);
  color: #fff;
}
@keyframes questionEnter {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.diag-question-area {
  animation: questionEnter 350ms ease forwards;
}

/* ── NAVIGATION ── */
.diag-nav { margin-top: 28px; }
.diag-back-btn {
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 0;
  transition: color 200ms ease;
}
.diag-back-btn:hover { color: var(--diag-accent); }
.diag-back-btn[hidden] { display: none; }

/* ── RESULT ── */
.diag-result-header { text-align: center; margin-bottom: 40px; }
.diag-level-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.diag-level-badge.nivel-1 {
  background: rgba(234,179,8,0.12);
  color: #92681a;
}
.diag-level-badge.nivel-2 {
  background: rgba(43,158,139,0.12);
  color: #1a7a6e;
}
.diag-level-badge.nivel-3 {
  background: rgba(11,18,34,0.08);
  color: var(--navy-800);
}
.diag-result-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(24px, 4vw, 32px);
  color: var(--navy-800);
  margin-bottom: 16px;
  line-height: 1.25;
}
.diag-result-desc {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto;
}

/* Score bar */
.diag-score-visual { margin-bottom: 48px; }
.diag-score-bar {
  height: 8px;
  background: var(--diag-border);
  border-radius: 4px;
  overflow: visible;
  position: relative;
  margin-bottom: 10px;
}
.diag-score-fill {
  height: 100%;
  background: linear-gradient(90deg, #eab308, #2B9E8B, var(--navy-800));
  border-radius: 4px;
  transition: width 1s ease;
  width: 0%;
}
.diag-score-markers {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* Recommended steps */
.diag-steps { margin-bottom: 40px; }
.diag-steps-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--navy-800);
  margin-bottom: 20px;
}
.diag-steps-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: steps;
}
.diag-steps-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  counter-increment: steps;
}
.diag-steps-list li::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--diag-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Related resources */
.diag-recursos-relacionados {
  margin-bottom: 40px;
  padding: 28px;
  border: 1px solid var(--diag-border);
  border-radius: 12px;
  background: #fafbfd;
}
.diag-recursos-relacionados h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: var(--navy-800);
  margin-bottom: 16px;
}
.diag-recursos-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.diag-recurso-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--diag-accent);
  cursor: pointer;
  text-decoration: none;
  transition: gap 200ms ease;
}
.diag-recurso-link:hover { gap: 14px; }
.diag-recurso-link::before { content: '\2193'; font-weight: 700; }

/* PDF Actions */
.diag-pdf-actions {
  text-align: center;
  margin-bottom: 32px;
  padding: 28px;
  border: 1px solid var(--diag-border);
  border-radius: 12px;
  background: #fafbfd;
}
.diag-pdf-intro {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: var(--navy-800);
  margin-bottom: 16px;
}
.diag-pdf-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.diag-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 200ms ease,
              transform 150ms ease,
              box-shadow 200ms ease;
}
.btn-outline-teal {
  background: transparent;
  border: 1.5px solid #2B9E8B;
  color: #2B9E8B;
}
.btn-outline-teal:hover {
  background: rgba(43,158,139,0.08);
  transform: translateY(-1px);
}
.btn-outline-navy {
  background: transparent;
  border: 1.5px solid var(--navy-800);
  color: var(--navy-800);
}
.btn-outline-navy:hover {
  background: rgba(30,51,84,0.06);
  transform: translateY(-1px);
}

/* Final CTA */
.diag-cta-box {
  text-align: center;
  padding: 40px 32px;
  background: var(--navy-800);
  border-radius: 16px;
  color: #fff;
}
.diag-cta-text {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,0.8);
  margin-bottom: 20px;
}
.diag-cta-btn {
  background: #2B9E8B !important;
  margin-bottom: 16px;
}
.diag-cta-btn:hover {
  background: #249A82 !important;
}
.diag-retry-btn {
  display: block;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  margin: 0 auto;
  padding: 4px;
  transition: color 200ms ease;
}
.diag-retry-btn:hover { color: rgba(255,255,255,0.75); }

/* LinkedIn Share CTA inside diagnostic results */
.diag-share-cta {
  text-align: center; margin-bottom: 32px; padding: 28px;
  border: 1px solid var(--diag-border); border-radius: 12px; background: #fafbfd;
}
.diag-share-cta h3 { font-family: 'DM Serif Display', serif; font-size: 16px; color: var(--navy-800); margin-bottom: 8px; }
.diag-share-cta p { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.6; }
.diag-share-cta .share-clipboard-nota { color: rgba(0,0,0,0.5); }
.diag-share-cta .share-clipboard-nota svg { stroke: rgba(0,0,0,0.5); }

@keyframes resultReveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.diag-screen#diag-result:not([hidden]) {
  animation: resultReveal 500ms ease forwards;
}

/* ── HOMEPAGE TEASER ── */
.diagnostico-teaser {
  padding: 64px var(--page-pad, 24px);
  text-align: center;
  background: var(--navy-50);
}
.diagnostico-teaser h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(24px, 4vw, 32px);
  color: var(--navy-800);
  line-height: 1.25;
  margin-bottom: 0;
}

/* ── DARK MODE ── */
[data-theme="dark"] .diagnostico-wrapper,
[data-theme="dark"] #page-diagnostico {
  --diag-accent: #8ba7d1;
  --diag-accent-hover: #a0bce0;
  --diag-teal: #2B9E8B;
  --diag-border: var(--border-subtle);
}
[data-theme="dark"] .diag-option {
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
[data-theme="dark"] .diag-option:hover {
  border-color: var(--diag-accent);
  background: rgba(139,167,209,0.08);
}
[data-theme="dark"] .diag-option.selected {
  border-color: var(--diag-accent);
  background: rgba(139,167,209,0.12);
}
[data-theme="dark"] .diag-option-letter {
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}
[data-theme="dark"] .diag-pdf-actions {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}
[data-theme="dark"] .diag-pdf-intro {
  color: var(--text-primary);
}
[data-theme="dark"] .btn-outline-teal {
  border-color: #2B9E8B;
  color: #3cc0a8;
}
[data-theme="dark"] .btn-outline-teal:hover {
  background: rgba(43,158,139,0.12);
}
[data-theme="dark"] .btn-outline-navy {
  border-color: var(--diag-accent);
  color: var(--diag-accent);
}
[data-theme="dark"] .btn-outline-navy:hover {
  background: rgba(139,167,209,0.1);
}
[data-theme="dark"] .diag-cta-box {
  background: var(--bg-elevated);
}
[data-theme="dark"] .diag-recursos-relacionados {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}
[data-theme="dark"] .diagnostico-teaser {
  background: rgba(255,255,255,0.02);
}
[data-theme="dark"] .diag-question-text,
[data-theme="dark"] .diag-result-title,
[data-theme="dark"] .diag-steps-title,
[data-theme="dark"] .diag-recursos-relacionados h3,
[data-theme="dark"] .diagnostico-teaser h2 {
  color: var(--text-primary);
}
[data-theme="dark"] .diag-result-desc,
[data-theme="dark"] .diag-progress-label,
[data-theme="dark"] .diag-disclaimer,
[data-theme="dark"] .diag-intro-features li,
[data-theme="dark"] .diag-score-markers {
  color: var(--text-secondary);
}
[data-theme="dark"] .diag-share-cta { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .diag-share-cta h3 { color: #fff; }
[data-theme="dark"] .diag-share-cta p { color: rgba(255,255,255,0.6); }
[data-theme="dark"] .diag-back-btn {
  color: var(--text-secondary);
}
[data-theme="dark"] .diag-back-btn:hover {
  color: var(--diag-accent);
}
[data-theme="dark"] .diag-steps-list li {
  color: var(--text-primary);
}
[data-theme="dark"] .diag-level-badge.nivel-1 {
  background: rgba(234,179,8,0.15);
  color: #d4a017;
}
[data-theme="dark"] .diag-level-badge.nivel-2 {
  background: rgba(43,158,139,0.15);
  color: #3cc0a8;
}
[data-theme="dark"] .diag-level-badge.nivel-3 {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
[data-theme="dark"] .diag-score-bar {
  background: var(--border-subtle);
}
[data-theme="dark"] .diag-progress-bar {
  background: var(--border-subtle);
}
[data-theme="dark"] .diag-recurso-link {
  color: var(--diag-accent);
}
[data-theme="dark"] .btn-teal {
  background: #2B9E8B;
  color: #fff;
}
[data-theme="dark"] .btn-teal:hover {
  background: #35B5A0;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .diag-option { padding: 14px 16px; }
  .diag-cta-box { padding: 28px 20px; }
  .diag-score-markers { font-size: 9px; }
  .diagnostico-teaser { padding: 48px 16px; }
  .diag-pdf-actions { padding: 20px 16px; }
  .diag-pdf-buttons { flex-direction: column; }
  .diag-pdf-btn { justify-content: center; width: 100%; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .diag-question-area { animation: none; }
  .diag-screen#diag-result:not([hidden]) { animation: none; }
  .diag-progress-fill,
  .diag-score-fill { transition: none; }
  .diag-option { transition: none; }
}
