/* Curso de IA — minimalista y técnico: gris neutro, esquinas rectas, líneas finas, un solo acento azul. */
:root {
  --bg: #e3e4e6;
  --paper: #f1f2f3;
  --ink: #101216;
  --muted: #5b6068;
  --line: #c2c5ca;
  --accent: #1c3fc9;
  --accent-ink: #ffffff;
  --ok: #1f6f4a;
  --warn: #b3361b;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013;
    --paper: #17181c;
    --ink: #e9ebef;
    --muted: #8e95a1;
    --line: #2c2f36;
    --accent: #7b95ff;
    --accent-ink: #0a0e1f;
    --ok: #6fcf9d;
    --warn: #ff8d73;
  }
}
* { box-sizing: border-box; }
::selection { background: var(--accent); color: var(--accent-ink); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Cabecera */
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--ink); background: var(--bg); }
header a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.brand i { width: 12px; height: 12px; background: var(--accent); display: inline-block; }
header .row { gap: 18px; font-size: 13px; font-family: var(--mono); }
header .row a { color: var(--muted); }
header .row a:hover { color: var(--ink); text-decoration: underline; }
header .row button { padding: 5px 12px; font-size: 12px; }

main { max-width: 780px; margin: 0 auto; padding: 40px 24px 96px; }

/* Tipografía */
h1 { font-size: 2.1rem; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; margin: 0 0 24px; }
h2 { font-family: var(--mono); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 36px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
h3 { font-family: var(--mono); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 28px 0 6px; }
.card h2 { font-family: var(--sans); font-size: 1.35rem; letter-spacing: -.02em; text-transform: none; color: var(--ink); margin: 0 0 8px; padding: 0; border: 0; }
.muted { color: var(--muted); }
.error { color: var(--warn); min-height: 1.4em; font-size: .92rem; margin: 6px 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--paper); border: 1px solid var(--line); padding: 1px 5px; }

/* Superficies: línea fina, sin sombras ni esquinas redondeadas */
.card { background: var(--paper); border: 1px solid var(--line); padding: 20px; margin: 14px 0; }
.card.warn { border-left: 3px solid var(--accent); }
a.module { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.module:hover { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); color: inherit; }
.card strong { font-weight: 650; }
.lock { color: var(--muted); }
.done { color: var(--ok); font-family: var(--mono); font-size: .85rem; font-weight: 600; }

/* Formularios */
label { display: block; margin: 14px 0 5px; font-family: var(--mono); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
input, textarea { width: 100%; padding: 10px 12px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 0; transition: border-color .15s; }
input:hover, textarea:hover { border-color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
button { font: inherit; font-size: .9rem; font-weight: 600; letter-spacing: .01em; padding: 9px 18px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--bg); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* Progreso: barra fina y recta */
.bar { height: 6px; background: var(--line); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .5s; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: flex-start; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .9rem; }
.row.nowrap button { flex: none; }

/* Consignas y encuesta */
ol.steps { padding-left: 0; margin: 12px 0; list-style: none; counter-reset: paso; }
ol.steps li { counter-increment: paso; position: relative; padding-left: 34px; margin: 6px 0; }
ol.steps li::before { content: counter(paso, decimal-leading-zero); position: absolute; left: 0; top: .15em; font-family: var(--mono); font-size: .78rem; color: var(--accent); font-weight: 700; }
fieldset.q { border: 0; padding: 0; margin: 20px 0; }
fieldset.q legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.opt { display: inline-flex; align-items: center; gap: 8px; margin: 3px 12px 3px 0; font-family: var(--sans); font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); cursor: pointer; }
.opt.block { display: flex; margin-right: 0; padding: 5px 0; }
.opt input { width: auto; }
.scale .opt { margin: 0; padding: 7px 18px; border: 1px solid var(--line); background: var(--bg); font-family: var(--mono); }
.scale .opt:hover { border-color: var(--ink); }
.scale .opt:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.scale .opt input { position: absolute; opacity: 0; pointer-events: none; }
.scale .opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
dt { font-weight: 600; margin-top: 12px; }
dd { margin: 2px 0 0; color: var(--muted); }

/* Contenido de los módulos */
.prose h1 { font-size: 1.9rem; }
.prose h2 { margin-top: 40px; }
.prose p, .prose li { max-width: 68ch; }
.prose pre { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 12px 14px; overflow-x: auto; margin: 14px 0; }
.prose pre code { background: none; border: 0; padding: 0; font-size: .88rem; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; margin: 16px 0; font-size: .95rem; }
.prose th { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose blockquote { margin: 16px 0; padding: 2px 16px; border-left: 3px solid var(--accent); color: var(--muted); }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }
  header .row { flex-wrap: wrap; gap: 12px; }
  main { padding: 28px 16px 72px; }
  h1 { font-size: 1.7rem; }
  .row.nowrap { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.card.locked { border-style: dashed; background: transparent; color: var(--muted); }

/* Showcase y páginas de estudiantes (siempre en iframe aislado) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.grid .card { margin: 0; }
.preview { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); background: #fff; margin-bottom: 12px; }
.preview iframe { position: absolute; top: 0; left: 0; width: 300%; height: 300%; border: 0; background: #fff; transform: scale(.3334); transform-origin: 0 0; pointer-events: none; }
input[type=file] { padding: 8px; }

/* Pantalla inicial: formulario + QR de registro */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.auth > .card { margin: 14px 0; }
.qr-card h2 { font-size: 1.15rem; margin-bottom: 14px; }
.qr-card img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #fff; margin-bottom: 12px; }
.small-note { font-size: .88rem; margin: 6px 0 0; }
@media (max-width: 860px) { .auth { grid-template-columns: minmax(0, 1fr); } .qr-card { display: none; } }
.kicker { font-family: var(--mono); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
