/* Morpheo Academia · estilos */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(/assets/fonts/poppins-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(/assets/fonts/poppins-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+20A0-20C0; }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url(/assets/fonts/poppins-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url(/assets/fonts/poppins-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url(/assets/fonts/poppins-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }

:root {
  --bg: #05040b;
  --bg-2: #0a0716;
  --surface: #110c22;
  --surface-2: #1a1233;
  --border: #2b2050;
  --border-hi: #4a3585;
  --text: #ffffff;
  --text-2: #d6d2ee;
  --muted: #a49ec8;
  --accent: #ff2bd6;
  --accent-2: #22e6ff;
  --purple: #7b2bff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 43, 214, .14);
  --grad: linear-gradient(90deg, #ff2bd6, #7b2bff);
  --grad-btn: linear-gradient(90deg, #c4119f, #6a1fe6);
  --grad-bar: linear-gradient(90deg, #ff2bd6, #22e6ff);
  --glow: 0 0 0 1px rgba(255, 43, 214, .45), 0 0 22px rgba(255, 43, 214, .35);
  --good: #3ddc97;
  --bad: #ff5c7a;
  --warn: #ffc857;
  --hand: 'Permanent Marker', 'Comic Sans MS', cursive;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@font-face { font-family: 'Permanent Marker'; font-weight: 400; font-display: swap; src: url(/assets/fonts/permanent-marker-400-latin.woff2) format('woff2'); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  background: radial-gradient(1000px 520px at 50% -12%, rgba(123, 43, 255, .32), transparent 70%),
              radial-gradient(700px 400px at 100% 100%, rgba(255, 43, 214, .10), transparent 70%), var(--bg);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.neon { background: var(--grad-bar); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1; }

/* ---------- carga ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 60px 0; display: grid; place-items: center; }

/* ---------- botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s; min-height: 42px;
}
.btn:hover { border-color: var(--border-hi); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad-btn); border-color: transparent; color: #fff; box-shadow: 0 0 18px rgba(255, 43, 214, .35); }
.btn-primary:hover { background: var(--grad-btn); border-color: transparent; box-shadow: var(--glow), 0 0 30px rgba(123, 43, 255, .4); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(255, 117, 132, .45); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 117, 132, .1); border-color: var(--bad); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .85rem; border-radius: 8px; }
.btn-icon { padding: 6px; min-height: 34px; min-width: 34px; }
.btn-block { width: 100%; }

label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; min-height: 42px; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 100px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.error-box { background: rgba(255, 117, 132, .1); border: 1px solid rgba(255, 117, 132, .4); color: #ffc2c9; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }
.ok-box { background: rgba(61, 220, 151, .1); border: 1px solid rgba(61, 220, 151, .4); color: #b8f5da; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }

/* ---------- inicio de sesión ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 15% 10%, rgba(123, 43, 255, .45), transparent 45%),
              radial-gradient(circle at 85% 95%, rgba(255, 43, 214, .25), transparent 45%), #07040f;
  border-right: 1px solid var(--border);
}
.auth-brand h1 { font-size: clamp(2rem, 4vw, 3rem); max-width: 14ch; }
.auth-brand h1 span { background: var(--grad-bar); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-logo { width: min(280px, 60%); border-radius: 18px; box-shadow: 0 0 40px rgba(123, 43, 255, .45); margin-bottom: 24px; }
.hand { font-family: var(--hand); color: var(--accent); font-size: 1.25rem; transform: rotate(-4deg); display: inline-block; text-shadow: 0 0 12px rgba(255, 43, 214, .6); }
.auth-brand ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.auth-brand li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.auth-brand li svg { color: var(--accent); flex: none; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.6rem; }

/* ---------- marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand b { font-weight: 700; letter-spacing: .14em; font-size: 1rem; }
.brand small { display: block; font-size: .62rem; letter-spacing: .32em; color: var(--accent); text-shadow: 0 0 10px rgba(255, 43, 214, .6); font-weight: 600; margin-top: -2px; }

/* ---------- barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(5, 4, 11, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 24px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 8px 14px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.nav a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.nav a[aria-current=page] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.user-menu { margin-left: auto; position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 10px; }
.user-btn:hover { background: var(--surface); }
.user-btn .name { font-size: .9rem; font-weight: 500; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; display: none; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; cursor: pointer; font-size: .9rem; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.mobile-nav { display: none; }

/* ---------- páginas ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 32px 20px 64px; }
.page-head { margin-bottom: 28px; }
.page-head p { color: var(--muted); margin: 0; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 16px; }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* ---------- tarjetas de curso ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.course-card { display: flex; flex-direction: column; color: var(--text); transition: transform .15s, border-color .15s; }
.course-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; }
.cover { aspect-ratio: 16 / 9; background: radial-gradient(circle at 30% 20%, rgba(123, 43, 255, .55), transparent 60%), linear-gradient(135deg, #2a0f4d, #0c0619); position: relative; overflow: hidden; display: grid; place-items: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph { font-weight: 800; font-size: 2.4rem; color: var(--accent); text-shadow: 0 0 18px rgba(255, 43, 214, .7); letter-spacing: .05em; }
.cover .badge { position: absolute; top: 10px; left: 10px; }
.course-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card h3 { margin: 0; font-size: 1rem; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.accent { background: var(--accent-soft); color: #ff7be6; border-color: rgba(255, 43, 214, .4); }
.badge.good { background: rgba(61, 220, 151, .12); color: var(--good); border-color: rgba(61, 220, 151, .3); }
.badge.bad { background: rgba(255, 117, 132, .12); color: var(--bad); border-color: rgba(255, 117, 132, .3); }
.badge.warn { background: rgba(255, 200, 87, .12); color: var(--warn); border-color: rgba(255, 200, 87, .3); }

.bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad-bar); border-radius: 999px; box-shadow: 0 0 8px rgba(255, 43, 214, .5); }
.bar.good > i { background: var(--good); box-shadow: none; }
.progress-line { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); margin-top: auto; }
.progress-line .bar { flex: 1; }

/* continuar donde quedaste */
.continue { display: grid; grid-template-columns: 320px 1fr; gap: 0; align-items: stretch; color: var(--text); }
.continue:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--glow); }
.continue .cover { aspect-ratio: auto; min-height: 180px; }
.continue .body { padding: 24px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.continue .eyebrow { color: var(--accent); text-shadow: 0 0 10px rgba(255, 43, 214, .5); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.play-ico { position: absolute; width: 56px; height: 56px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(255, 43, 214, .2), 0 0 30px rgba(255, 43, 214, .6); }

.hello { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 28px; }
.stats-mini { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-mini { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.stat-mini b { display: block; font-size: 1.3rem; }
.stat-mini span { font-size: .78rem; color: var(--muted); }

/* ---------- página de curso ---------- */
.course-hero { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; margin-bottom: 32px; }
.course-hero .cover { border-radius: var(--radius); border: 1px solid var(--border); }
.course-hero .desc { color: var(--text-2); white-space: pre-line; }
.course-progress { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.course-progress .big { font-size: 2rem; font-weight: 700; }
.modules { display: grid; gap: 14px; }
.module { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.module-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: none; border: 0; cursor: pointer; text-align: left; }
.module-head:hover { background: var(--surface-2); }
.module-head .num { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; font-size: .9rem; }
.module-head h3 { margin: 0; flex: 1; }
.module-head .chev { transition: transform .2s; color: var(--muted); }
.module[data-open=false] .chev { transform: rotate(-90deg); }
.module[data-open=false] .lesson-list { display: none; }
.lesson-list { list-style: none; margin: 0; padding: 0 0 8px; border-top: 1px solid var(--border); }
.lesson-item a, .lesson-item .row-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--text); }
.lesson-item a:hover { background: var(--surface-2); text-decoration: none; }
.lesson-item .t { flex: 1; font-size: .92rem; }
.lesson-item .d { font-size: .8rem; color: var(--muted); }
.lesson-item[aria-current=true] a { background: var(--accent-soft); }
.lesson-item[aria-current=true] .t { color: var(--accent); font-weight: 600; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-hi); display: grid; place-items: center; flex: none; color: transparent; }
.dot.done { background: var(--good); border-color: var(--good); color: #04261a; }
.dot.quiz { border-radius: 6px; border-color: var(--warn); color: var(--warn); }
.dot.quiz.done { background: var(--good); border-color: var(--good); color: #04261a; }

/* ---------- reproductor ---------- */
.player-layout { display: grid; grid-template-columns: 1fr 360px; gap: 0; min-height: calc(100vh - 64px); }
.player-main { padding: 24px 28px 64px; min-width: 0; }
.player-side { border-left: 1px solid var(--border); background: var(--bg-2); max-height: calc(100vh - 64px); overflow: auto; position: sticky; top: 64px; }
.player-side .side-head { padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-2); z-index: 1; }
.player-side .side-head h2 { font-size: 1rem; margin: 0 0 8px; }
.player-side .module-title { padding: 14px 20px 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.player-side .lesson-item a { padding: 10px 20px; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.video-wrap video, .video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
.lesson-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 18px 0 8px; }
.lesson-bar h1 { font-size: 1.4rem; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 24px 0 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 16px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button .count { background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: .75rem; margin-left: 6px; }
.prose { color: var(--text-2); max-width: 75ch; }
.prose p { white-space: pre-line; }
.resource { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); margin-bottom: 10px; }
.resource:hover { border-color: var(--accent); text-decoration: none; }
.resource .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }

/* comentarios */
.comment-form textarea { min-height: 80px; }
.comments { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.comment { display: flex; gap: 12px; }
.comment .avatar { width: 34px; height: 34px; font-size: .8rem; }
.comment .bubble { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.comment .who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; margin-bottom: 4px; }
.comment .who b { font-weight: 600; }
.comment .text { white-space: pre-line; font-size: .92rem; word-wrap: break-word; }
.comment .actions { display: flex; gap: 12px; margin-top: 6px; }
.comment .actions button { background: none; border: 0; padding: 0; color: var(--muted); font-size: .8rem; cursor: pointer; }
.comment .actions button:hover { color: var(--text); }
.replies { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }

/* quiz */
.quiz { max-width: 760px; }
.question { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.question legend { font-weight: 600; margin-bottom: 12px; padding: 0; }
.question fieldset { border: 0; margin: 0; padding: 0; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-weight: 400; }
.option:hover { border-color: var(--border-hi); }
.option input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.option.correct { border-color: var(--good); background: rgba(61, 220, 151, .08); }
.option.wrong { border-color: var(--bad); background: rgba(255, 117, 132, .08); }
.result { text-align: center; padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: 24px; }
.result .score { font-size: 3rem; font-weight: 800; }
.result.pass .score { color: var(--good); }
.result.fail .score { color: var(--bad); }

/* certificado */
.cert-wrap { display: grid; place-items: center; padding: 24px 0; }
.certificate {
  width: 100%; max-width: 1000px; aspect-ratio: 1.414 / 1; color: #fff; border-radius: 10px;
  background: radial-gradient(60cqw 40cqw at 50% -5%, rgba(123, 43, 255, .55), transparent 70%),
              radial-gradient(40cqw 30cqw at 100% 100%, rgba(255, 43, 214, .25), transparent 70%), #07040f;
  position: relative; padding: 5% 7%; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow);
  overflow: hidden; container-type: inline-size;
}
.certificate::before { content: ''; position: absolute; inset: 2.2cqw; border: .25cqw solid #ff2bd6; border-radius: 1cqw; box-shadow: 0 0 2cqw rgba(255, 43, 214, .55), inset 0 0 2cqw rgba(123, 43, 255, .35); pointer-events: none; }
.certificate .c-top { display: flex; justify-content: center; position: relative; z-index: 1; }
.certificate .c-top img { width: 16cqw; border-radius: 1.5cqw; }
.certificate .c-mid { text-align: center; position: relative; z-index: 1; }
.certificate .c-eyebrow { font-size: 1.5cqw; letter-spacing: .35em; text-transform: uppercase; color: #22e6ff; margin-bottom: 1.2cqw; }
.certificate .c-name { font-size: 5cqw; font-weight: 800; line-height: 1.1; margin-bottom: 1.2cqw; background: linear-gradient(90deg, #ff2bd6, #b07bff, #22e6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.certificate .c-text { font-size: 1.8cqw; color: #d6d2ee; margin-bottom: .6cqw; }
.certificate .c-course { font-size: 3cqw; font-weight: 700; color: #fff; line-height: 1.2; }
.certificate .c-hand { font-family: var(--hand); color: #ff2bd6; font-size: 2cqw; transform: rotate(-3deg); margin-top: 1.5cqw; text-shadow: 0 0 1cqw rgba(255, 43, 214, .6); }
.certificate .c-bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: 1.3cqw; color: #a49ec8; position: relative; z-index: 1; gap: 3cqw; }
.certificate .c-bottom b { color: #fff; }
.certificate .c-sign { border-top: .15cqw solid #ff2bd6; padding-top: .8cqw; min-width: 22cqw; text-align: center; color: #fff; }
.cert-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* ---------- administración ---------- */
.admin-layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 64px); }
.admin-side { border-right: 1px solid var(--border); background: var(--bg-2); padding: 20px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); }
.admin-side .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 0 12px 10px; font-weight: 600; }
.admin-side a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: .92rem; }
.admin-side a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.admin-side a[aria-current=page] { background: var(--accent-soft); color: var(--accent); }
.admin-main { padding: 28px 32px 64px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.kpi .lbl { font-size: .8rem; color: var(--muted); }
.kpi .val { font-size: 1.9rem; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: .78rem; color: var(--muted); }
.kpi .delta.up { color: var(--good); }
.kpi .delta.down { color: var(--bad); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel h2 { font-size: 1.05rem; margin: 0; }
.panel .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.panels .wide { grid-column: 1 / -1; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 7px 14px; cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed=true] { background: var(--surface-2); color: var(--text); }

/* gráfica de barras */
.chart { position: relative; }
.chart svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; }
.chart .bar-rect { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar-rect, .chart g.on .bar-rect { fill: #ff7be6; }
.tooltip { position: absolute; pointer-events: none; background: #0a0716; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); display: none; z-index: 5; }
.tooltip b { display: block; font-size: .95rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.meter { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.meter .bar { flex: 1; height: 8px; }
.meter span { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--muted); min-width: 38px; text-align: right; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.list li:last-child { border-bottom: 0; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 320px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-height: 40px; }

/* editor de cursos */
.editor-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.cover-edit .cover { border-radius: 10px; margin-bottom: 10px; border: 1px solid var(--border); }
.mod-edit { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; }
.mod-edit-head { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mod-edit-head input { flex: 1; min-width: 160px; font-weight: 600; }
.les-edit { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.les-edit:last-child { border-bottom: 0; }
.les-edit .t { flex: 1; min-width: 160px; font-size: .92rem; }
.mod-edit-foot { padding: 10px 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.upload-progress { margin-top: 8px; }
.upload-progress .bar { height: 8px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(3, 1, 8, .78); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 680px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }
.q-edit { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.q-opt { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-opt input[type=radio] { width: 18px; height: 18px; accent-color: var(--good); flex: none; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-2); border: 1px dashed var(--accent); padding: 10px 14px; border-radius: 10px; font-size: 1.05rem; letter-spacing: .04em; user-select: all; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast-item { background: #0a0716; border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; animation: toastIn .2s ease; }
.toast-item.error { border-left-color: var(--bad); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .player-layout { grid-template-columns: 1fr; }
  .player-side { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--border); }
  .editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px; }
  .auth-brand ul, .auth-brand .foot { display: none; }
  .auth-logo { width: 96px; margin: 16px 0 12px; border-radius: 12px; }
  .auth-brand h1 { font-size: 1.6rem; }
  .course-hero { grid-template-columns: 1fr; }
  .course-hero .cover { order: -1; }
  .continue { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-side .lbl { display: none; }
  .admin-side a { white-space: nowrap; }
  .admin-main { padding: 20px 16px 48px; }
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-in { gap: 12px; padding: 0 16px; }
  .nav { display: none; }
  .user-btn .name { display: none; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--bg-2); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; color: var(--muted); font-size: .72rem; }
  .mobile-nav a[aria-current=page] { color: var(--accent); }
  .mobile-nav a:hover { text-decoration: none; }
  body.has-mobile-nav { padding-bottom: 64px; }
  .page { padding: 20px 16px 48px; }
  .player-main { padding: 16px 16px 40px; }
  .video-wrap { border-radius: 10px; margin: 0 -16px; border-left: 0; border-right: 0; border-radius: 0; }
  .lesson-bar h1 { font-size: 1.15rem; }
  .lesson-bar .row { width: 100%; }
  .lesson-bar .row .btn { flex: 1; }
  .grid { grid-template-columns: 1fr; }
  .modal-back { padding: 0; align-items: end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
}

@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #05040b; }
  .topbar, .mobile-nav, .cert-actions, .crumbs, .no-print, #toast { display: none !important; }
  .page { padding: 0; max-width: none; }
  .cert-wrap { padding: 0; }
  .certificate { max-width: none; width: 297mm; height: 210mm; aspect-ratio: auto; box-shadow: none; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
