/* Entornos de Desarrollo — aula virtual */
:root {
  --bg: #0f1420;
  --panel: #1a2233;
  --panel2: #212b40;
  --border: #2e3b55;
  --text: #e6ebf5;
  --muted: #93a1bd;
  --accent: #4f8cff;
  --accent2: #37c978;
  --danger: #e5534b;
  --warn: #d9a037;
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.top {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 1.4rem;
  background: linear-gradient(120deg, #16213a, #101827);
  border-bottom: 1px solid var(--border);
}
header.top .logo { font-size: 1.35rem; font-weight: 700; }
header.top .logo span { color: var(--accent); }
header.top .sub { color: var(--muted); font-size: .9rem; }
header.top nav { margin-left: auto; display: flex; gap: .6rem; align-items: center; }

.btn {
  display: inline-block; padding: .45rem .9rem; border-radius: .5rem;
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  cursor: pointer; font-size: .92rem;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.success { background: var(--accent2); border-color: var(--accent2); color: #08210f; font-weight: 600; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

main { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }

.hero {
  background: var(--panel); border: 1px solid var(--border); border-radius: .8rem;
  padding: 1.4rem 1.6rem; margin-bottom: 1.6rem;
}
.hero h1 { margin: 0 0 .3rem; font-size: 1.6rem; }
.hero p { margin: .2rem 0; color: var(--muted); }

.trim-title {
  margin: 1.8rem 0 .7rem; font-size: 1.1rem; color: var(--accent);
  border-bottom: 1px solid var(--border); padding-bottom: .3rem;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--border);
  border-radius: .7rem; padding: .9rem 1rem; color: var(--text);
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.card.locked { opacity: .45; }
.card .num { font-size: .75rem; color: var(--muted); }
.card h3 { margin: .15rem 0 .3rem; font-size: 1rem; }
.card .tags { display: flex; gap: .4rem; font-size: .72rem; }
.tag { background: var(--panel2); border: 1px solid var(--border); border-radius: 1rem; padding: .05rem .55rem; color: var(--muted); }
.tag.on { color: var(--accent2); border-color: var(--accent2); }
.tag.off { color: var(--warn); }

.tabs { display: flex; gap: .4rem; margin: 1.2rem 0; border-bottom: 1px solid var(--border); }
.tabs button {
  background: none; border: none; color: var(--muted); font-size: 1rem;
  padding: .55rem 1rem; cursor: pointer; border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: .8rem; padding: 1.2rem 1.4rem; }

/* markdown */
.md h2 { color: var(--accent); margin: 1.4rem 0 .5rem; font-size: 1.25rem; }
.md h3 { color: #9db9f5; margin: 1.1rem 0 .4rem; font-size: 1.05rem; }
.md p { margin: .55rem 0; }
.md ul, .md ol { margin: .5rem 0; padding-left: 1.4rem; }
.md li { margin: .25rem 0; }
.md code { background: #0b0f1a; border: 1px solid var(--border); border-radius: .3rem; padding: .05rem .35rem; font-size: .88em; }
.md pre { background: #0b0f1a; border: 1px solid var(--border); border-radius: .6rem; padding: .9rem 1rem; overflow-x: auto; }
.md pre code { background: none; border: none; padding: 0; }
.md table { border-collapse: collapse; margin: .7rem 0; }
.md th, .md td { border: 1px solid var(--border); padding: .35rem .7rem; }
.md th { background: var(--panel2); }

/* test */
.q { border: 1px solid var(--border); border-radius: .6rem; padding: .8rem 1rem; margin: .8rem 0; background: var(--panel2); }
.q .qt { font-weight: 600; margin-bottom: .4rem; }
.q label { display: block; padding: .3rem .5rem; border-radius: .4rem; cursor: pointer; }
.q label:hover { background: rgba(79, 140, 255, .1); }
.q label.ok { background: rgba(55, 201, 120, .18); }
.q label.ko { background: rgba(229, 83, 75, .18); }
.score { font-size: 1.2rem; font-weight: 700; padding: .8rem 1rem; border-radius: .6rem; margin: 1rem 0; }
.score.pass { background: rgba(55, 201, 120, .15); color: var(--accent2); }
.score.fail { background: rgba(229, 83, 75, .15); color: var(--danger); }

input[type=text], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: .5rem .7rem; border-radius: .5rem;
  border: 1px solid var(--border); background: #0b0f1a; color: var(--text);
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.field { margin: .7rem 0; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

.notice { padding: .7rem 1rem; border-radius: .6rem; margin: .8rem 0; }
.notice.ok { background: rgba(55, 201, 120, .15); color: var(--accent2); }
.notice.err { background: rgba(229, 83, 75, .15); color: var(--danger); }
.notice.info { background: rgba(79, 140, 255, .12); color: #9db9f5; }

table.list { width: 100%; border-collapse: collapse; margin: .8rem 0; }
table.list th, table.list td { border-bottom: 1px solid var(--border); padding: .45rem .6rem; text-align: left; font-size: .9rem; }
table.list th { color: var(--muted); font-weight: 600; }

.switch { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 38px; height: 20px; border-radius: 1rem; background: var(--panel2); border: 1px solid var(--border); position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: left .15s, background .15s; }
.switch input:checked + .track { background: var(--accent2); border-color: var(--accent2); }
.switch input:checked + .track::after { left: 20px; background: #fff; }

.admin-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.admin-menu button { display: block; width: 100%; text-align: left; margin-bottom: .4rem; }
.admin-menu button.active { border-color: var(--accent); color: var(--accent); }
.editor textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.test-edit .q { background: var(--panel); }
small.muted { color: var(--muted); }

@media (max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr; }
  main { padding: 1rem .7rem 3rem; }
}
