/* ============================================================
   ETLAS Academy — sistema de diseño
   Marca: tinta #14161c · violeta #7c5cff · el punto violeta
   Tipos: Bricolage Grotesque (display) · Figtree (cuerpo)
          Spline Sans Mono (claves, códigos, kickers)
   ============================================================ */
:root {
  --ink: #14161c;
  --ink-2: #23262f;
  --ink-3: #3a3d49;
  --muted: #6b6878;
  --faint: #9a96ad;
  --paper: #f5f4f8;
  --card: #ffffff;
  --line: #e7e5ee;
  --violet: #7c5cff;
  --violet-deep: #5a3fe0;
  --violet-soft: #efeaff;
  --violet-faint: #f7f5ff;
  --green: #1e9e6a;
  --green-soft: #e3f6ee;
  --red: #d64545;
  --red-soft: #fdeaea;
  --amber: #e08c00;
  --amber-soft: #fdf3e0;
  /* Espectro de sesiones (el orden de las jornadas se codifica en color) */
  --tone-0: #8a8399; --tone-1: #7c5cff; --tone-2: #e0577c; --tone-3: #e08c00;
  --tone-4: #1e9e6a; --tone-5: #3e8ed0; --tone-6: #a44fc4;
  --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
  --shadow: 0 12px 32px rgba(20, 22, 28, 0.10);
  --shadow-sm: 0 3px 12px rgba(20, 22, 28, 0.06);
  --display: "Bricolage Grotesque", "Avenir Next", -apple-system, sans-serif;
  --body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--violet-deep); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.015em; }

:focus-visible { outline: 2.5px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

/* El punto violeta — firma de la marca */
.dot-title::after { content: "."; color: var(--violet); }

/* ============ SHELL ADMIN (sidebar) ============ */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #fff; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { padding: 4px 10px 22px; display: block; }
.sidebar .logo img { height: 30px; display: block; }
.side-label {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: #5d6070; padding: 14px 12px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  color: #b9b6c9; font-weight: 600; font-size: .92rem;
  padding: 9px 12px; border-radius: 10px; transition: background .15s, color .15s;
}
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active { background: rgba(124,92,255,.16); color: #fff; }
.side-link.active::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet); margin-left: -2px; flex-shrink: 0;
}
.side-link .ico { width: 20px; text-align: center; }
.sidebar .side-bottom { margin-top: auto; border-top: 1px solid #2a2d38; padding-top: 12px; }
.side-user { padding: 4px 12px 10px; font-size: .8rem; color: #7d7a90; }
.side-user strong { color: #d9d7e4; display: block; font-size: .87rem; }
.btn-side-logout {
  width: 100%; background: none; border: 1px solid #363946; color: #b9b6c9;
  border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600; font-size: .85rem;
  cursor: pointer; text-align: left;
}
.btn-side-logout:hover { border-color: var(--violet); color: #fff; }

.main { min-width: 0; padding: 34px 42px 80px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .sidebar .logo { padding: 0 12px 0 0; } .sidebar .logo img { height: 24px; }
  .side-label { display: none; }
  .side-link { padding: 7px 11px; font-size: .85rem; }
  .sidebar .side-bottom { margin: 0 0 0 auto; border: none; padding: 0; display: flex; align-items: center; gap: 8px; }
  .side-user { padding: 0; }
  .main { padding: 22px 18px 60px; }
}

/* ============ SHELL PARTICIPANTE (topbar clara) ============ */
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar .logo img { height: 27px; display: block; }
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem;
  padding: 7px 14px; border-radius: 999px;
}
.topbar nav a:hover { background: var(--violet-faint); color: var(--violet-deep); }
.topbar nav a.active { color: var(--ink); }
.topbar nav a.active::after { content: " •"; color: var(--violet); }
.topbar .user-chip { font-size: .82rem; color: var(--faint); }
.btn-logout {
  background: none; border: 1.5px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; font-size: .83rem; cursor: pointer;
}
.btn-logout:hover { border-color: var(--ink); color: var(--ink); }

.page { padding: 32px 0 80px; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ============ MENSAJES ============ */
.flash {
  background: var(--green-soft); border: 1px solid #bfe8d6; color: #14684a;
  border-radius: var(--r-md); padding: 12px 18px; margin-bottom: 22px; font-weight: 600; font-size: .93rem;
}
.errors {
  background: var(--red-soft); border: 1px solid #f3c6c6; color: #a33333;
  border-radius: var(--r-md); padding: 12px 18px; margin-bottom: 22px; font-size: .91rem;
}
.errors ul { margin: 4px 0 0; padding-left: 18px; }

/* ============ BOTONES ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--violet); color: #fff; border: none; border-radius: var(--r-md);
  padding: 10px 20px; font-family: var(--body); font-weight: 700; font-size: .92rem;
  cursor: pointer; text-decoration: none; transition: background .15s, transform .12s;
}
.btn:hover { background: var(--violet-deep); transform: translateY(-1px); }
.btn.ink { background: var(--ink); }
.btn.ink:hover { background: var(--ink-2); }
.btn.small { padding: 6px 13px; font-size: .8rem; border-radius: var(--r-sm); }
.btn.secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.secondary:hover { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #fff; color: var(--ink); border-color: var(--ink); transform: none; }
.btn.danger { background: transparent; color: var(--red); border: 1.5px solid #eec6c6; }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); transform: none; }

/* ============ ENCABEZADOS DE PÁGINA ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 1.9rem; font-weight: 700; }
.page-head .crumb {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 4px;
}
.page-head .crumb a { color: var(--faint); text-decoration: none; }
.page-head .crumb a:hover { color: var(--violet-deep); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ TARJETAS / GRID ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 28px; margin-bottom: 22px; }
.card h2 { margin-top: 0; font-size: 1.18rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 22px;
}
.stat-num { font-family: var(--display); font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.stat-num::after { content: "."; color: var(--violet); }
.stat-label { color: var(--muted); font-size: .84rem; font-weight: 600; }

/* ============ TABLAS ============ */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th {
  text-align: left; padding: 12px 18px;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); border-bottom: 1.5px solid var(--line); font-weight: 500;
}
table.list td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: var(--violet-faint); }

.tag {
  display: inline-block; background: var(--violet-soft); color: var(--violet-deep);
  border-radius: 999px; padding: 3px 11px; font-size: .75rem; font-weight: 700;
}
.tag.green { background: var(--green-soft); color: #14684a; }
.tag.gray { background: #edecf2; color: var(--muted); }
.tag.amber-tag { background: var(--amber-soft); color: #93610b; }

/* Claves y códigos siempre en mono */
code, .key {
  font-family: var(--mono); font-size: .88em; background: var(--violet-faint);
  border: 1px solid #e4dcff; color: var(--ink); border-radius: 7px; padding: 2px 8px; white-space: nowrap;
}

/* ============ FORMULARIOS ============ */
form .field { margin-bottom: 18px; }
label.lbl { display: block; font-weight: 700; font-size: .86rem; margin-bottom: 6px; }
.hint { color: var(--faint); font-size: .79rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], input[type=date],
input[type=file], select, textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  font: inherit; font-size: .92rem; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 3.5px rgba(124, 92, 255, .16);
}
textarea { resize: vertical; min-height: 90px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--violet); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
fieldset.group { border: 1px solid var(--line); background: var(--card); border-radius: var(--r-lg); padding: 20px 24px; margin: 0 0 20px; }
fieldset.group legend {
  font-family: var(--mono); font-weight: 500; color: var(--violet-deep);
  padding: 2px 10px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--violet-faint); border: 1px solid #e4dcff; border-radius: 999px;
}
.repeat-row { border: 1.5px dashed var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; background: #fbfaff; }

/* ============ TARJETA DE ACCESO (firma) ============ */
.access-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: 22px; overflow: hidden; display: flex; flex-wrap: wrap;
}
.access-main { flex: 1; min-width: 280px; padding: 26px 30px; }
.access-main .access-label {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--violet-deep); margin: 0 0 14px;
}
.access-row { margin-bottom: 12px; }
.access-row .k { font-size: .78rem; color: var(--faint); font-weight: 600; }
.access-row .v { font-family: var(--mono); font-size: 1.02rem; font-weight: 600; }
.access-row .v.pass { font-size: 1.25rem; letter-spacing: .06em; }
.access-side {
  border-left: 1.5px dashed var(--line); padding: 26px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; background: var(--violet-faint); min-width: 200px;
}
.access-side .qr svg { display: block; border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.access-side .qr-cap { font-size: .72rem; color: var(--muted); text-align: center; }
.access-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.access-status { font-size: .78rem; color: var(--faint); margin-top: 10px; }
.cred-msg {
  background: #fbfaff; border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; font-size: .88rem; white-space: pre-wrap; margin-top: 16px;
}
@media (max-width: 640px) { .access-side { border-left: none; border-top: 1.5px dashed var(--line); width: 100%; } }

/* ============ LOGIN ============ */
.login-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-brand {
  background: var(--ink); color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-brand .logo img { height: 34px; }
.login-brand h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem); font-weight: 700; line-height: 1.15;
  margin: 0; max-width: 420px;
}
.login-brand h2 em { font-style: normal; color: var(--violet); }
.login-brand .foot { color: #7d7a90; font-size: .84rem; }
.login-dots { position: absolute; right: -40px; top: 20%; opacity: .5; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper); }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 1.6rem; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: .92rem; margin: 0 0 28px; }
@media (max-width: 860px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand { padding: 34px 28px; gap: 20px; }
  .login-brand h2 { font-size: 1.4rem; }
}

/* ============ ACORDEONES DE EDICIÓN ============ */
details.editor { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 12px; background: #fff; }
details.editor > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: .93rem; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
details.editor > summary::-webkit-details-marker { display: none; }
details.editor > summary::before { content: "▸"; color: var(--violet); transition: transform .15s; }
details.editor[open] > summary::before { transform: rotate(90deg); }
details.editor .editor-body { padding: 6px 18px 18px; border-top: 1px solid var(--line); }

/* ============ PÁGINA DE CURSO (participante) ============ */
.course-page { max-width: 1080px; margin: 0 auto; }

.hero {
  position: relative; overflow: hidden; border-radius: 26px;
  background: var(--ink); color: #fff; padding: 58px 52px; margin-bottom: 20px;
}
.hero-shape { position: absolute; pointer-events: none; }
.hero-content { position: relative; max-width: 780px; }
.hero-eyebrow {
  display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: #c6bcff; background: rgba(124,92,255,.14);
  border: 1px solid rgba(124,92,255,.35); border-radius: 999px; padding: 6px 15px; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.2vw, 2.9rem); margin: 0 0 14px; line-height: 1.12; font-weight: 700;
}
.hero h1::after { content: "."; color: var(--violet); }
.hero-subtitle { font-size: 1.06rem; color: #b9b6c9; margin: 0 0 24px; max-width: 640px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px; }
.badge-pill {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 6px 14px; font-size: .83rem; font-weight: 600; color: #e6e4f0;
}

.top-nav {
  display: flex; flex-wrap: wrap; gap: 4px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 8px; margin-bottom: 24px;
  position: sticky; top: 68px; z-index: 30; box-shadow: var(--shadow-sm);
}
.top-nav .nav-link {
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: .86rem;
  padding: 8px 15px; border-radius: 999px;
}
.top-nav .nav-link:hover { background: var(--violet-faint); color: var(--violet-deep); }

/* Banners */
.faq-banner {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(115deg, var(--violet-deep), var(--violet)); color: #fff;
  border-radius: 20px; padding: 24px 28px; margin-bottom: 16px;
}
.faq-icon-badge { font-size: 1.7rem; background: rgba(255,255,255,.16); border-radius: 14px; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.faq-text { flex: 1; min-width: 220px; }
.faq-text .faq-cta { font-family: var(--display); font-size: 1.15rem; font-weight: 700; margin: 0 0 3px; }
.faq-text .faq-desc { margin: 0; font-size: .9rem; opacity: .92; }
a.faq-btn {
  background: #fff; color: var(--violet-deep); font-weight: 800; text-decoration: none;
  border-radius: 999px; padding: 12px 22px; font-size: .92rem; white-space: nowrap;
}

.material-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--amber-soft); border: 1.5px solid #f3dfae; color: #6d4a08;
  border-radius: 20px 20px 0 0; padding: 20px 26px;
}
.material-icon-badge { font-size: 1.5rem; background: #fff; border-radius: 12px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid #f3dfae; }
.material-title { font-family: var(--display); font-weight: 700; font-size: 1.06rem; margin: 0 0 2px; }
.material-desc { margin: 0; font-size: .87rem; }
.material-list {
  background: #fff; border: 1.5px solid #f3dfae; border-top: none;
  border-radius: 0 0 20px 20px; padding: 18px 26px; margin-bottom: 24px;
  display: flex; flex-wrap: wrap; gap: 9px;
}

.welcome-card {
  display: flex; gap: 18px; background: #fff; border: 1px solid var(--line);
  border-left: 5px solid var(--violet); border-radius: var(--r-lg);
  padding: 24px 26px; margin-bottom: 24px;
}
.welcome-icon { font-size: 1.7rem; }
.welcome-title { font-family: var(--display); font-weight: 700; font-size: 1.08rem; margin: 0 0 6px; }
.welcome-text { margin: 0; color: var(--muted); font-size: .94rem; }

/* Secciones */
.section { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 30px 34px; margin-bottom: 24px; }
.section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-header h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.section-header h2::after { content: "."; color: var(--violet); }
.section-icon {
  width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0; background: var(--violet-faint); border: 1px solid #e4dcff;
}
.section-body { color: var(--ink-3); font-size: .96rem; }
.section-body p { margin: 0 0 14px; }
.section-body p:last-child { margin-bottom: 0; }

/* Equipo */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.team-card { border-radius: var(--r-lg); padding: 24px; border: 1px solid var(--line); background: #fbfaff; }
.team-avatar {
  width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: #fff; margin-bottom: 12px; background: var(--ink);
}
.team-card:nth-child(4n+2) .team-avatar { background: var(--violet); }
.team-card:nth-child(4n+3) .team-avatar { background: var(--tone-2); }
.team-card:nth-child(4n+0) .team-avatar { background: var(--tone-4); }
.team-name { font-family: var(--display); font-weight: 700; font-size: 1.06rem; margin: 0 0 2px; }
.team-role {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--violet-deep); margin: 0 0 10px;
}
.team-bio { font-size: .87rem; color: var(--muted); margin: 0; }

/* Objetivos */
.obj-general {
  display: flex; gap: 14px; background: var(--violet-faint); border: 1px solid #e4dcff;
  border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 16px;
}
.obj-general-icon { font-size: 1.4rem; }
.obj-general p { margin: 0; }
.obj-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.obj-item { display: flex; gap: 14px; align-items: flex-start; background: #fbfaff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 18px; }
.obj-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600; font-size: .8rem;
}

/* Detalles */
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.detail-item { background: #fbfaff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.detail-icon { font-size: 1.4rem; margin-bottom: 6px; }
.detail-label { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.detail-value { font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin: 2px 0; }
.detail-sub { font-size: .81rem; color: var(--muted); }

/* Módulos: la espina de color codifica el orden de la sesión */
.modules-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.module-card {
  border-radius: var(--r-lg); border: 1px solid var(--line); background: #fff;
  border-left-width: 5px; overflow: hidden;
}
.tone-0 { border-left-color: var(--tone-0); } .tone-1 { border-left-color: var(--tone-1); }
.tone-2 { border-left-color: var(--tone-2); } .tone-3 { border-left-color: var(--tone-3); }
.tone-4 { border-left-color: var(--tone-4); } .tone-5 { border-left-color: var(--tone-5); }
.tone-6 { border-left-color: var(--tone-6); }
.module-card-head { display: flex; gap: 16px; align-items: flex-start; padding: 20px 24px 12px; }
.module-dot {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
}
.tone-0 .module-dot { background: var(--tone-0); } .tone-1 .module-dot { background: var(--tone-1); }
.tone-2 .module-dot { background: var(--tone-2); } .tone-3 .module-dot { background: var(--tone-3); }
.tone-4 .module-dot { background: var(--tone-4); } .tone-5 .module-dot { background: var(--tone-5); }
.tone-6 .module-dot { background: var(--tone-6); }
.module-kicker {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.module-title-text { margin: 2px 0 0; font-size: 1.14rem; font-weight: 700; }
.module-body { padding: 0 24px 18px 80px; }
.module-links { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 24px 20px 80px; }
.embed-wrap { padding: 0 24px 20px 80px; }
@media (max-width: 700px) { .module-body, .module-links, .embed-wrap { padding-left: 24px; } }
.module-desc { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.module-activities {
  background: var(--violet-faint); border: 1px solid #e9e2ff; border-radius: var(--r-md);
  padding: 14px 16px; font-size: .89rem; color: var(--ink-3);
}
.module-activities strong {
  display: block; font-family: var(--mono); color: var(--violet-deep); margin-bottom: 4px;
  font-size: .66rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 500;
}
.product-tag {
  display: inline-block; background: #fff; border: 1.5px dashed #cbb9f2; color: var(--violet-deep);
  border-radius: 999px; padding: 4px 13px; font-size: .78rem; font-weight: 700; margin-top: 8px;
}
.chip-link {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; font-size: .84rem;
  border-radius: 999px; padding: 8px 16px; transition: all .15s;
}
.chip-link:hover { border-color: var(--violet); color: var(--violet-deep); background: var(--violet-faint); }
.embed-wrap iframe, .embed-frame iframe { max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); }
.embed-frame { margin-top: 12px; }

/* Bloque QR en la página del curso */
.qr-strip { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.qr-tile {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 14px; text-align: center; width: 168px;
}
.qr-tile svg { width: 128px; height: 128px; display: block; margin: 0 auto 8px; }
.qr-tile .qr-name { font-size: .78rem; font-weight: 700; line-height: 1.3; }
.qr-tile .qr-provider { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

/* Cierre */
.closing-note { background: var(--green-soft); padding: 16px 20px; border-radius: var(--r-md); border-left: 4px solid var(--green); }
.closing-thanks { text-align: center; margin-top: 24px; font-family: var(--display); font-size: 1.12rem; color: var(--green); font-weight: 700; }

/* Mis cursos */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.course-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course-card-top { background: var(--ink); color: #fff; padding: 22px 24px; position: relative; }
.course-card-top::after {
  content: ""; position: absolute; left: 24px; bottom: 0; width: 34px; height: 4px;
  border-radius: 3px 3px 0 0; background: var(--violet);
}
.course-card:nth-child(3n+2) .course-card-top::after { background: var(--tone-2); }
.course-card:nth-child(3n+0) .course-card-top::after { background: var(--tone-4); }
.course-card-top .eyebrow {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .13em; text-transform: uppercase; color: #9a96ad;
}
.course-card-top h3 { margin: 6px 0 0; font-size: 1.12rem; line-height: 1.3; font-weight: 700; }
.course-card-body { padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.course-card-body .meta { color: var(--muted); font-size: .85rem; }
.course-card-body .btn { align-self: flex-start; margin-top: auto; }

/* ============ CERTIFICADO ============ */
.cert-page { background: var(--paper); min-height: 100vh; padding: 40px 16px; }
.cert-sheet {
  background: #fff; max-width: 880px; margin: 0 auto; padding: 64px 72px;
  border: 3px solid var(--ink); border-radius: 4px; position: relative; text-align: center;
}
.cert-inner-border { position: absolute; inset: 12px; border: 1.5px solid var(--violet); border-radius: 2px; pointer-events: none; }
.cert-brand img { height: 30px; margin-bottom: 34px; }
.cert-title { font-family: var(--display); font-size: 2rem; margin: 0 0 8px; font-weight: 700; }
.cert-title::after { content: "."; color: var(--violet); }
.cert-sub { color: var(--muted); margin: 0 0 4px; }
.cert-name { font-family: var(--display); font-size: 2.4rem; font-weight: 700; margin: 14px 0; }
.cert-course { font-size: 1.22rem; font-weight: 700; margin: 14px 0 6px; }
.cert-meta { color: var(--muted); font-size: .94rem; }
.cert-code { margin-top: 36px; font-size: .78rem; color: var(--faint); }
.cert-code code { font-size: .85rem; }
.cert-actions { max-width: 880px; margin: 22px auto 0; display: flex; gap: 12px; justify-content: center; }
@media print {
  .cert-page { background: #fff; padding: 0; }
  .cert-actions, .topbar, .sidebar { display: none !important; }
  .cert-sheet { border-width: 3px; max-width: none; }
}
@media (max-width: 700px) { .cert-sheet { padding: 40px 24px; } .cert-name { font-size: 1.7rem; } }

/* ============ UTILIDADES ============ */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small-text { font-size: .84rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inline-form { display: inline; }
.mono-label { font-family: var(--mono); font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); }
.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: var(--r-sm); text-decoration: none; font-size: .86rem; border: 1.5px solid var(--line); background: #fff; }
.pagination .current { border-color: var(--violet); color: var(--violet-deep); font-weight: 700; }
.empty-state { text-align: center; padding: 56px 30px; }
.empty-state .glyph { font-size: 2.6rem; margin-bottom: 6px; }
.empty-state h2 { font-size: 1.25rem; margin: 0 0 6px; }
