:root {
  --azul: #0b2e6b;
  --azul-2: #123e8a;
  --azul-3: #1c4fa8;
  --navy: #071a40;
  --rojo: #ce1126;
  --oro: #c9a227;
  --papel: #f4f6fb;
  --blanco: #fff;
  --tinta: #122033;
  --muted: #5b6b80;
  --linea: #d5deea;
  --ok: #0f7a4a;
  --mal: #b42318;
  --sombra: 0 10px 30px rgba(7, 26, 64, .08);
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--tinta);
  background: var(--papel);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--azul-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.sim-wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.sim-gob {
  background: var(--navy);
  color: #dbe7ff;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}
.sim-gob-inner { display: flex; gap: 10px; align-items: center; padding: 8px 0; flex-wrap: wrap; }
.sim-gob-sep { opacity: .5; }

.sim-brandbar {
  background: linear-gradient(180deg, #0d3480 0%, var(--azul) 100%);
  color: #fff;
  border-bottom: 4px solid var(--rojo);
}
.sim-brand-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.sim-brand { display: flex; gap: 12px; align-items: center; color: #fff; text-decoration: none; }
.sim-brand strong { display: block; font-size: 18px; letter-spacing: .01em; }
.sim-brand small { display: block; opacity: .85; font-size: 12px; }
.sim-nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sim-nav a { color: #e8eefc; font-weight: 600; text-decoration: none; }
.sim-nav a.is-on, .sim-nav a:hover { color: #fff; text-decoration: underline; }
.sim-user { font-weight: 700; color: #f6e7a1; }
.sim-aviso {
  background: #fff7e0;
  color: #5c4810;
  font-size: 13px;
  padding: 8px 16px;
  margin: 0 auto;
  border-left: 4px solid var(--oro);
}

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 0; cursor: pointer; font-weight: 700;
  font-family: inherit; padding: 10px 16px; border-radius: 6px;
  text-decoration: none !important;
}
.btn-primary { background: var(--rojo); color: #fff; }
.btn-primary:hover { background: #a80d1e; }
.btn-navy { background: var(--azul); color: #fff; }
.btn-navy:hover { background: var(--navy); }
.btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.sim-hero {
  background:
    linear-gradient(105deg, rgba(7,26,64,.92), rgba(18,62,138,.78)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M0 80L80 0H60L0 60z' fill='%23ffffff08'/%3E%3C/svg%3E");
  color: #fff;
  padding: 48px 0 56px;
}
.sim-hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 12px; line-height: 1.15; }
.sim-hero p.lead { font-size: 18px; max-width: 720px; opacity: .95; }
.sim-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.sim-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.sim-pill {
  border: 1px solid rgba(255,255,255,.35);
  padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
}

.sim-cards, .sim-grid { display: grid; gap: 16px; }
.sim-cards-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sim-cards-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 10px;
  box-shadow: var(--sombra);
  padding: 18px;
}
.card h3, .card h2 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.section { padding: 36px 0; }
.section h2 { margin: 0 0 8px; color: var(--azul); }
.kicker { color: var(--rojo); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }

.area-card { position: relative; overflow: hidden; min-height: 150px; }
.area-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--area, var(--azul));
}
.area-card h3 { font-size: 16px; }
.num {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--azul); color: #fff; display: grid; place-items: center;
  font-weight: 800; margin-bottom: 10px;
}

.sim-form {
  max-width: 560px; margin: 24px auto 48px;
}
label { display: block; font-weight: 700; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--linea);
  border-radius: 6px; font: inherit; background: #fff;
}
.sim-form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.sim-alert { border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.sim-alert-ok { background: #e8f7ee; color: #0f7a4a; }
.sim-alert-error { background: #fdecec; color: #b42318; }
.sim-alert-warn { background: #fff6d9; color: #7a5b00; }

.sim-pie {
  margin-top: auto;
  background: var(--navy);
  color: #c9d4ea;
  padding: 32px 0 16px;
}
.sim-pie a { color: #fff; }
.sim-pie-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.sim-pie ul { padding-left: 16px; }
.sim-copy { border-top: 1px solid #24365c; margin-top: 18px; padding-top: 12px; font-size: 13px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { background: #fff; border: 1px solid var(--linea); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-size: 28px; color: var(--azul); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linea); font-size: 14px; }
th { background: #eef3fb; color: var(--azul); }

/* CBT exam */
.exam-shell { min-height: 100vh; background: #e8edf5; display: flex; flex-direction: column; }
.exam-bar {
  background: var(--azul);
  color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 16px; border-bottom: 4px solid var(--rojo);
}
.exam-bar strong { display: block; }
.exam-timer {
  font-variant-numeric: tabular-nums;
  background: #071a40; padding: 8px 14px; border-radius: 6px;
  font-size: 22px; font-weight: 800; letter-spacing: .04em;
}
.exam-timer.is-low { background: var(--rojo); }
.exam-body { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 72px); }
.exam-paleta {
  background: #fff; border-right: 1px solid var(--linea); padding: 14px;
  overflow: auto;
}
.exam-paleta h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pills-q { display: flex; flex-wrap: wrap; gap: 6px; }
.q-dot {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--linea);
  background: #fff; font-weight: 700; cursor: pointer;
}
.q-dot.is-on { outline: 2px solid var(--azul); }
.q-dot.is-ans { background: var(--azul); color: #fff; border-color: var(--azul); }
.q-dot.is-flag { box-shadow: inset 0 -4px 0 var(--oro); }
.exam-main { padding: 22px; }
.q-card { background: #fff; border-radius: 10px; padding: 22px; box-shadow: var(--sombra); max-width: 860px; }
.q-meta { color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.enunciado { font-size: 18px; line-height: 1.45; margin: 12px 0 18px; }
.opcion {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--linea); border-radius: 8px; padding: 12px;
  margin-bottom: 8px; cursor: pointer; background: #fff;
}
.opcion:hover, .opcion:has(input:checked) { border-color: var(--azul); background: #f3f7ff; }
.letra {
  width: 28px; height: 28px; border-radius: 50%; background: var(--azul); color: #fff;
  display: grid; place-items: center; font-weight: 800; flex: none;
}
.exam-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; justify-content: space-between; }
.exam-actions .left, .exam-actions .right { display: flex; gap: 8px; }

.resultado-hero { text-align: center; padding: 28px; }
.nota {
  font-size: 64px; font-weight: 800; color: var(--azul); line-height: 1;
}
.nota.pass { color: var(--ok); }
.nota.fail { color: var(--mal); }
.rev-ok { border-left: 4px solid var(--ok); }
.rev-bad { border-left: 4px solid var(--mal); }

.pay-box { max-width: 640px; margin: 24px auto; }
.logos-pay { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .exam-body { grid-template-columns: 1fr; }
  .exam-paleta { border-right: 0; border-bottom: 1px solid var(--linea); }
  .sim-form .row-2 { grid-template-columns: 1fr; }
  .sim-brand-inner { flex-direction: column; align-items: flex-start; }
}
