/*
 * CGI Formación · hoja de estilos común
 * Aplica las normas de docs/DESIGN.md. Todas las pantallas la usan:
 * no repetir colores ni estilos en línea en las pantallas.
 */
@import url('https://fonts.googleapis.com/css2?family=Signika:wght@300;400;600;700&display=swap');

/* ---------- 1. Variables ---------- */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F6F9FC;
  --surface-ice: #EEF5FA;
  --surface-hover: #F0F5F9;

  --border: #DDE5EB;
  --border-strong: #7D8F9C;
  --border-hover: #066798;

  --text: #1E2A33;
  --text-secondary: #3D4A55;
  --text-tertiary: #5B6772;

  --brand: #008ACF;
  --accent: #066798;
  --accent-hover: #04537A;
  --accent-active: #03405F;
  --accent-soft: #E6F1F8;

  --ink: #1E2A33;
  --on-ink: #FFFFFF;
  --on-ink-muted: #C5D2DC;
  --brand-on-ink: #5CC0F0;

  --success: #1D6B3A; --success-bg: #E7F5EC;
  --warning: #8A4B00; --warning-bg: #FFF2E0;
  --error: #A12626;   --error-bg: #FDECEC;
  --neutral: #44515B; --neutral-bg: #EEF2F5;

  --ink-rgb: 30, 42, 51;
  --accent-rgb: 6, 103, 152;
  --brand-rgb: 0, 138, 207;

  --font: 'Signika', 'Segoe UI', Arial, sans-serif;

  --shadow-subtle: 0 1px 2px rgba(var(--ink-rgb), .06);
  --shadow-raised: 0 8px 24px rgba(var(--ink-rgb), .08);
  --shadow-overlay: 0 16px 48px rgba(var(--ink-rgb), .16);

  --radius-field: 10px;
  --radius-card: 16px;
  --radius-pill: 999px;

  --gutter: 20px;
  --gap: 16px;
  --pad: 20px;
  --section: 56px;
  --header-h: 64px;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 960px) { :root { --gutter: 32px; --gap: 24px; --pad: 24px; --section: 96px; --header-h: 76px; } }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; font-weight: 400;
  color: var(--text-secondary); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
@media (min-width: 960px) { body { font-size: 17px; } }
body.app-bg { background: var(--surface-alt); }
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { color: var(--text); margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.link-quiet { text-decoration: none; color: var(--text); }
.link-quiet:hover { color: var(--accent); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.on-ink :focus-visible, .on-photo :focus-visible { outline-color: var(--brand-on-ink); }
::selection { background: var(--accent-soft); color: var(--text); }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -100px; z-index: 1000;
  background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: var(--radius-field);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; color: var(--on-ink); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3. Maquetación ---------- */
.wrap { width: 100%; max-width: calc(1200px + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wrap-narrow { max-width: calc(760px + 2 * var(--gutter)); }
.section { padding-top: var(--section); padding-bottom: var(--section); }
.section-sm { padding-top: calc(var(--section) / 2); padding-bottom: calc(var(--section) / 2); }
.bg-ice { background: var(--surface-ice); }
.bg-alt { background: var(--surface-alt); }
.stack { display: flex; flex-direction: column; gap: var(--s, 16px); }
.stack-xs { --s: 4px; } .stack-sm { --s: 8px; } .stack-md { --s: 24px; } .stack-lg { --s: 40px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s, 12px); }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 280px)), 1fr)); }
.grid-fit { grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 280px)), 1fr)); }
.split { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr) 360px; }
  .split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 64px; }
}
.grid-people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .grid-people { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); } }
.mt-auto { margin-top: auto; }
@media (max-width: 959px) { .solo-escritorio { display: none !important; } }
@media (min-width: 960px) { .solo-movil { display: none !important; } }

/* ---------- 4. Tipografía ---------- */
.display { font-size: clamp(2.25rem, 1.35rem + 3.6vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; text-transform: lowercase; }
.keep-case { text-transform: none; }
.display-sm { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); line-height: 1.08; letter-spacing: -0.02em; }
.h1 { font-size: clamp(1.625rem, 1.35rem + 1.1vw, 2.25rem); line-height: 1.15; letter-spacing: -0.01em; }
.h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); line-height: 1.15; letter-spacing: -0.01em; }
.h3 { font-size: 1.1875rem; line-height: 1.3; }
.h4 { font-size: 1.0625rem; line-height: 1.35; }
.lead { font-size: clamp(1.125rem, 1.05rem + .3vw, 1.25rem); font-weight: 300; line-height: 1.55; color: var(--text-secondary); }
.small { font-size: .9375rem; line-height: 1.5; }
.muted { color: var(--text-tertiary); }
.strong { font-weight: 600; color: var(--text); }
.eyebrow { font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); line-height: 1.3; }
.num { font-variant-numeric: tabular-nums; }
.prose { max-width: 68ch; }
.prose p + p { margin-top: 1em; }

/* ---------- 5. Logotipo ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; text-decoration: none; color: var(--text); font-size: 24px; letter-spacing: -0.02em; white-space: nowrap; }
.logo:hover { color: var(--text); }
.logo .c { font-weight: 300; }
.logo .f { font-weight: 700; }
.logo .s { font-weight: 700; color: var(--brand); }
.logo small { font-size: 12px; letter-spacing: .02em; color: var(--text-tertiary); padding-top: 3px; font-weight: 400; }
.on-ink .logo, .logo.light { color: var(--on-ink); }
.on-ink .logo .s, .logo.light .s { color: var(--brand-on-ink); }
.on-ink .logo small, .logo.light small { color: var(--on-ink-muted); }

/* ---------- 6. Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: var(--radius-pill); border: 2px solid transparent;
  font: 600 1rem/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-ink); }
.btn-primary:active { background: var(--accent-active); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent-hover); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: #D6E8F3; color: var(--accent-hover); }
.btn-light { background: var(--surface); color: var(--accent); }
.btn-light:hover { background: var(--surface-ice); color: var(--accent-hover); }
.btn-ghost-light { background: transparent; color: var(--on-ink); border-color: rgba(255, 255, 255, .75); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .12); color: var(--on-ink); border-color: var(--on-ink); }
.btn-link { background: none; border: 0; padding: 12px 4px; min-height: 44px; color: var(--accent); }
.btn-link:hover { color: var(--accent-hover); text-decoration: underline; }
.btn-warning { background: var(--warning); color: var(--on-ink); }
.btn-warning:hover { background: #6E3C00; color: var(--on-ink); }
.btn-sm { min-height: 44px; padding: 8px 18px; font-size: .9375rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.icon-btn:hover { border-color: var(--accent); background: var(--surface-ice); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 7. Etiquetas ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-pill);
  font: 600 .8125rem/1.4 var(--font); background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.tag-solid { background: var(--accent); color: var(--on-ink); }
.tag-white { background: var(--surface); color: var(--accent); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-error { background: var(--error-bg); color: var(--error); }
.tag-neutral { background: var(--neutral-bg); color: var(--neutral); }
.tag-upper { text-transform: uppercase; letter-spacing: .06em; }

/* ---------- 8. Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.card-pad { padding: var(--pad); }
.card-flat { border: 0; }
.card-link { position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { border-color: var(--border-hover); box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.card-link:focus-within { outline: 3px solid var(--brand); outline-offset: 3px; }
.card-link .stretched { text-decoration: none; color: inherit; }
.card-link .stretched:focus-visible { outline: none; }
.card-link .stretched::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* Foto en blanco y negro o hueco de foto */
.photo { position: relative; overflow: hidden; background: #2E2E2E center / cover no-repeat; filter: grayscale(1); }
.photo-ph {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 14px;
  background: linear-gradient(135deg, #3A3A3A, #8E8E8E); color: rgba(255, 255, 255, .9);
  font-size: .8125rem; letter-spacing: .04em;
}
.ratio-4-3 { aspect-ratio: 4 / 3; } .ratio-16-9 { aspect-ratio: 16 / 9; } .ratio-4-5 { aspect-ratio: 4 / 5; } .ratio-3-2 { aspect-ratio: 3 / 2; }

/* Barra superior (aviso + WhatsApp e Instagram) */
.topbar { background: var(--ink); color: var(--on-ink-muted); }
.topbar-in { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding-top: 2px; padding-bottom: 2px; }
.topbar-txt { flex: 1; text-align: center; line-height: 1.4; }
.topbar-txt a { color: var(--on-ink); font-weight: 600; }
.topbar-txt a:hover { color: var(--brand-on-ink); }
.topbar-social { display: flex; gap: 2px; flex-shrink: 0; }
.topbar-social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--on-ink); }
.topbar-social a:hover { color: var(--brand-on-ink); background: rgba(255, 255, 255, .08); }
.topbar-social svg { width: 20px; height: 20px; }
@media (max-width: 599px) { .topbar-txt { text-align: left; font-size: .8125rem; } }

/* ---------- 9. Cabecera pública ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.site-header .nav-desktop { display: none; }
.site-header .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-field);
  color: var(--text-secondary); text-decoration: none; font-weight: 400;
}
.nav-link:hover { color: var(--accent); background: var(--surface-ice); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
@media (min-width: 960px) {
  .site-header .nav-desktop { display: flex; gap: 4px; margin: 0 auto; }
  .site-header .actions { margin-left: 0; }
}

/* Menú plegable (móvil) */
.menu { position: static; }
.menu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-pill); cursor: pointer; font-weight: 600; color: var(--text);
  background: var(--surface);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { border-color: var(--accent); }
.menu > summary svg { width: 18px; height: 18px; }
.menu .ico-close { display: none; }
.menu[open] .ico-open { display: none; }
.menu[open] .ico-close { display: block; }
.menu-panel {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-overlay);
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  padding: 8px var(--gutter) 24px;
}
.menu-panel a:not(.btn) {
  display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 12px 4px;
  border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 1.125rem; font-weight: 600;
}
.menu-panel a:not(.btn)::after { content: '›'; color: var(--text-tertiary); font-size: 1.5rem; font-weight: 300; }
.menu-panel a[aria-current="page"] { color: var(--accent); }
.menu-panel .btn { margin-top: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .menu[open] .menu-panel { animation: entrar .2s ease-out; }
}
@media (min-width: 960px) { .menu.solo-movil-menu { display: none; } }

/* ---------- 10. Portada (hero con foto) ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink); }
.hero .photo { position: absolute; inset: 0; background-position: center 20%; }
.hero .photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(var(--ink-rgb), .55) 0%, rgba(var(--ink-rgb), .85) 55%, rgba(var(--ink-rgb), .95) 100%);
}
.hero-inner { position: relative; padding-top: 140px; padding-bottom: 40px; }
.hero h1, .hero .h1, .hero .h2 { color: var(--on-ink); }
.hero .lead { color: var(--on-ink-muted); }
.hero .eyebrow { color: var(--brand-on-ink); }
@media (min-width: 960px) {
  .hero .photo { left: auto; width: 52%; background-position: center 22%; }
  .hero .photo::after { background: linear-gradient(90deg, var(--ink) 0%, rgba(var(--ink-rgb), .55) 35%, rgba(var(--ink-rgb), .1) 100%); }
  .hero-inner { padding-top: 112px; padding-bottom: 112px; }
  .hero-inner > * { max-width: 640px; }
}

/* Datos clave */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; overflow: hidden; }
.facts > div { background: rgba(var(--ink-rgb), .72); padding: 12px 14px; }
.facts dt { font-size: .8125rem; color: var(--on-ink-muted); letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; color: var(--on-ink); line-height: 1.35; }
@media (min-width: 600px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- 11. Pestañas ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border);
  margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter);
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; scroll-snap-align: start; min-height: 48px; padding: 10px 14px; border: 0; background: none; cursor: pointer;
  color: var(--text-secondary); font-weight: 600; white-space: nowrap; text-decoration: none;
  box-shadow: inset 0 -3px 0 transparent; transition: color .15s, box-shadow .15s;
  display: inline-flex; align-items: center;
}
.tab:hover { color: var(--accent); text-decoration: none; }
.tab[aria-selected="true"], .tab[aria-current="true"], .tab[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
@media (min-width: 960px) { .tabs { margin-left: 0; margin-right: 0; padding: 0; } }
.tabs-pill { border-bottom: 0; gap: 8px; padding-bottom: 4px; }
.tabs-pill .tab { border-radius: var(--radius-pill); min-height: 44px; padding: 8px 18px; background: var(--surface-ice); color: var(--accent); box-shadow: none; }
.tabs-pill .tab[aria-selected="true"] { background: var(--accent); color: var(--on-ink); }

/* Barra de anclas fija (ficha de curso) */
.anchors { background: var(--surface); border-bottom: 1px solid var(--border); z-index: 40; }
.anchors .tabs { border-bottom: 0; }
@media (min-width: 960px) { .anchors { position: sticky; top: var(--header-h); } }

/* ---------- 12. Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: .9375rem; font-weight: 600; color: var(--text); }
.help { font-size: .875rem; color: var(--text-tertiary); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; font-size: 16px; line-height: 1.4;
  border: 1px solid var(--border-strong); border-radius: var(--radius-field); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231E2A33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-secondary); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .35); }
.input[aria-invalid="true"] { border-color: var(--error); }
.error-msg { font-size: .875rem; color: var(--error); font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 10px 0; cursor: pointer; font-size: .9375rem; line-height: 1.5; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .full { grid-column: 1 / -1; } }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* Opción grande seleccionable (radio en tarjeta) */
.option { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--border-strong); border-radius: 14px; cursor: pointer; background: var(--surface); transition: border-color .15s, background-color .15s; }
.option:hover { border-color: var(--accent); }
.option input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.option:has(input:checked) { border: 2px solid var(--accent); padding: 15px; background: var(--surface-ice); }
.option:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 3px; }
.option[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }

/* ---------- 13. Avisos ---------- */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: var(--surface-ice); color: var(--text); }
.notice svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.notice-warning { background: var(--warning-bg); color: #4A2A00; }
.notice-warning svg { color: var(--warning); }
.notice-success { background: var(--success-bg); color: #0F3D21; }
.notice-success svg { color: var(--success); }
.notice-error { background: var(--error-bg); color: #5E1414; }
.notice-error svg { color: var(--error); }
.notice .body { flex: 1; min-width: 0; }
@media (max-width: 599px) { .notice.stack-mobile { flex-wrap: wrap; } .notice.stack-mobile .btn { width: 100%; } }

/* ---------- 14. Listas, tablas, progreso ---------- */
.list { list-style: none; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.num-badge { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-ice); color: var(--accent); font-weight: 700; font-size: .9375rem; }

.table-wrap { width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: left; font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-secondary); }
.table tbody tr:hover td { background: var(--surface-hover); }
.table td.strong { color: var(--text); }
@media (max-width: 719px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--border); border-radius: 14px; padding: 8px 16px; margin-bottom: 12px; background: var(--surface); }
  .table tbody tr:hover td { background: none; }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; text-align: right; }
  .table td:last-child { border-bottom: 0; }
  .table td::before { content: attr(data-label); font-size: .875rem; font-weight: 600; color: var(--text-tertiary); text-align: left; }
  .table td.cell-title { display: block; text-align: left; font-size: 1.0625rem; }
  .table td.cell-title::before { content: none; }
  .table td.cell-block { display: block; text-align: left; }
  .table td.cell-block::before { display: block; margin-bottom: 8px; }
}

.progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-ice); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; }
@media (min-width: 960px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); } }
.stat .value { font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem); font-weight: 600; color: var(--text); line-height: 1.1; }

/* Acordeón */
.acc { border-bottom: 1px solid var(--border); }
.acc > summary, .acc-btn {
  list-style: none; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 0;
  cursor: pointer; background: none; border: 0; text-align: left; color: var(--text); font-weight: 600; font-size: 1.0625rem;
}
.acc > summary::-webkit-details-marker, summary.acc-btn::-webkit-details-marker { display: none; }
.acc > summary::after, .acc-btn::after {
  content: ''; margin-left: auto; width: 20px; height: 20px; flex-shrink: 0;
  background: currentColor; color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s;
}
.acc[open] > summary::after, details[open] > .acc-btn::after, .acc-btn[aria-expanded="true"]::after { transform: rotate(180deg); }
.acc > summary:hover, .acc-btn:hover { color: var(--accent); }
.acc .acc-body { padding: 0 0 20px; color: var(--text-secondary); }

/* ---------- 15. Barra fija inferior (móvil) ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(var(--ink-rgb), .08);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.sticky-cta .grow { flex: 1; min-width: 0; line-height: 1.3; }
@media (min-width: 960px) { .sticky-cta { display: none; } }
@media (max-width: 959px) { .has-sticky-cta { padding-bottom: 84px; } }

/* ---------- 16. Pie ---------- */
.site-footer { background: var(--ink); color: var(--on-ink-muted); }
.site-footer .logo { align-self: flex-start; }
.site-footer .cols { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-ink); margin-bottom: 8px; }
.site-footer a { color: var(--on-ink); text-decoration: none; display: inline-flex; min-height: 40px; align-items: center; }
.site-footer a:hover { color: var(--brand-on-ink); text-decoration: underline; }
.site-footer .social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.site-footer .social a { gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; font-weight: 600; font-size: .9375rem; }
.site-footer .social a:hover { border-color: var(--brand-on-ink); text-decoration: none; }
.site-footer .social svg { width: 18px; height: 18px; flex-shrink: 0; }
.site-footer .legal { border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 40px; padding-top: 20px; font-size: .875rem; }

/* ---------- 17. Paneles (alumno, profesor, admin) ---------- */
.app-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--border); }
.app-header .bar { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-ink); font-weight: 600; font-size: .9375rem; }

.shell { min-height: 100vh; }
.sidebar { display: none; }
.shell-top { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--on-ink); }
.shell-top .bar { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.shell-top .menu > summary { background: transparent; color: var(--on-ink); border-color: rgba(255, 255, 255, .3); }
.shell-top .menu-panel { top: 100%; background: var(--ink); border-bottom: 0; }
.shell-top .menu-panel a:not(.btn) { color: var(--on-ink); border-color: rgba(255, 255, 255, .12); }
.shell-top .menu-panel a[aria-current="page"] { color: var(--brand-on-ink); }
.shell-top .menu-panel a:not(.btn)::after { color: var(--on-ink-muted); }
.shell-main { padding: 24px 0 64px; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); background: linear-gradient(90deg, var(--ink) 248px, transparent 248px); }
  .shell-top { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--ink); color: var(--on-ink); padding: 28px 16px;
  }
  .sidebar .logo { padding: 0 12px 4px; }
  .sidebar .role { padding: 0 12px 24px; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--on-ink-muted); font-weight: 600; }
  .side-link {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-field);
    color: var(--on-ink-muted); text-decoration: none; font-weight: 400;
  }
  .side-link svg { width: 18px; height: 18px; opacity: .85; }
  .side-link:hover { background: rgba(255, 255, 255, .08); color: var(--on-ink); text-decoration: none; }
  .side-link[aria-current="page"] { background: rgba(255, 255, 255, .1); color: var(--on-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-on-ink); }
  .sidebar .foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .875rem; }
  .sidebar .foot a { color: var(--on-ink-muted); }
  .shell-main { padding: 40px 0 80px; }
  .shell-main .wrap { max-width: calc(1160px + 2 * var(--gutter)); }
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 599px) { .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1; } }

/* Interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background-color .15s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-subtle); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--brand); outline-offset: 3px; }

/* ---------- 18. Animación ---------- */
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.entrar { animation: entrar .45s ease-out both; }
.entrar-2 { animation-delay: .08s; }
.entrar-3 { animation-delay: .16s; }
.entrar-4 { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 19. Barra de navegación inferior (área de alumno, móvil) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(var(--ink-rgb), .06);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px;
  color: var(--text-tertiary); text-decoration: none; font-size: .8125rem; font-weight: 600;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--accent); }
.bottom-nav a[aria-current="page"] svg { stroke-width: 2.4; }
@media (min-width: 960px) { .bottom-nav { display: none; } }
@media (max-width: 959px) { .has-bottom-nav { padding-bottom: 88px; } }
.date-badge { width: 52px; flex-shrink: 0; border-radius: 12px; background: var(--surface-ice); color: var(--accent); text-align: center; padding: 6px 0; line-height: 1.1; }
.date-badge b { display: block; font-size: 1.25rem; color: var(--text); }
.date-badge span { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
