/* ============================================================
   Juego · Diagnóstico Empresarial — JuanDa Posada
   Marca: azul noche #00111F · morado #AA2BE6 · cyan #21E9FE · blanco #FEFEFE
   Fuentes: Rajdhani (títulos) · Montserrat (cuerpo)
   ============================================================ */

:root {
  --display: "Rajdhani", system-ui, sans-serif;
  --body: "Montserrat", system-ui, sans-serif;

  /* Tema oscuro (por defecto, alineado a la marca) */
  --bg: #00111F;
  --bg-2: #071A2B;
  --card: #0B1C2E;
  --card-hover: #10243A;
  --text: #FEFEFE;
  --text-dim: rgba(254, 254, 254, 0.66);
  --border: rgba(254, 254, 254, 0.12);
  --morado: #AA2BE6;
  --morado-soft: rgba(170, 43, 230, 0.16);
  --cyan: #21E9FE;
  --cyan-soft: rgba(33, 233, 254, 0.14);
  --grad: linear-gradient(90deg, #AA2BE6 0%, #21E9FE 100%);
  --ok: #2BD98A;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
  --bg: #FEFEFE;
  --bg-2: #F3F6F9;
  --card: #FFFFFF;
  --card-hover: #F4F8FB;
  --text: #00111F;
  --text-dim: rgba(0, 17, 31, 0.62);
  --border: rgba(0, 17, 31, 0.14);
  --morado-soft: rgba(170, 43, 230, 0.10);
  --cyan-soft: rgba(0, 130, 150, 0.12);
  --shadow: 0 18px 50px rgba(0, 17, 31, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 20px; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--morado); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.juego-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Sub-nav del juego (compartido diagnóstico/misiones) */
.sub-nav { display: flex; gap: 6px; }
.sub-nav a {
  font-family: var(--display); font-weight: 600; font-size: 0.92rem; letter-spacing: 0.5px;
  color: var(--text-dim); text-decoration: none; padding: 6px 14px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.sub-nav a:hover { color: var(--text); text-decoration: none; }
.sub-nav a.is-active { color: var(--cyan); background: var(--cyan-soft); border-color: var(--border); }

.brand {
  font-family: var(--display);
  font-weight: 700; font-size: 1.4rem; letter-spacing: 0.5px;
  color: var(--text); text-decoration: none;
}
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-family: var(--body); font-size: 0.8rem; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--cyan); }
.theme-toggle__icon { font-size: 1rem; line-height: 1; }

/* ---------- Pantallas ---------- */
.screen { padding: 40px 0 60px; animation: fade 0.4s ease; }
.is-hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pill {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cyan); background: var(--cyan-soft);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}

.display {
  font-family: var(--display);
  font-weight: 700; font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.05; margin: 18px 0 14px;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lead { color: var(--text-dim); font-size: 1.05rem; max-width: 620px; margin-bottom: 24px; }
.fine { color: var(--text-dim); font-size: 0.8rem; margin-top: 16px; }

/* Áreas / chips */
.area-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.area-chips span {
  font-size: 0.78rem; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}

/* Niveles strip */
.level-strip {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 32px;
}
.level-strip__item {
  text-align: center; padding: 12px 6px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
}
.level-strip__item b { display: block; font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.5px; }
.level-strip__item span { font-size: 0.72rem; color: var(--text-dim); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.5px;
  border-radius: 12px; padding: 14px 26px; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary { background: var(--grad); color: #00111F; box-shadow: 0 8px 24px rgba(170, 43, 230, 0.28); }
.btn-primary:hover { box-shadow: 0 12px 32px rgba(170, 43, 230, 0.4); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- Quiz ---------- */
.quiz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.quiz-count { font-family: var(--display); font-weight: 600; color: var(--text-dim); }

.progress {
  height: 8px; border-radius: 999px; background: var(--bg-2);
  border: 1px solid var(--border); overflow: hidden; margin-bottom: 26px;
}
.progress__bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--grad); transition: width 0.35s ease;
}

.quiz-question {
  font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  line-height: 1.2; margin-bottom: 24px;
}

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; font-family: var(--body); font-size: 0.98rem; color: var(--text);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.option:hover { border-color: var(--cyan); background: var(--card-hover); transform: translateX(3px); }
.option:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.option__marker {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border); display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 0.85rem; color: var(--cyan);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option:hover .option__marker { border-color: var(--cyan); }

/* ---------- Resultado ---------- */
.result-hero {
  text-align: center; padding: 34px 24px; border-radius: 20px;
  background: radial-gradient(800px 360px at 50% -10%, var(--morado-soft), transparent 60%), var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 28px;
}
.result-hero .display { margin-bottom: 8px; }
.score { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 18px; }
.score__number { font-family: var(--display); font-weight: 700; font-size: 3.4rem; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score__label { color: var(--text-dim); font-size: 0.95rem; }

.result-block { margin-bottom: 28px; }
.result-block h3 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; margin-bottom: 16px; }

.weak-areas { display: grid; gap: 12px; }
.weak-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
}
.weak-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.weak-card__area { font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
.weak-card__score {
  font-size: 0.78rem; color: var(--cyan); background: var(--cyan-soft);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.weak-card__mission { color: var(--text-dim); font-size: 0.92rem; }
.weak-card__mission b { color: var(--text); }

.result-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }

/* ---------- Lead box ---------- */
.lead-box {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px;
}
.lead-box__head { margin-bottom: 20px; }
.lead-box__head h3 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; }
.lead-box__head p { color: var(--text-dim); font-size: 0.92rem; margin-top: 4px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 0.82rem; font-weight: 600; color: var(--text-dim); }
.field input {
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: var(--body); font-size: 0.95rem;
}
.field input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.field input::placeholder { color: var(--text-dim); opacity: 0.6; }

.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 16px; cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--morado); flex: 0 0 auto; }

.form-msg { font-size: 0.85rem; min-height: 1.2em; margin-bottom: 12px; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: #FF5C7A; }

/* ---------- Footer ---------- */
.juego-footer { border-top: 1px solid var(--border); padding: 20px 0; margin-top: auto; }
.juego-footer p { color: var(--text-dim); font-size: 0.8rem; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .level-strip { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .level-strip__item b { font-size: 0.78rem; }
  .level-strip__item span { font-size: 0.66rem; }
  .form-grid { grid-template-columns: 1fr; }
  .result-cta { flex-direction: column; }
  .result-cta .btn { width: 100%; }
  .screen { padding: 28px 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
