#cm-root,#cm-pie{
  --azul:#0F69B4;--azul-700:#0B4F8A;--azul-900:#0A2A4D;--azul-50:#EAF2FB;
  --rojo:#EB3C46;--rojo-700:#C42A33;--verde:#1E7F52;--verde-50:#E5F4EC;
  --ambar:#9A6200;--ambar-50:#FFF4DC;--texto:#1B2533;--texto-2:#4A5668;
  --borde:#D9E1EA;--fondo:#F5F8FB;--radio:12px;
  --sombra:0 1px 2px rgba(10,42,77,.06),0 4px 16px rgba(10,42,77,.06);
  font-family:Roboto,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--texto);line-height:1.55;
}
body.alto-contraste #cm-root,body.alto-contraste #cm-pie{--azul:#003A75;--azul-700:#002A55;--azul-900:#000;--azul-50:#fff;--texto:#000;--texto-2:#000;--borde:#000;--fondo:#fff}
body{font-family:Roboto,system-ui,-apple-system,"Segoe UI",sans-serif}
h1,h2,h3,.h1,.h2,.h3{font-family:"Roboto Slab",Georgia,serif}

/* Portada: ocupa todo el ancho y oculta el contenido estándar (salvo en modo edición) */
#page-site-index:not(.editing) #topofscroll{display:none}
#page-site-index #page.drawers{padding-left:0;padding-right:0}
#cm-root{background:var(--fondo)}
#cm-root *{box-sizing:border-box}
#cm-root a{color:var(--azul)}
#cm-root .wrap,#cm-pie .wrap{max-width:1180px;margin:0 auto;padding:0 24px}
#cm-root h1,#cm-root h2,#cm-root h3{font-family:"Roboto Slab",Georgia,serif;line-height:1.2;color:var(--azul-900);margin:0}
#cm-root p,#cm-root ul,#cm-root ol{margin:0;padding:0}
#cm-root svg.i,#cm-pie svg.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#cm-root svg.i.fill{fill:currentColor;stroke:none}

/* Barra utilitaria */
#cm-root .util{background:var(--azul-900);color:#fff;font-size:.82rem}
#cm-root .util .wrap{display:flex;justify-content:space-between;align-items:center;min-height:40px;gap:16px}
#cm-root .util a{color:#fff;text-decoration:none;display:inline-flex;align-items:center;gap:6px;opacity:.92}
#cm-root .util a:hover{opacity:1;text-decoration:underline}
#cm-root .util .der{display:flex;align-items:center;gap:18px}
#cm-root .acc{display:flex;align-items:center;gap:4px}
#cm-root .acc button{background:transparent;border:1px solid rgba(255,255,255,.35);color:#fff;border-radius:6px;min-width:30px;height:28px;cursor:pointer;font:inherit;font-weight:500;display:inline-grid;place-items:center}
#cm-root .acc button:hover,#cm-root .acc button[aria-pressed="true"]{background:rgba(255,255,255,.15)}
#cm-root .redes{display:flex;gap:6px}
#cm-root .redes a{width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,.12);justify-content:center}
#cm-root .redes svg.i{width:14px;height:14px}

/* Botones */
.cm-btn{display:inline-flex;align-items:center;gap:8px;padding:11px 20px;border-radius:999px;font-weight:500;font-size:.95rem;line-height:1.3;text-decoration:none!important;border:2px solid transparent;cursor:pointer;font-family:inherit;transition:background .15s,transform .15s}
.cm-btn:hover{transform:translateY(-1px)}
#cm-root .cm-pri,.navbar .cm-pri{background:var(--azul,#0F69B4);color:#fff}
#cm-root .cm-pri:hover,.navbar .cm-pri:hover{background:var(--azul-700,#0B4F8A);color:#fff}
#cm-root .cm-rojo{background:var(--rojo);color:#fff}
#cm-root .cm-rojo:hover{background:var(--rojo-700)}
#cm-root .cm-sec{background:#fff;color:var(--azul);border-color:var(--azul)}
#cm-root .cm-sec:hover{background:var(--azul-50)}
.navbar .cm-pri{padding:8px 16px;font-size:.9rem;margin-right:12px}

/* Hero */
#cm-root .hero{background:linear-gradient(135deg,var(--azul-900) 0%,var(--azul-700) 55%,var(--azul) 100%);color:#fff;position:relative;overflow:hidden}
#cm-root .hero::after{content:"";position:absolute;right:-120px;top:-120px;width:520px;height:520px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.10),transparent 70%)}
#cm-root .hero .wrap{display:grid;grid-template-columns:1.25fr .9fr;gap:48px;align-items:center;padding-top:64px;padding-bottom:72px;position:relative;z-index:1}
#cm-root .eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:.8rem;font-weight:500;letter-spacing:.08em;text-transform:uppercase;background:rgba(255,255,255,.12);padding:6px 12px;border-radius:999px;margin-bottom:18px}
#cm-root .hero h1{color:#fff;font-size:clamp(1.9rem,3.6vw,2.8rem);margin-bottom:16px}
#cm-root .hero .lead{font-size:1.12rem;font-weight:400;opacity:.92;max-width:560px;margin-bottom:28px}
#cm-root .hero .ctas{display:flex;gap:12px;flex-wrap:wrap}
#cm-root .hero .cm-sec{background:transparent;color:#fff;border-color:rgba(255,255,255,.7)}
#cm-root .hero .cm-sec:hover{background:rgba(255,255,255,.1)}
#cm-root .hero .cm-blanco{background:#fff;color:var(--azul-900)}
#cm-root .aviso{background:#fff;color:var(--texto);border-radius:16px;padding:26px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
#cm-root .aviso .tag{display:inline-flex;align-items:center;gap:6px;background:var(--ambar-50);color:var(--ambar);font-weight:700;font-size:.78rem;padding:4px 10px;border-radius:999px;text-transform:uppercase;letter-spacing:.04em}
#cm-root .aviso h2{font-size:1.3rem;margin:12px 0 16px}
#cm-root .fechas{list-style:none;display:grid;gap:12px;margin-bottom:20px}
#cm-root .fechas li{display:flex;gap:12px;align-items:flex-start;padding:12px;border:1px solid var(--borde);border-radius:10px}
#cm-root .fechas .ic{width:40px;height:40px;border-radius:10px;background:var(--azul-50);color:var(--azul);display:grid;place-items:center;flex-shrink:0}
#cm-root .fechas b{display:block;font-size:.95rem}
#cm-root .fechas span{font-size:.88rem;color:var(--texto-2)}
#cm-root .aviso .cm-btn{width:100%;justify-content:center}

/* Accesos rápidos */
#cm-root .accesos{margin-top:-36px;position:relative;z-index:2}
#cm-root .accesos .grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
#cm-root .acceso{background:#fff;border-radius:var(--radio);box-shadow:var(--sombra);padding:22px;text-decoration:none;color:var(--texto);display:flex;flex-direction:column;gap:10px;border:1px solid var(--borde);transition:border-color .15s,transform .15s}
#cm-root .acceso:hover{border-color:var(--azul);transform:translateY(-2px)}
#cm-root .acceso .ic{width:48px;height:48px;border-radius:12px;display:grid;place-items:center;background:var(--azul-50);color:var(--azul)}
#cm-root .acceso .ic svg.i{width:24px;height:24px}
#cm-root .acceso.rojo .ic{background:#FDECEE;color:var(--rojo-700)}
#cm-root .acceso h3{font-family:Roboto,sans-serif;font-size:1.05rem;font-weight:700;color:var(--texto)}
#cm-root .acceso p{font-size:.88rem;color:var(--texto-2);flex:1}
#cm-root .acceso .ir{display:inline-flex;align-items:center;gap:6px;color:var(--azul);font-weight:500;font-size:.9rem}
#cm-root .acceso .ir svg.i{width:16px;height:16px}

/* Secciones */
#cm-root section.sec{padding:72px 0}
#cm-root .sec-cab{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:28px;flex-wrap:wrap}
#cm-root .sec-cab h2{font-size:clamp(1.5rem,2.6vw,2rem)}
#cm-root .sec-cab p{color:var(--texto-2);margin-top:6px}
#cm-root .filtros{display:flex;gap:8px;flex-wrap:wrap}
#cm-root .chip{border:1px solid var(--borde);background:#fff;color:var(--texto);padding:8px 16px;border-radius:999px;cursor:pointer;font:inherit;font-size:.88rem;font-weight:500}
#cm-root .chip[aria-pressed="true"]{background:var(--azul);border-color:var(--azul);color:#fff}
#cm-root .cursos{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:20px}
#cm-root .curso{background:#fff;border:1px solid var(--borde);border-radius:var(--radio);overflow:hidden;display:flex;flex-direction:column;box-shadow:var(--sombra)}
#cm-root .curso .portada{height:120px;display:flex;align-items:flex-end;justify-content:space-between;padding:16px;color:#fff}
#cm-root .curso .portada .ic{width:56px;height:56px;border-radius:14px;background:rgba(255,255,255,.18);display:grid;place-items:center}
#cm-root .curso .portada .ic svg.i{width:30px;height:30px}
#cm-root .curso .portada .cat{font-size:.74rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;background:rgba(0,0,0,.22);padding:4px 10px;border-radius:999px}
#cm-root .p-clinico{background:linear-gradient(135deg,#0F69B4,#2C8FD9)}
#cm-root .p-gestion{background:linear-gradient(135deg,#0A2A4D,#1F5C8F)}
#cm-root .p-buentrato{background:linear-gradient(135deg,#B8303A,#EB3C46)}
#cm-root .curso .cuerpo{padding:18px;display:flex;flex-direction:column;gap:12px;flex:1}
#cm-root .curso h3{font-family:Roboto,sans-serif;font-size:1.05rem;font-weight:700;color:var(--texto)}
#cm-root .meta{display:flex;gap:14px;flex-wrap:wrap;font-size:.84rem;color:var(--texto-2)}
#cm-root .meta span{display:inline-flex;align-items:center;gap:5px}
#cm-root .meta svg.i{width:15px;height:15px}
#cm-root .estado{align-self:flex-start;font-size:.78rem;font-weight:700;padding:4px 10px;border-radius:999px}
#cm-root .estado.abierto{background:var(--verde-50);color:var(--verde)}
#cm-root .estado.pronto{background:var(--ambar-50);color:var(--ambar)}
#cm-root .curso .pie{margin-top:auto;padding-top:6px}
#cm-root .curso .pie a{display:inline-flex;align-items:center;gap:6px;font-weight:500;text-decoration:none}
#cm-root .curso .pie a:hover{text-decoration:underline}

/* Cómo participar */
#cm-root .pasos{background:#fff;border-top:1px solid var(--borde);border-bottom:1px solid var(--borde)}
#cm-root .lineapasos{display:grid;grid-template-columns:repeat(4,1fr);gap:24px;counter-reset:p;list-style:none}
#cm-root .lineapasos li{position:relative;padding-top:56px}
#cm-root .lineapasos li::before{counter-increment:p;content:counter(p);position:absolute;top:0;left:0;width:40px;height:40px;border-radius:50%;background:var(--azul);color:#fff;font-weight:700;display:grid;place-items:center;font-family:"Roboto Slab",serif}
#cm-root .lineapasos li::after{content:"";position:absolute;top:20px;left:52px;right:-12px;height:2px;background:var(--borde)}
#cm-root .lineapasos li:last-child::after{display:none}
#cm-root .lineapasos h3{font-family:Roboto,sans-serif;font-size:1rem;font-weight:700;margin-bottom:4px;color:var(--texto)}
#cm-root .lineapasos p{font-size:.9rem;color:var(--texto-2)}

/* Enlaces y ayuda */
#cm-root .enlaces{display:grid;grid-template-columns:1fr 1fr;gap:24px}
#cm-root .bloque{background:#fff;border:1px solid var(--borde);border-radius:var(--radio);padding:24px}
#cm-root .bloque h3{font-family:Roboto,sans-serif;font-size:.82rem;text-transform:uppercase;letter-spacing:.08em;color:var(--texto-2);margin-bottom:12px}
#cm-root .bloque ul{list-style:none}
#cm-root .bloque li+li{border-top:1px solid var(--borde)}
#cm-root .bloque a{display:flex;justify-content:space-between;align-items:center;padding:12px 4px;text-decoration:none;color:var(--texto);font-weight:500}
#cm-root .bloque a:hover{color:var(--azul)}
#cm-root .bloque a svg.i{width:16px;height:16px;color:var(--texto-2)}
#cm-root .ayuda{background:var(--azul-50);border-radius:16px;padding:32px;display:flex;justify-content:space-between;align-items:center;gap:24px;flex-wrap:wrap;margin-top:48px}
#cm-root .ayuda h2{font-size:1.4rem;margin-bottom:4px}
#cm-root .ayuda p{color:var(--texto-2)}

/* Página de acceso: formulario dentro de la portada */
#page-login-index #page{background:none!important}
#cm-root .hero .login-container{background:#fff;color:var(--texto);border-radius:16px;padding:26px;box-shadow:0 20px 50px rgba(0,0,0,.25);max-width:none;width:100%;margin:0}
#cm-root .hero .login-container h1,#cm-root .hero .login-container h2{color:var(--azul-900);font-size:1.3rem}
#cm-root .aviso.ancho{display:grid;grid-template-columns:1fr 2fr auto;gap:24px;align-items:center;margin-bottom:40px;box-shadow:var(--sombra);border:1px solid var(--borde)}
#cm-root .aviso.ancho h2{margin:8px 0 0}
#cm-root .aviso.ancho .fechas{margin:0;grid-template-columns:1fr 1fr}
#cm-root .aviso.ancho .cm-btn{width:auto}
@media (max-width:980px){#cm-root .aviso.ancho,#cm-root .aviso.ancho .fechas{grid-template-columns:1fr}}

/* Pie institucional (todas las páginas) */
#page-footer.footer-popover{background:transparent!important}
#cm-pie{background:var(--azul-900);color:#DCE6F2;margin-top:72px;font-size:.9rem}
#cm-pie .wrap{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:40px;padding-top:48px;padding-bottom:40px}
#cm-pie h4{color:#fff;font-size:.95rem;margin:0 0 12px;font-family:Roboto,sans-serif;font-weight:700}
#cm-pie ul{list-style:none;display:grid;gap:8px;margin:0;padding:0}
#cm-pie a{color:#DCE6F2;text-decoration:none}
#cm-pie a:hover{color:#fff;text-decoration:underline}
#cm-pie p{margin:0}
#cm-pie .marca{font-family:"Roboto Slab",serif;font-weight:700;color:#fff;font-size:1.1rem;margin-bottom:10px}
#cm-pie .legal{border-top:1px solid rgba(255,255,255,.12);padding:16px 0;font-size:.8rem;color:#A9BCD3}
#cm-pie .legal .wrap{display:flex;justify-content:space-between;padding-top:0;padding-bottom:0;gap:12px;flex-wrap:wrap}

@media (max-width:980px){
  #cm-root .hero .wrap{grid-template-columns:1fr;padding-top:44px}
  #cm-root .accesos{margin-top:24px}
  #cm-root .accesos .grid{grid-template-columns:1fr 1fr}
  #cm-root .lineapasos{grid-template-columns:1fr 1fr}
  #cm-root .lineapasos li::after{display:none}
  #cm-root .enlaces{grid-template-columns:1fr}
  #cm-pie .wrap{grid-template-columns:1fr}
  #cm-root .util .ocultable{display:none}
  .navbar .cm-pri span{display:none}
}
@media (max-width:560px){
  #cm-root .accesos .grid,#cm-root .lineapasos{grid-template-columns:1fr}
}

/* ===== Agregados: versión robusta (archivos del tema) ===== */

/* Mientras se arma la portada de acceso no se ve el formulario suelto (máximo 3 s, ver cabecera) */
html:not(.cm-listo) body#page-login-index #page{visibility:hidden}
#page-login-index.cm-login-portada #page-content{display:none}

/* Logo oficial en la barra superior (CSS puro: sin parpadeo) */
.navbar .navbar-brand{gap:10px}
.navbar .navbar-brand::before{content:"";width:49px;height:44px;flex:0 0 auto;background:url(logo-ssm.png) center/contain no-repeat}
.navbar .navbar-brand .sitename{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.navbar .navbar-brand::after{content:"Capacitación\A Servicio de Salud del Maule";white-space:pre;font:700 .82rem/1.15 Roboto,system-ui,sans-serif;color:#0A2A4D}
@media (max-width:1199.98px){.navbar .navbar-brand::after{content:none}}
.navbar #cm-mi-area svg.i{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}

/* Pie: logo sobre fondo blanco */
#cm-pie .pie-logo{display:inline-block;background:#fff;border-radius:10px;padding:8px 10px;margin-bottom:14px}
#cm-pie .pie-logo img{display:block;height:72px;width:auto}

/* Tarjetas: área adicional, estado cerrado, esqueleto de carga y aviso de lista vacía */
#cm-root .p-otro{background:linear-gradient(135deg,#1E7F52,#2FA36D)}
#cm-root .estado.cerrado{background:#EEF1F5;color:var(--texto-2)}
#cm-root .curso.esqueleto{min-height:300px;background:linear-gradient(110deg,#EEF3F8 30%,#F7FAFC 50%,#EEF3F8 70%) 0 0/200% 100%;animation:cm-carga 1.2s linear infinite;box-shadow:none}
@keyframes cm-carga{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){#cm-root .curso.esqueleto{animation:none}}
#cm-root .vacio{grid-column:1/-1;padding:28px;border:1px dashed var(--borde);border-radius:var(--radio);text-align:center;color:var(--texto-2);background:#fff}
#cm-root .mas{margin-top:22px}
#cm-root .mas a{display:inline-flex;align-items:center;gap:6px;font-weight:500;text-decoration:none}
#cm-root .mas a:hover{text-decoration:underline}

/* Área personal: «Mis cursos» con los bloques reales de Moodle */
#page-my-index.cm-con-miscursos #page-header{display:none}
#page-my-index.cm-con-miscursos #topofscroll{padding-top:0;padding-bottom:0}
#cm-root .miscursos{padding-bottom:0}
#cm-root .miscursos .block-region{display:grid;gap:20px}
#cm-root .miscursos .block.card{border-radius:var(--radio);margin:0!important}
#cm-root .miscursos .block_myoverview .card-title{display:none}

/* Página de acceso sin el fondo degradado de pantalla completa */
#page-login-index.cm-login-portada #page{background:var(--fondo,#F5F8FB)!important}

/* Páginas editables (Oferta de cursos, Ayudas técnicas, Accesibilidad) */
.theme_boost_union-page1 #region-main,.theme_boost_union-page2 #region-main,.theme_boost_union-help #region-main{max-width:980px;margin:0 auto}
.theme_boost_union-page1 #region-main table,.theme_boost_union-page2 #region-main table,.theme_boost_union-help #region-main table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #D9E1EA;border-radius:12px;overflow:hidden;margin:0 0 28px}
.theme_boost_union-page1 #region-main th,.theme_boost_union-page1 #region-main td,.theme_boost_union-help #region-main th,.theme_boost_union-help #region-main td{padding:12px 14px;border-bottom:1px solid #D9E1EA;text-align:left;vertical-align:top}
.theme_boost_union-page1 #region-main tr:last-child td,.theme_boost_union-help #region-main tr:last-child td{border-bottom:0}
.theme_boost_union-page1 #region-main th,.theme_boost_union-help #region-main th{background:#EAF2FB;color:#0A2A4D;font-weight:700}
.theme_boost_union-page1 #region-main h3,.theme_boost_union-page2 #region-main h3,.theme_boost_union-help #region-main h3{margin-top:28px}
.theme_boost_union-help #region-main details{background:#fff;border:1px solid #D9E1EA;border-radius:12px;padding:14px 18px;margin:0 0 12px}
.theme_boost_union-help #region-main summary{font-weight:700;color:#0A2A4D;cursor:pointer}
.theme_boost_union-help #region-main details[open] summary{margin-bottom:8px}
@media (max-width:700px){
  .theme_boost_union-page1 #region-main table{display:block;overflow-x:auto}
}
/* La columna «Ícono» solo sirve para la portada: no se muestra en la página pública */
.theme_boost_union-page1 #region-main table th:nth-child(6),.theme_boost_union-page1 #region-main table td:nth-child(6){display:none}

/* Celular: barra utilitaria sin redes sociales (siguen en el pie del sitio oficial) y acceso primero */
@media (max-width:560px){
  #cm-root .util .redes{display:none}
  #cm-root .util .wrap{gap:10px}
  #cm-root .util a{font-size:.78rem}
}
@media (max-width:980px){
  .cm-login-portada #cm-root .hero .wrap{gap:18px;padding-top:28px;padding-bottom:40px}
  .cm-login-portada #cm-root .hero .wrap > div:first-child{display:contents}
  .cm-login-portada #cm-root .hero .eyebrow{order:1;justify-self:start;margin-bottom:0}
  .cm-login-portada #cm-root .hero h1{order:2;margin-bottom:0}
  .cm-login-portada #cm-root .hero .login-container{order:3}
  .cm-login-portada #cm-root .hero .lead{order:4;margin-bottom:0}
  .cm-login-portada #cm-root .hero .ctas{order:5}
}
