/* InfraTest · tema tecnológico oscuro (cian eléctrico + oro mineral) */
:root {
  --bg: #050a14; --bg-2: #0a1324; --panel: rgba(13, 22, 40, .78); --panel-solid: #0d1628; --panel-2: rgba(22, 34, 58, .7);
  --line: rgba(148, 163, 184, .16); --line-2: rgba(56, 189, 248, .35);
  --ink: #e6edf7; --muted: #8fa3bf; --dim: #5d7091;
  --cyan: #22d3ee; --sky: #38bdf8; --gold: #fbbf24; --violet: #a78bfa;
  --ok: #34d399; --bad: #f87171; --warn: #fbbf24;
  --ok-bg: rgba(52, 211, 153, .12); --bad-bg: rgba(248, 113, 113, .12); --warn-bg: rgba(251, 191, 36, .12); --info-bg: rgba(56, 189, 248, .12);
  --grad: linear-gradient(135deg, #22d3ee 0%, #38bdf8 45%, #818cf8 100%);
  --grad-gold: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  --radius: 14px; --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  --glow: 0 0 0 1px rgba(56, 189, 248, .25), 0 10px 40px -10px rgba(34, 211, 238, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background-color: var(--bg); color: var(--ink);
  font: 15px/1.55 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background-image:
    radial-gradient(1100px 600px at 85% -10%, rgba(34, 211, 238, .14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(251, 191, 36, .09), transparent 60%),
    linear-gradient(rgba(56, 189, 248, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, .045) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
a { color: var(--sky); text-decoration: none; } a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }
::selection { background: rgba(34, 211, 238, .35); }

/* ───── Barra superior ───── */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 10px 22px; background: rgba(5, 10, 20, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .2px; color: var(--ink); }
.brand img { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(34, 211, 238, .45)); }
.brand .name { font-size: 19px; }
.brand .name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .tag { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; border-left: 1px solid var(--line); padding-left: 11px; }
@media (max-width: 640px) { .brand .tag { display: none; } }
.topbar .right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.chip-user { font-family: var(--mono); padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); color: var(--ink); }
.role { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; letter-spacing: .06em; text-transform: uppercase; }
.role.global { background: var(--grad-gold); color: #1a1405; } .role.general { background: var(--info-bg); color: var(--sky); border: 1px solid var(--line-2); }

/* ───── Layout ───── */
.wrap { max-width: 980px; margin: 28px auto; padding: 0 16px; }
.wrap.narrow { max-width: 470px; } .wrap.wide { max-width: 1320px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 18px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .8);
}
.card.glow { box-shadow: var(--glow); border-color: var(--line-2); }
h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.2px; } h2 { font-size: 18px; margin: 0 0 12px; } h3 { font-size: 13px; margin: 22px 0 10px; color: var(--sky); text-transform: uppercase; letter-spacing: .12em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gold-text { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--cyan); letter-spacing: .18em; text-transform: uppercase; }

/* ───── Formularios ───── */
label { display: block; font-weight: 600; font-size: 12.5px; margin: 14px 0 6px; color: var(--muted); letter-spacing: .02em; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink);
  background: rgba(3, 8, 18, .65); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .18); }
select option { background: var(--panel-solid); }
textarea { min-height: 170px; resize: vertical; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 680px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; margin-top: 16px; color: var(--ink); }
.check input { margin-top: 4px; accent-color: var(--cyan); width: 16px; height: 16px; }

/* ───── Botones ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px;
  padding: 10px 18px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; color: #04121c;
  background: var(--grad); box-shadow: 0 8px 24px -10px rgba(34, 211, 238, .7); transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--panel-2); color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.secondary:hover { border-color: var(--line-2); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; box-shadow: 0 8px 24px -12px rgba(248, 113, 113, .8); }
.btn.accent { background: var(--grad-gold); color: #1a1405; box-shadow: 0 8px 26px -10px rgba(251, 191, 36, .7); }
.btn.ms { background: #fff; color: #1b1b1b; box-shadow: none; } .btn.ms::before { content: ""; width: 16px; height: 16px; background:
  linear-gradient(#f25022, #f25022) 0 0/7px 7px no-repeat, linear-gradient(#7fba00, #7fba00) 9px 0/7px 7px no-repeat,
  linear-gradient(#00a4ef, #00a4ef) 0 9px/7px 7px no-repeat, linear-gradient(#ffb900, #ffb900) 9px 9px/7px 7px no-repeat; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; margin-top: 20px; padding: 12px 18px; }

.alert { padding: 11px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; border: 1px solid transparent; }
.alert.error { background: var(--bad-bg); color: #fecaca; border-color: rgba(248, 113, 113, .3); }
.alert.ok { background: var(--ok-bg); color: #a7f3d0; border-color: rgba(52, 211, 153, .3); }
.alert.warn { background: var(--warn-bg); color: #fde68a; border-color: rgba(251, 191, 36, .3); }
.alert.info { background: var(--info-bg); color: #bae6fd; border-color: var(--line-2); }
.hidden { display: none !important; }
ul.rules { padding-left: 0; list-style: none; } ul.rules li { margin: 9px 0; padding-left: 28px; position: relative; }
ul.rules li::before { content: "▸"; position: absolute; left: 6px; color: var(--cyan); }

/* ───── Portada / login ───── */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: center; max-width: 1080px; margin: 6vh auto 40px; padding: 0 18px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; margin-top: 24px; } .hero .pitch { text-align: center; } .hero .chips { justify-content: center; } .hero .logo-xl { margin: 0 auto 18px; } }
.logo-xl { width: 96px; height: 96px; filter: drop-shadow(0 0 28px rgba(34, 211, 238, .5)); animation: float 6s ease-in-out infinite; display: block; margin-bottom: 18px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pitch h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; margin: 10px 0 14px; letter-spacing: -1px; }
.pitch p.lead { font-size: 17px; color: var(--muted); max-width: 540px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { font-size: 12.5px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }
.chip i { font-style: normal; color: var(--cyan); margin-right: 5px; }
.stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.stats div b { display: block; font-size: 26px; font-family: var(--mono); } .stats div span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
@media (max-width: 860px) { .stats { justify-content: center; } }
.foot { text-align: center; color: var(--dim); font-size: 12px; margin: 30px 0; }

/* ───── Prueba ───── */
.noselect { -webkit-user-select: none; user-select: none; }
.timer { font-family: var(--mono); font-weight: 700; font-size: 19px; padding: 5px 14px; border-radius: 10px; color: var(--cyan);
  background: rgba(34, 211, 238, .08); border: 1px solid var(--line-2); text-shadow: 0 0 12px rgba(34, 211, 238, .6); }
.timer.low { color: var(--gold); border-color: rgba(251, 191, 36, .5); background: var(--warn-bg); text-shadow: 0 0 12px rgba(251, 191, 36, .6); }
.timer.critical { color: #fff; background: #dc2626; border-color: #f87171; text-shadow: none; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(248, 113, 113, .25); } }
.timebar { position: sticky; top: 57px; z-index: 39; height: 3px; background: rgba(148, 163, 184, .12); }
.timebar > i { display: block; height: 100%; width: 100%; background: var(--grad); box-shadow: 0 0 12px rgba(34, 211, 238, .8); transition: width .5s linear; }
.timebar.low > i { background: var(--grad-gold); } .timebar.critical > i { background: #ef4444; }
.exam-layout { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .exam-layout { grid-template-columns: 1fr; } }
.side { position: sticky; top: 84px; }
.qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.qnum { font-family: var(--mono); font-size: 13px; color: var(--cyan); letter-spacing: .1em; }
.qtag { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.qtext { font-size: 18px; font-weight: 550; margin-bottom: 20px; white-space: pre-line; line-height: 1.5; }
.opt { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin: 10px 0;
  cursor: pointer; background: rgba(3, 8, 18, .45); transition: border-color .15s, background .15s, transform .12s; }
.opt:hover { border-color: var(--line-2); background: rgba(56, 189, 248, .06); transform: translateX(3px); }
.opt:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.opt.sel { border-color: var(--cyan); background: rgba(34, 211, 238, .1); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .4), 0 0 24px -8px rgba(34, 211, 238, .6); }
.opt .letter { flex: 0 0 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--muted); }
.opt.sel .letter { background: var(--grad); color: #04121c; border-color: transparent; }
.nav { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; flex-wrap: wrap; }
.qgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.qgrid button { border: 1px solid var(--line); background: rgba(3, 8, 18, .5); color: var(--muted); border-radius: 7px; padding: 7px 0;
  font-family: var(--mono); font-size: 12px; cursor: pointer; transition: all .12s; }
.qgrid button:hover { border-color: var(--line-2); color: var(--ink); }
.qgrid button.done { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .5); color: #a7f3d0; }
.qgrid button.cur { outline: 2px solid var(--cyan); outline-offset: 1px; color: var(--ink); }
.progress-ring { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-ring .pct { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.mini-bar { height: 6px; background: rgba(148, 163, 184, .15); border-radius: 99px; overflow: hidden; flex: 1; }
.mini-bar > i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .3s; }
.legend { font-size: 12px; color: var(--muted); margin-top: 12px; }
.saving { font-size: 12px; color: var(--dim); min-height: 18px; font-family: var(--mono); }
.watermark { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; opacity: .05; display: flex; flex-wrap: wrap;
  align-content: flex-start; transform: rotate(-24deg) scale(1.4); }
.watermark span { font-size: 18px; font-weight: 700; padding: 40px 50px; white-space: nowrap; color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(13, 22, 40, .95); color: var(--ink);
  padding: 11px 18px; border-radius: 10px; z-index: 100; font-size: 14px; max-width: 90vw; border: 1px solid rgba(251, 191, 36, .45);
  box-shadow: 0 10px 40px -10px rgba(251, 191, 36, .45); }
.counter { font-size: 12px; color: var(--dim); text-align: right; font-family: var(--mono); }
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { font-size: 12px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); }
.steps span.on { color: #04121c; background: var(--grad); border-color: transparent; font-weight: 700; }
.steps span.done { color: var(--ok); border-color: rgba(52, 211, 153, .4); }
.bigicon { width: 84px; height: 84px; margin: 4px auto 14px; display: block; filter: drop-shadow(0 0 22px rgba(52, 211, 153, .5)); }

/* ───── Admin ───── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 11px 16px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--cyan); text-shadow: 0 0 14px rgba(34, 211, 238, .5); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 220px; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); white-space: nowrap; font-weight: 700; }
tbody tr { transition: background .12s; } tbody tr:hover td { background: rgba(56, 189, 248, .04); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.b-gray { background: rgba(148, 163, 184, .12); color: var(--muted); border-color: var(--line); }
.b-blue { background: var(--info-bg); color: #7dd3fc; border-color: rgba(56, 189, 248, .3); }
.b-green { background: var(--ok-bg); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); }
.b-red { background: var(--bad-bg); color: #fca5a5; border-color: rgba(248, 113, 113, .3); }
.b-amber { background: var(--warn-bg); color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.b-violet { background: rgba(167, 139, 250, .12); color: #c4b5fd; border-color: rgba(167, 139, 250, .3); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--grad); opacity: .7; }
.kpi .v { font-size: 30px; font-weight: 700; font-family: var(--mono); line-height: 1.1; }
.kpi .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; }
.modal-bg { position: fixed; inset: 0; background: rgba(2, 6, 14, .72); backdrop-filter: blur(6px); z-index: 200; display: flex;
  align-items: flex-start; justify-content: center; padding: 34px 12px; overflow-y: auto; }
.modal { background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 16px; width: 100%; max-width: 1000px; padding: 26px;
  position: relative; box-shadow: var(--glow); }
.modal.sm { max-width: 560px; } .modal.md { max-width: 760px; }
.modal .close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.cred { font-family: var(--mono); font-size: 17px; background: rgba(3, 8, 18, .7); border: 1px dashed var(--line-2); padding: 14px; border-radius: 10px; color: var(--cyan); }
.ans { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 10px 0; background: rgba(3, 8, 18, .35); }
.ans.ok { border-left: 3px solid var(--ok); } .ans.bad { border-left: 3px solid var(--bad); } .ans.open { border-left: 3px solid var(--gold); }
.ans ol { margin: 8px 0 0; padding-left: 24px; } .ans li { margin: 3px 0; }
.ans li.correct { color: var(--ok); font-weight: 600; } .ans li.chosen-bad { color: var(--bad); text-decoration: line-through; }
.textans { white-space: pre-wrap; background: rgba(3, 8, 18, .6); padding: 12px; border-radius: 8px; margin: 8px 0; border: 1px solid var(--line); }
.bar { height: 8px; background: rgba(148, 163, 184, .14); border-radius: 99px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--grad); }
.catrow { display: grid; grid-template-columns: 190px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; margin: 8px 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; font-size: 14px; }
.info-grid b { color: var(--dim); font-weight: 650; font-size: 11px; display: block; text-transform: uppercase; letter-spacing: .08em; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.optrow { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; margin: 7px 0; }
.optrow input[type=radio] { accent-color: var(--ok); width: 18px; height: 18px; justify-self: center; }
.optrow.correct input[type=text] { border-color: rgba(52, 211, 153, .6); box-shadow: 0 0 0 2px rgba(52, 211, 153, .12); }
.qcat { font-size: 11px; color: var(--violet); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.qrow-text { max-width: 640px; }
.qrow-ans { font-size: 12.5px; color: var(--ok); margin-top: 4px; }
.estimate { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.estimate b { color: var(--ink); font-family: var(--mono); }
.inactive td { opacity: .5; }
details summary { cursor: pointer; color: var(--sky); }

@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #111; }
  .topbar, .tabs, .toolbar, .no-print, .modal .close, .kpis { display: none !important; }
  .modal-bg { position: static; background: none; padding: 0; backdrop-filter: none; }
  .modal, .card, .ans, .textans { background: #fff !important; color: #111; box-shadow: none; border-color: #ccc; }
  .grad-text, .brand .name b { color: #0e7490; -webkit-text-fill-color: #0e7490; }
}
