/* dominio-at/styles.css — sin dependencias */
:root {
  --bg: #f6f3ea;
  --card: #ffffff;
  --ink: #2a2620;
  --muted: #7c766a;
  --line: #e7e1d4;
  --accent: #2f6f4f;
  --accent-2: #1f4f38;
  --accent-soft: #e4efe8;
  --good: #2e9e5b;
  --bad: #d0453b;
  --mid: #d9971f;
  --ring-bg: #e7e1d4;
  --shadow: 0 6px 20px rgba(42, 38, 32, .07);
  --radius: 16px;
  --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --card: #1f2225;
    --ink: #eceae4;
    --muted: #9b968c;
    --line: #2c3034;
    --accent: #5ec08c;
    --accent-2: #7fd3a6;
    --accent-soft: #223027;
    --ring-bg: #2c3034;
    --shadow: 0 6px 20px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: var(--maxw); margin: 0 auto; padding: 0 14px 40px; }
h1, h2, h3, h4 { line-height: 1.2; margin: .2em 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: .4em 0; }
button { font: inherit; cursor: pointer; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }

/* ---------- Botones ---------- */
.btn {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 11px 16px; font-weight: 600; transition: .15s transform, .15s background;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.tiny { padding: 6px 10px; font-size: .85rem; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: none; color: var(--accent); font-weight: 700; padding: 0; text-align: left; }
.file-label { display: inline-block; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin: 14px 0;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px; margin-bottom: 6px;
  background: linear-gradient(var(--bg), var(--bg) 70%, transparent);
}
.topbar .tb-title { font-weight: 700; flex: 1; text-align: center; font-size: .95rem; }
.topbar .tb-count { font-weight: 700; color: var(--muted); font-size: .85rem; min-width: 44px; text-align: right; }
.topbar .tb-right { display: flex; gap: 6px; }
.brand-mini { font-weight: 800; letter-spacing: .2px; }

/* ---------- Login ---------- */
.login-wrap { max-width: 420px; margin: 6vh auto 0; }
.brand { text-align: center; margin-bottom: 18px; }
.brand-mark { font-size: 3rem; line-height: 1; }
.brand h1 { margin: .3em 0 0; letter-spacing: -.5px; }
.login-card h2 { margin-top: 0; }
.login-card label { display: block; margin: 12px 0; font-weight: 600; font-size: .9rem; }
.login-card input { margin-top: 6px; }
.login-links { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.error { color: var(--bad); font-size: .88rem; min-height: 1.1em; margin: 8px 0 0; }

/* ---------- Home ---------- */
.hero { display: flex; align-items: center; gap: 18px; }
.hero-ring { flex: 0 0 auto; }
.hero-info h2 { margin: 0 0 2px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.stat {
  background: var(--accent-soft); color: var(--accent-2); border-radius: 999px;
  padding: 4px 10px; font-size: .82rem; font-weight: 600;
}
.stats.center { justify-content: center; }
.ring-txt { font-size: 1.35rem; font-weight: 800; fill: var(--ink); }

.bloque { margin: 22px 0; }
.bloque h3 { display: flex; align-items: center; gap: 8px; }
.bloque-emoji { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.pasaje-card {
  text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
}
.pasaje-card:hover { border-color: var(--accent); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-frase { font-size: .85rem; color: var(--muted); }
.ref { font-weight: 800; color: var(--ink); }
.badge { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 3px 8px; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--accent-soft); color: var(--good); }
.badge.mid { background: #f6ecd6; color: var(--mid); }

.bar { height: 8px; background: var(--ring-bg); border-radius: 999px; overflow: hidden; }
.bar.big { height: 12px; }
.bar.mini { height: 6px; flex: 1; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.foot { text-align: center; margin-top: 26px; }

/* ---------- Detalle de pasaje ---------- */
.estudio blockquote {
  margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0; font-style: italic;
}
.ref-tag { background: var(--accent-soft); color: var(--accent-2); font-weight: 800; border-radius: 8px; padding: 3px 9px; font-size: .82rem; }
.ref-tag.big { font-size: 1rem; }
.situacion, .principio { font-size: .92rem; }
.sec-title { margin: 18px 0 8px; }
.fases { display: flex; flex-direction: column; gap: 8px; }
.fase-row {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px;
}
.fase-row:not(.locked):hover { border-color: var(--accent); }
.fase-row.done { border-color: var(--good); }
.fase-row.locked { opacity: .55; }
.fase-n {
  flex: 0 0 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-2); font-weight: 800;
}
.fase-row.done .fase-n { background: var(--good); color: #fff; }
.fase-txt { flex: 1; display: flex; flex-direction: column; }
.fase-txt small { color: var(--muted); }
.fase-go { font-weight: 700; font-size: .82rem; color: var(--accent); }
.fase-row.test { border-style: dashed; }

/* ---------- Sesión ---------- */
.session { max-width: 620px; margin: 0 auto; }
.item-card { min-height: 260px; }
.item-tipo { font-size: .75rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--accent); }
.enunciado { font-size: 1.05rem; margin: 8px 0 14px; }
.ref-hint { font-weight: 800; color: var(--accent-2); }
.opciones { display: flex; flex-direction: column; gap: 9px; }
.opcion {
  text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px;
}
.opcion:hover:not(:disabled) { border-color: var(--accent); }
.opcion.correcta { border-color: var(--good); background: #e8f7ee; color: #14602f; }
.opcion.incorrecta { border-color: var(--bad); background: #fdeceb; color: #8f241d; }

.gap-frase { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; font-size: 1.05rem; align-items: center; }
.gap-frase .palabra { padding: 3px 2px; }
.blank { display: inline-flex; align-items: center; }
.blank-input {
  width: auto; display: inline-block; border: none; border-bottom: 2.5px solid var(--accent);
  border-radius: 0; background: transparent; padding: 2px 6px; text-align: center; font-weight: 700;
}
.blank-input:focus { outline: none; border-color: var(--accent-2); background: var(--accent-soft); }
.modo-toggle { display: flex; gap: 4px; background: var(--accent-soft); padding: 4px; border-radius: 12px; margin: 10px 0; }
.modo-toggle button { flex: 1; border: none; background: transparent; padding: 8px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.modo-toggle button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.slot {
  min-width: 72px; border-bottom: 2.5px solid var(--accent); padding: 3px 8px; border-radius: 6px 6px 0 0;
  background: var(--accent-soft); min-height: 1.6em; display: inline-flex; align-items: center; justify-content: center;
}
.slot.filled { font-weight: 700; }
.banco { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 600;
}
.chip:hover:not(:disabled) { border-color: var(--accent); }
.chip.used { opacity: .35; }
.orden-build {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 54px; padding: 10px;
  border: 1.5px dashed var(--line); border-radius: 12px; margin: 12px 0; background: var(--card);
}
.token { background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--accent-2); border-radius: 999px; padding: 8px 14px; font-weight: 600; }
.pista { background: var(--accent-soft); padding: 8px 12px; border-radius: 10px; font-size: .9rem; }
textarea { resize: vertical; margin-top: 10px; }

/* ---------- Feedback ---------- */
.feedback { border-radius: 14px; padding: 14px; margin-top: 14px; }
.feedback.show { display: block; }
.feedback.ok { background: #e8f7ee; border: 1.5px solid var(--good); }
.feedback.bad { background: #fdeceb; border: 1.5px solid var(--bad); }
@media (prefers-color-scheme: dark) {
  .feedback.ok { background: #16281d; } .feedback.bad { background: #2a1a19; }
  .opcion.correcta { background: #16281d; color: #a9e6c2; }
  .opcion.incorrecta { background: #2a1a19; color: #f0b6b1; }
}
.fb-head { font-weight: 800; font-size: 1.05rem; }
.combo { color: var(--mid); }
.fb-ans { margin: 6px 0; }

/* ---------- Resultado ---------- */
.result { max-width: 560px; margin: 4vh auto; text-align: center; }
.result-emoji { font-size: 3.2rem; }
.result .score { font-size: 1.1rem; font-weight: 700; }
.result-btns { margin-top: 16px; }
.errores { text-align: left; }
.errores ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Profe ---------- */
.teacher { padding-bottom: 30px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { margin: 0; text-align: center; padding: 12px 8px; }
.kpi b { display: block; font-size: 1.5rem; }
.kpi span { font-size: .78rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-grid .btn { grid-column: span 2; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .btn { grid-column: span 1; } }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; padding: 6px 4px; border-bottom: 1.5px solid var(--line); }
.tabla td { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.fallos, .tests-list { margin: 6px 0 0; padding-left: 18px; }
.det-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.det-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.det-lvl { font-size: .78rem; font-weight: 700; color: var(--muted); min-width: 78px; text-align: right; }
.det-lvl.ok { color: var(--good); }
.det-lvl.mid { color: var(--mid); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
