
:root { --bg:#0f1a2b; --card:#18263d; --accent:#e8a838; --fg:#f5f2eb; --muted:#9aa8bc; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background:var(--bg); color:var(--fg); line-height:1.45; }
.top { position:sticky; top:0; background:rgba(15,26,43,.92); backdrop-filter:blur(8px); padding:12px 16px; border-bottom:1px solid #243552; z-index:5; }
.top a { color:var(--accent); text-decoration:none; font-weight:600; }
.wrap { max-width:720px; margin:0 auto; padding:16px 16px 48px; }
h1 { font-size:1.55rem; margin:0 0 8px; }
h2 { font-size:1.15rem; margin:28px 0 10px; color:var(--accent); }
.sub { color:var(--muted); margin:0 0 20px; font-size:.95rem; }
.card { background:var(--card); border:1px solid #243552; border-radius:14px; padding:14px; margin:0 0 14px; }
.card h3 { margin:0 0 6px; font-size:1.05rem; }
.meta { color:var(--muted); font-size:.85rem; margin:0 0 10px; }
video { width:100%; border-radius:10px; background:#000; }
.btn { display:inline-block; margin-top:8px; padding:10px 14px; background:var(--accent); color:#1a1205; border-radius:10px; text-decoration:none; font-weight:700; }
.grid { display:grid; gap:12px; }
@media (min-width:640px){ .grid-2 { grid-template-columns:1fr 1fr; } }
.badge { display:inline-block; font-size:.75rem; padding:3px 8px; border-radius:999px; background:#243552; color:var(--muted); }
.prose p { margin:.55em 0; }
.prose blockquote { border-left:3px solid var(--accent); margin:12px 0; padding:6px 12px; color:var(--muted); }
.note { font-size:.9rem; color:var(--muted); background:#121e30; border-radius:10px; padding:12px; }

.comments { background:#121e30; border:1px solid #243552; border-radius:14px; padding:14px; margin-top:16px; }
.comments h3 { margin:0 0 8px; font-size:1.05rem; color:var(--accent); }
.comments label { display:block; font-size:.85rem; color:var(--muted); margin:10px 0 4px; }
.comments textarea, .comments select, .comments input {
  width:100%; border-radius:10px; border:1px solid #243552; background:#0f1a2b; color:var(--fg);
  padding:10px; font:inherit;
}
.comments textarea { min-height:90px; resize:vertical; }
.comments .who { display:grid; gap:10px; grid-template-columns:1fr 1fr; }
@media (max-width:520px){ .comments .who { grid-template-columns:1fr; } }
.comments button {
  margin-top:12px; width:100%; padding:12px; border:0; border-radius:10px;
  background:var(--accent); color:#1a1205; font-weight:700; font-size:1rem;
}
.comments .hint { font-size:.85rem; color:var(--muted); margin-top:10px; }
.okmsg { display:none; margin-top:10px; color:#8ddea0; font-size:.9rem; }

.tema {
  border: 1px solid #243552;
  border-radius: 16px;
  padding: 14px 14px 4px;
  margin: 0 0 22px;
  background: #121e30;
}
.tema > .tema-title {
  margin: 0 0 4px;
  font-size: 1.12rem;
  color: var(--accent);
  font-weight: 700;
}
.tema > .tema-meta {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 12px;
}
.seq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  align-items: center;
}
.seq .step {
  display: inline-block;
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #243552;
  color: var(--muted);
  font-weight: 600;
}
.seq .step.live {
  background: #2a4a6e;
  color: #d6e4f5;
}
.seq .step.now {
  background: var(--accent);
  color: #1a1205;
}
.seq .arrow {
  color: #3a4f6e;
  font-size: .85rem;
}
.nav-materias a.card { color: inherit; text-decoration: none; }
.coming-note {
  font-size: .9rem;
  color: var(--muted);
  border: 1px dashed #243552;
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 14px;
  background: #0f1a2b;
}

/* Home: entrada por ámbito */
a.card.home-card { display:block; text-decoration:none; color:inherit; transition:border-color .15s, transform .15s; }
a.card.home-card:hover { border-color: var(--accent); transform: translateY(-1px); }
a.card.home-card .btn { pointer-events:none; }
.home-ambitos { margin-bottom: 8px; }
@media (min-width:640px){
  .home-ambitos { grid-template-columns: 1fr; }
}
.hoy-hint { font-size: .9rem; color: var(--muted); margin: 18px 0 8px; }
.coming-note { font-size: .9rem; color: var(--muted); margin: 12px 0 20px; }

/* —— Exam form (SIM-S01 interactive) —— */
.top-right { float: right; }
.exam-page { padding-bottom: 88px; }
.exam-wrap { max-width: 740px; }
.exam-official {
  text-align: center;
  border: 1px solid #243552;
  border-radius: 14px;
  padding: 14px 12px;
  margin: 0 0 14px;
  background: #121e30;
}
.exam-gov { margin: 0; font-size: .78rem; letter-spacing: .04em; color: var(--muted); }
.exam-consej { margin: 2px 0 10px; font-size: .85rem; color: var(--muted); }
.exam-official h1 { font-size: 1.25rem; margin: 0 0 6px; }
.exam-ambito { margin: 0 0 8px; }
.exam-persist-note { margin-bottom: 14px; }
.exam-form h2 { margin-top: 0; font-size: 1.08rem; }
.exam-form fieldset {
  border: 0;
  margin: 16px 0 0;
  padding: 0;
}
.exam-form legend {
  padding: 0;
  margin: 0 0 8px;
  font-size: .98rem;
  line-height: 1.4;
}
.exam-form .pts { color: var(--muted); font-weight: 500; font-size: .85rem; }
.exam-form label.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  margin: 0 0 8px;
  background: #0f1a2b;
  border: 1px solid #243552;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
  font-size: .95rem;
}
.exam-form label.opt:has(input:checked) {
  border-color: var(--accent);
  background: #1a2a44;
}
.exam-form label.opt input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.exam-form input[type="text"],
.exam-form textarea,
.exam-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #243552;
  background: #0f1a2b;
  color: var(--fg);
  padding: 12px;
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
}
.exam-form textarea { min-height: 110px; resize: vertical; }
.exam-form fieldset.q > label:not(.opt) {
  display: block;
  margin: 8px 0;
  color: var(--muted);
  font-size: .88rem;
}
.exam-who-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 520px) {
  .exam-who-row { grid-template-columns: 1fr; }
}
.exam-datos label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 4px; }
.exam-datos .hint { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }
.exam-instr { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: .92rem; }
.exam-instr li { margin: 0 0 6px; }
.exam-doc {
  background: #0f1a2b;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  margin: 0 0 8px;
  font-size: .92rem;
}
.exam-doc h3 { margin: 0 0 8px; font-size: .95rem; color: var(--accent); }
.exam-doc ul { margin: 0; padding-left: 1.1em; }
.exam-doc blockquote { margin: 0; color: var(--muted); border: 0; padding: 0; }
.exam-fin { color: var(--muted); font-size: .9rem; margin: 18px 0 8px; }
.exam-secondary { margin-bottom: 24px; }
.exam-secondary a { color: var(--accent); }
.exam-actions {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(15,26,43,.96);
  border-top: 1px solid #243552;
  backdrop-filter: blur(8px);
  z-index: 20;
  max-width: 740px;
  margin: 0 auto;
}
@media (max-width: 420px) {
  .exam-actions { grid-template-columns: 1fr 1fr; }
}
.btn-exam {
  border: 0;
  border-radius: 10px;
  padding: 12px 8px;
  font-weight: 700;
  font-size: .9rem;
  min-height: 48px;
  cursor: pointer;
  font-family: inherit;
}
.btn-pri { background: var(--accent); color: #1a1205; }
.btn-sec { background: #243552; color: var(--fg); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid #243552; }
.exam-status {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  max-width: 716px;
  margin: 0 auto;
  font-size: .82rem;
  color: #8ddea0;
  text-align: center;
  pointer-events: none;
  z-index: 19;
}
.exam-confirm {
  background: #1a3a2a;
  border: 1px solid #2d6b4a;
  color: #c8f0d4;
  border-radius: 12px;
  padding: 14px;
  margin: 0 0 18px;
  font-size: .95rem;
}

/* Evaluaciones section inside aula */
.evals {
  border: 1px solid #243552;
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 22px;
  background: #121e30;
}
.evals > .tema-title { margin: 0 0 4px; font-size: 1.12rem; color: var(--accent); font-weight: 700; }
.evals > .tema-meta { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.evals .btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.evals .btn-row a.btn-secondary {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #243552;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}
.placeholder-slot {
  border: 1px dashed #243552;
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
  font-size: .92rem;
  background: #0f1a2b;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
a.btn-secondary {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #243552;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}
.exam-guide h3 { margin: 16px 0 8px; font-size: 1rem; color: var(--accent); }
.exam-ack {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  background: #0f1a2b;
  border: 1px solid #243552;
  border-radius: 12px;
  cursor: pointer;
  font-size: .95rem;
  min-height: 48px;
}
.exam-ack input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
#btn-start-exam:disabled { opacity: .45; cursor: not-allowed; }

/* —— Learner profiles —— */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.top-profile { margin-left: auto; }
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .85rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #243552;
  color: var(--fg);
  white-space: nowrap;
}
.profile-chip-label { font-weight: 600; }
.profile-chip-change { color: var(--accent); text-decoration: none; font-weight: 600; }
.profile-chip-change:hover { text-decoration: underline; }

.profile-pick { margin: 0 0 22px; }
.profile-pick h2 { margin-top: 0; }
.profile-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 520px) {
  .profile-grid { grid-template-columns: 1fr 1fr; }
}
button.card.profile-card,
a.card.profile-card {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, transform .15s, background .15s;
  background: var(--card);
  border: 1px solid #243552;
  border-radius: 14px;
  padding: 18px 16px;
}
button.card.profile-card:hover,
a.card.profile-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: #1a2a44;
}
.profile-card .profile-emoji {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 6px;
}
.profile-card h3 { margin: 0 0 4px; font-size: 1.25rem; }
.profile-card .meta { margin: 0; }
.profile-active-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: #121e30;
  border: 1px solid #243552;
  border-radius: 12px;
  font-size: .95rem;
}
.profile-active-banner strong { color: var(--accent); }
.profile-active-banner .btn-change {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #243552;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  font-size: .88rem;
}
.home-main.hidden { display: none; }

.progress-panel {
  background: #121e30;
  border: 1px solid #243552;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 18px;
}
.progress-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 6px;
}
.progress-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.progress-list li {
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #2a4a6e;
  color: #d6e4f5;
  font-weight: 600;
}
.exam-form select:disabled {
  opacity: .85;
  cursor: not-allowed;
}


/* Deep check + submit feedback */
.deep-check {
  margin: 12px 0 4px;
  padding: 12px 14px;
  background: #0f1a2b;
  border: 1px solid #2a4a6e;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.deep-check h4 {
  margin: 0 0 6px;
  font-size: .92rem;
  color: var(--accent);
}
.deep-q {
  margin: 0;
  font-size: .95rem;
  color: var(--fg);
  line-height: 1.45;
}
.comments textarea[name="comprobacion"] {
  min-height: 110px;
  border-color: #3a5a80;
}
.okmsg { display:none; margin-top:10px; font-size:.9rem; padding:10px 12px; border-radius:10px; }
.okmsg-ok { display:block; color:#8ddea0; background:rgba(80,140,90,.18); border:1px solid #3a6a48; }
.okmsg-err { display:block; color:#f0b0a0; background:rgba(140,60,50,.2); border:1px solid #6a3a32; }
.okmsg-warn { display:block; color:#e8c878; background:rgba(120,100,40,.18); border:1px solid #6a5a28; }
.exam-confirm.ok {
  border-color: #3a6a48;
  background: rgba(80,140,90,.15);
}
.exam-confirm.err {
  border-color: #6a3a32;
  background: rgba(140,60,50,.15);
}
.btn-exam:disabled, .comments button:disabled {
  opacity: .65;
  cursor: wait;
}
