/* Mirol — fundación. Sistema visual de la casa: azul marino y naranja
   Fusanya, tarjetas como patrón único, diseño fluido. */

:root {
  --navy: #0c1c33;
  --navy-2: #10243e;
  --orange: #e87722;
  --orange-soft: #e8a05c;
  --ink: #16283d;
  --muted: #5d7186;
  --line: #dde5ec;
  --bg: #f2f5f8;
  --card: #ffffff;
  --ok: #1d7a4f;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Barra superior ---------- */
.topbar { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #eef2f7; }
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(232,119,34,.55); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 24px; font-weight: 700; letter-spacing: 3px; line-height: 1.1; }
.brand-sub { font-size: 12px; letter-spacing: 1.6px; color: var(--orange-soft); }
.topbar-controls { display: flex; gap: 14px; flex-wrap: wrap; }
.control { display: flex; flex-direction: column; gap: 4px; font-size: 12px; letter-spacing: 1.2px; color: #9fb2c8; }
.control select {
  font-size: 16px; padding: 7px 10px; border-radius: 9px; border: 1px solid rgba(238,242,247,.25);
  background: var(--navy-2); color: #eef2f7; max-width: 240px;
}
.tabs { max-width: 1080px; margin: 0 auto; padding: 0 20px 12px; display: flex; gap: 8px; }
.tabs[hidden] { display: none; }
.tab {
  font-size: 15px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(238,242,247,.35); background: transparent; color: #eef2f7;
}
.tab.active { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }

/* ---------- Contenedor y tarjetas ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 48px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
h1.page-title { font-size: 28px; margin: 4px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 18px; }
.level-title {
  font-size: 13px; letter-spacing: 2.4px; color: var(--orange); font-weight: 700;
  margin: 26px 0 10px; text-transform: uppercase;
}
.course-title { font-size: 19px; margin: 0 0 4px; }
.course-meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  font-size: 16px; cursor: pointer; color: var(--ink);
}
.lesson-card:hover { border-color: var(--orange-soft); }
.lesson-card.locked { cursor: not-allowed; opacity: .62; background: #f6f8fa; }
.lesson-card .lesson-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #eef3f8; color: var(--navy-2);
}
.lesson-card.completed .lesson-ico { background: #e2f2e9; color: var(--ok); }
.lesson-card.available .lesson-ico { background: #fdeadb; color: var(--orange); }
.lesson-card .lesson-main { flex: 1 1 auto; min-width: 0; }
.lesson-card .lesson-name { font-weight: 600; display: block; }
.lesson-card .lesson-state { font-size: 13.5px; color: var(--muted); display: block; }

/* ---------- Progreso ---------- */
.progress-wrap { display: flex; align-items: center; gap: 14px; }
.progress-bar { flex: 1; height: 12px; border-radius: 999px; background: #e4ebf1; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--orange), #c9a227); border-radius: 999px; }
.progress-num { font-weight: 700; color: var(--navy-2); white-space: nowrap; }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-block; font-size: 16px; padding: 10px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none;
}
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger { border-color: #b3261e; color: #b3261e; }
.btn-small { padding: 6px 12px; font-size: 14.5px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 14px; font-weight: 600; color: var(--navy-2); }
.field input, .field select, .field textarea {
  font-size: 16px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-family: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Reproductor ---------- */
.player-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.player-title { font-size: 22px; margin: 0; }
.player-box { background: var(--navy); border-radius: var(--radius); overflow: hidden; }
.player-box video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.narration { padding: 34px 26px; text-align: center; color: #eef2f7; }
.narration-cue { font-size: clamp(19px, 3.4vw, 27px); line-height: 1.5; min-height: 84px; display: flex; align-items: center; justify-content: center; }
.narration-controls { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.narration-progress { flex: 1; height: 8px; background: rgba(238,242,247,.2); border-radius: 999px; overflow: hidden; }
.narration-fill { height: 100%; background: var(--orange); }
.cue-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cue-item { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-size: 15px; cursor: pointer; }
.cue-item.active { border-color: var(--orange); background: #fdf3e7; }
.player-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Certificado y eventos ---------- */
.cert-banner { border-color: var(--orange-soft); background: linear-gradient(160deg, #fff8ef, #fff); }
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fbfcfd; }
.event-item .event-type { font-weight: 700; color: var(--navy-2); }
.event-item .event-meta { font-size: 13.5px; color: var(--muted); }
.badge {
  display: inline-block; font-size: 12.5px; padding: 2px 9px; border-radius: 999px;
  background: #eef3f8; color: var(--navy-2); letter-spacing: .4px;
}
.badge-queued { background: #fdf3e7; color: #9a5410; }

/* ---------- Autor ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--navy-2); font-size: 13.5px; letter-spacing: .6px; }
.table-scroll { overflow-x: auto; }
.section-title { font-size: 20px; margin: 26px 0 10px; }
.notice { background: #fdf3e7; border: 1px solid var(--orange-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.error { background: #fdecea; border: 1px solid #b3261e; color: #7a1a14; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }

/* ---------- Diálogo del certificado ---------- */
.cert-dialog { border: none; border-radius: 18px; padding: 0; max-width: 480px; width: calc(100% - 40px); }
.cert-dialog::backdrop { background: rgba(10, 21, 36, .66); }
.cert-dialog-body { padding: 30px 28px; text-align: center; }
.cert-dialog-mark { width: 72px; height: 72px; border-radius: 50%; }
.cert-dialog-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.footer { text-align: center; color: var(--muted); font-size: 13.5px; padding: 18px; }
