/* Evaluación en línea. Los colores y fuentes vienen de brand/esitec-base.css (v21). */
:root {
  --bg: var(--esi-soft); --card: #fff; --text: var(--esi-text); --muted: var(--esi-muted); --line: var(--esi-line);
  --primary: var(--esi-blue); --primary-h: var(--esi-blue-d); --danger: var(--esi-err); --ok: var(--esi-ok); --warn: var(--esi-warn);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--esi-font); font-size: 17px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
.no-select, .no-select * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-select input, .no-select textarea { -webkit-user-select: text; user-select: text; }
.hidden { display: none !important; }
.topbar #qcounter { font-weight: 600; }
.muted { color: var(--muted); }
main { width: 100%; max-width: 760px; margin: 28px auto; padding: 0 16px; position: relative; z-index: 2; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--esi-radius); padding: 28px; box-shadow: var(--esi-shadow); }
h1, h2, h3 { color: var(--esi-navy); }
h1 { font-size: 1.7rem; margin: 0 0 8px; }
h3 { margin: 20px 0 8px; font-size: 1rem; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--esi-ink); border-radius: var(--esi-radius-ctl); padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-h); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
#f-code { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.code-input { flex: 1 1 220px; font-size: 1.4rem; letter-spacing: .15em; text-transform: uppercase; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--esi-radius-ctl); font-family: var(--esi-font-mono); }
.msg { min-height: 1.4em; margin: 12px 0 0; color: var(--danger); }
.instructions { white-space: pre-wrap; margin: 12px 0; }
.rules { padding-left: 20px; margin: 0 0 16px; }
.rules li { margin: 4px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0; cursor: pointer; }
.check input { margin-top: 4px; }

.timer { height: 6px; background: #e8ebef; border-radius: 3px; overflow: hidden; margin: -8px 0 16px; }
#timer-bar { height: 100%; width: 100%; background: var(--primary); transition: width .25s linear, background-color .3s; }
#timer-bar.low { background: var(--danger); }
.qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pill { background: var(--esi-sky); color: var(--primary); border-radius: 999px; padding: 3px 12px; font-weight: 600; font-size: .9rem; }
.time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; }
.time.low { color: var(--danger); }
.qbody { font-size: 1.15rem; font-weight: 600; white-space: pre-wrap; margin-bottom: 18px; }
.qinput { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.opt:hover { border-color: #b8c2cc; }
.opt.sel { border-color: var(--primary); background: var(--esi-sky); }
.opt input { margin-top: 4px; }
.qinput input[type=text], .qinput textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.qinput textarea { min-height: 160px; resize: vertical; }
.counter { text-align: right; font-size: .85rem; color: var(--muted); }
.dd { position: relative; }
.dd-btn { width: 100%; text-align: left; display: flex; justify-content: space-between; }
.dd-list { border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; max-height: 280px; overflow: auto; background: #fff; }
.dd-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f2f4; }
.dd-item:last-child { border-bottom: 0; }
.dd-item:hover { background: #f5f7f9; }
.dd-item.sel { background: #eef4fb; color: var(--primary); font-weight: 600; }
.qfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; }
.qfoot .msg { margin: 0; }

#watermark { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: .07; background-repeat: repeat; }
body.away main { filter: blur(14px); }
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.75); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay-box { background: #fff; border-radius: 12px; padding: 28px; max-width: 420px; text-align: center; }
.overlay-box h2 { margin-top: 0; color: var(--danger); }
.warn-box { max-width: 520px; text-align: left; }
.warn-box h2 { text-align: center; }
.warn-box p { margin: 10px 0; }
.warn-box .btn { display: block; margin: 18px auto 0; }
#warn { z-index: 30; }
input, textarea { -webkit-user-drag: none; }
img { -webkit-user-drag: none; pointer-events: none; }

@media print {
  html, body { background: #fff !important; }
  body * { display: none !important; }
  body::before {
    content: "ACCIÓN NO PERMITIDA\A\A Se ha notificado al administrador de tu intento de impresión.\A\A La copia, reproducción o difusión del contenido de esta evaluación no está permitida.\A\A ESITEC se reserva el derecho de informar de este hecho a tu institución educativa y a otras dependencias e instituciones correspondientes.";
    white-space: pre-wrap; display: block; font: 20px/1.5 Arial, sans-serif; color: #000; padding: 48px;
  }
}
@media (max-width: 520px) {
  .card { padding: 20px; }
  main { margin: 16px auto; }
}

/* Calendario */
.dp-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.dp-field { flex: 1 1 200px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; }
.dp-field.on { border-color: var(--primary); background: #f2f7fd; }
.dp-lbl { font-size: .8rem; color: var(--muted); }
.dp-val { font-weight: 600; }
.dp-cal { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; max-width: 380px; }
.dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.dp-title { flex: 1; text-align: center; font-weight: 700; }
.dp-nav { padding: 4px 10px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-dow { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.dp-day { border: 0; background: none; padding: 9px 0; border-radius: 6px; cursor: pointer; font: inherit; color: var(--text); }
.dp-day:hover:not(:disabled) { background: #eef4fb; }
.dp-day.in { background: #e3eefa; }
.dp-day.sel, .dp-day.sel:hover:not(:disabled) { background: var(--primary); color: #fff; font-weight: 700; }
.dp-day:disabled { color: #c3c9d0; cursor: not-allowed; }
.dp-sum { margin-top: 8px; font-size: .9rem; }
body.shield main { filter: blur(16px); }
