:root {
  --bg: #0d1017;
  --bg-soft: #141924;
  --surface: #1a2030;
  --surface-2: #212a3d;
  --border: #2b3549;
  --text: #e8ecf4;
  --muted: #94a1bb;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --ok: #3ecf8e;
  --bad: #ff6b6b;
  --warn: #f2b544;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(91, 140, 255, 0.16), transparent 60%),
    radial-gradient(700px 420px at 105% 8%, rgba(62, 207, 142, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.wrap--ancho { max-width: 1180px; }

header.top { margin-bottom: 28px; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(91, 140, 255, 0.3);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

h1 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0; }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.card + .card { margin-top: 18px; }

/* -------------------------------------------------------------- formularios */

.campo { margin-bottom: 16px; }
.campo label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.campo .hint { font-size: 12px; color: var(--muted); font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

button {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 11px 20px;
  cursor: pointer;
  transition: filter .15s, background .15s, border-color .15s;
}

button:disabled { opacity: .5; cursor: not-allowed; }
button:not(:disabled):hover { filter: brightness(1.12); }

.btn-primario { background: var(--accent); color: #08101f; }
.btn-secundario { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-fantasma { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-peligro { background: transparent; color: var(--bad); border-color: rgba(255, 107, 107, .4); }
.btn-bloque { width: 100%; }

.acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.espaciador { flex: 1; }

/* ------------------------------------------------------------------- avance */

.avance { margin-bottom: 22px; }
.avance-texto {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.barra { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.barra > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s ease; }

/* ---------------------------------------------------------------- preguntas */

.pregunta-num { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.pregunta-texto { font-size: 19px; font-weight: 600; line-height: 1.45; margin: 0 0 22px; }

.opciones { display: grid; gap: 10px; }

.opcion {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s;
}

.opcion:hover { border-color: #3d4a68; background: var(--surface); }
.opcion:active { transform: scale(.995); }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.opcion .marca {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}

.opcion.marcada { border-color: var(--accent); background: var(--accent-soft); }
.opcion.marcada .marca { background: var(--accent); color: #08101f; border-color: var(--accent); }
.opcion span.txt { flex: 1; }

/* ----------------------------------------------------------------- mensajes */

.aviso {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.aviso--error { background: rgba(255, 107, 107, .10); border-color: rgba(255, 107, 107, .35); color: #ffb3b3; }
.aviso--ok    { background: rgba(62, 207, 142, .10); border-color: rgba(62, 207, 142, .35); color: #9ff0c9; }
.aviso--info  { background: var(--accent-soft); border-color: rgba(91, 140, 255, .35); color: #b9cdff; }
.oculto { display: none !important; }

.final { text-align: center; padding: 40px 26px; }
.final .icono { font-size: 46px; line-height: 1; margin-bottom: 14px; }

/* -------------------------------------------------------------------- admin */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.barra-herramientas { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.barra-herramientas input[type="search"] { flex: 1; min-width: 200px; }
.barra-herramientas select { width: auto; }

.tabla-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
thead th {
  background: var(--surface-2); text-align: left; padding: 12px 14px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--surface); }
.vacio { text-align: center; color: var(--muted); padding: 34px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill--alto { background: rgba(62, 207, 142, .15); color: var(--ok); }
.pill--medio { background: rgba(242, 181, 68, .15); color: var(--warn); }
.pill--bajo { background: rgba(255, 107, 107, .15); color: var(--bad); }
.mono { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

dialog {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0;
  max-width: 760px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(4, 7, 13, .72); }
.dlg-head { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.dlg-body { padding: 20px 24px; max-height: 62vh; overflow-y: auto; }
.dlg-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

.resp { border: 1px solid var(--border); border-left-width: 3px; border-radius: 10px; padding: 13px 15px; margin-bottom: 10px; background: var(--surface); }
.resp.ok { border-left-color: var(--ok); }
.resp.no { border-left-color: var(--bad); }
.resp .p { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.resp .r { font-size: 13.5px; color: var(--muted); }
.resp .r b { color: var(--text); font-weight: 600; }
.resp .r.buena b { color: var(--ok); }
.resp .r.mala b { color: var(--bad); }

footer.pie { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 30px; }
a { color: var(--accent); }
