/* Aula CCN. Blanco y azul institucional, la misma identidad que las diapositivas. */

:root {
  --cyan: #00AEEF;
  --navy: #2E5496;
  --dark: #013A60;
  --ink: #202428;
  --grey: #5A636E;
  --light: #F2F6FD;
  --card: #F6F9FE;
  --line: #DCE5F2;
  --ok: #2FA84F;
  --warn: #E88A1A;
  --danger: #E23B3B;
  --key: #7A53B0;
  --sombra: 0 1px 2px rgba(16, 38, 70, .06), 0 8px 24px rgba(16, 38, 70, .07);
  --radio: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Calibri, system-ui, -apple-system, sans-serif;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink);
  background: #fff;
}

a { color: var(--navy); }
code, pre, .mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }

/* ------------------------------------------------------------- cabecera */
.barra {
  position: sticky; top: 0; z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.barra .interior {
  max-width: 1180px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 18px;
}
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.marca .cubo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(150deg, var(--cyan), var(--navy));
  position: relative; flex: 0 0 auto;
}
.marca .cubo::after {
  content: ""; position: absolute; inset: 10px 10px auto auto;
  width: 12px; height: 12px; border-radius: 3px; background: #fff; opacity: .9;
}
.marca b { font-size: 16px; letter-spacing: .2px; }
.marca span { display: block; font-size: 12.5px; color: var(--grey); font-weight: 400; }
.barra nav { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14.5px; }
.barra nav a { color: var(--grey); text-decoration: none; }
.barra nav a:hover { color: var(--navy); }
.chip-alias {
  background: var(--light); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; font-size: 14px; color: var(--dark); font-weight: 600;
}

/* ------------------------------------------------------------- portada */
.hero {
  background: linear-gradient(180deg, var(--light), #fff);
  border-bottom: 1px solid var(--line);
}
.hero .interior { max-width: 1180px; margin: 0 auto; padding: 46px 22px 40px; }
.hero h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.4px; }
.hero p { margin: 0; color: var(--grey); max-width: 720px; }
.hero .barrita { display: flex; gap: 6px; margin-bottom: 20px; }
.hero .barrita i { display: block; width: 34px; height: 7px; border-radius: 2px; background: var(--cyan); }
.hero .barrita i:nth-child(2) { background: var(--cyan); opacity: .55; }
.hero .barrita i:nth-child(3) { background: var(--navy); }

.progreso-global {
  margin-top: 24px; display: flex; align-items: center; gap: 14px;
  font-size: 14.5px; color: var(--grey);
}
.progreso-global .pista {
  flex: 1; max-width: 420px; height: 9px; border-radius: 99px;
  background: #E4EBF6; overflow: hidden;
}
.progreso-global .relleno {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--navy));
  transition: width .5s ease;
}

/* --------------------------------------------------------------- rejilla */
.contenido { max-width: 1180px; margin: 0 auto; padding: 34px 22px 80px; }
.rejilla { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

.tarjeta-dia {
  border: 1px solid var(--line); border-radius: var(--radio); background: #fff;
  box-shadow: var(--sombra); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tarjeta-dia:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(16, 38, 70, .12); }
.tarjeta-dia .tapa { height: 6px; background: linear-gradient(90deg, var(--cyan), var(--navy)); }
.tarjeta-dia.cerrada { opacity: .72; }
.tarjeta-dia.cerrada .tapa { background: #C9D4E4; }
.tarjeta-dia .cuerpo { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.tarjeta-dia .num {
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--cyan); text-transform: uppercase;
}
.tarjeta-dia.cerrada .num { color: #9AA9BD; }
.tarjeta-dia h3 { margin: 6px 0 8px; font-size: 20px; }
.tarjeta-dia p { margin: 0 0 16px; color: var(--grey); font-size: 15px; flex: 1; }
.tarjeta-dia .pie { display: flex; align-items: center; gap: 10px; }

.boton {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff; border: 0; border-radius: 9px;
  padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; font-family: inherit;
}
.boton:hover { background: var(--dark); }
.boton.suave { background: var(--light); color: var(--dark); border: 1px solid var(--line); }
.boton.suave:hover { background: #E8EFFA; }
.boton.verde { background: var(--ok); }
.boton[disabled], .boton.inerte { background: #E3E9F2; color: #8A97A8; cursor: not-allowed; }

.etiqueta {
  font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 11px;
  background: var(--light); color: var(--navy); border: 1px solid var(--line);
}
.etiqueta.ok { background: #EAF7EE; color: #1F7A3A; border-color: #C7E8D3; }
.etiqueta.cerrado { background: #F1F4F8; color: #7C8899; }
.etiqueta.practica { background: #F3EEFB; color: #6B4EA8; border-color: #DDD0F2; }

/* ------------------------------------------------------------ dia y ejercicios */
.migas { font-size: 14px; color: var(--grey); margin-bottom: 8px; }
.migas a { color: var(--grey); text-decoration: none; }
.titulo-dia { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.titulo-dia h1 { margin: 0; font-size: 30px; }

.bloque {
  border: 1px solid var(--line); border-radius: var(--radio); background: #fff;
  box-shadow: var(--sombra); margin-bottom: 22px; overflow: hidden;
}
.bloque > header {
  padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--card);
  display: flex; align-items: center; gap: 12px;
}
.bloque > header h2 { margin: 0; font-size: 17px; }
.bloque .interior { padding: 20px 22px; }

.descargas { display: flex; flex-wrap: wrap; gap: 12px; }
.descarga {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 16px; background: #fff;
  min-width: 250px;
}
.descarga:hover { border-color: var(--cyan); background: var(--light); }
.descarga .icono {
  width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--navy);
}
.descarga .icono.pdf { background: #C0392B; }
.descarga .icono.zip { background: var(--navy); }
.descarga b { display: block; font-size: 14.5px; }
.descarga-datos span { font-size: 12.5px; color: var(--grey); }

/* ejercicio */
.ejercicio { border: 1px solid var(--line); border-radius: var(--radio); margin-bottom: 18px; background: #fff; box-shadow: var(--sombra); }
.ejercicio > header {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer;
  border-bottom: 1px solid transparent;
}
.ejercicio.abierto > header { border-bottom-color: var(--line); }
.ejercicio .indice {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--light); color: var(--navy); font-weight: 700; font-size: 15px;
  border: 1px solid var(--line);
}
.ejercicio.resuelto .indice { background: #EAF7EE; color: #1F7A3A; border-color: #C7E8D3; }

/* ejercicio de practica: no tiene bandera, no se cierra y no cuenta */
.ejercicio.practica { border-color: #DDD0F2; background: #FDFCFF; }
.ejercicio.practica > header { background: #F8F5FD; border-radius: var(--radio) var(--radio) 0 0; }
.ejercicio.practica.abierto > header { border-bottom-color: #DDD0F2; }
.ejercicio.practica .indice { background: #F3EEFB; color: #6B4EA8; border-color: #DDD0F2; }
.ejercicio > header h3 { margin: 0; font-size: 17.5px; flex: 1; }
.ejercicio > header .flecha { color: var(--grey); transition: transform .2s ease; }
.ejercicio.abierto > header .flecha { transform: rotate(90deg); }
.ejercicio .panel { display: none; padding: 4px 20px 20px; }
.ejercicio.abierto .panel { display: block; }

.enunciado { max-width: 900px; }
.enunciado h2 { font-size: 18px; margin: 26px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.enunciado h3 { font-size: 16px; margin: 20px 0 6px; }
.enunciado h1:first-child { display: none; }
.enunciado p { margin: 0 0 12px; }
.enunciado ul, .enunciado ol { margin: 0 0 14px; padding-left: 22px; }
.enunciado li { margin-bottom: 5px; }
.enunciado code { background: var(--light); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 14px; }
.enunciado pre {
  background: #0F1B2D; color: #D8E4F0; border-radius: 10px; padding: 14px 16px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.5;
}
.enunciado pre code { background: none; border: 0; padding: 0; color: inherit; }
.enunciado blockquote {
  margin: 0 0 14px; padding: 12px 16px; background: var(--light);
  border-left: 4px solid var(--cyan); border-radius: 0 8px 8px 0;
}
.enunciado blockquote p { margin: 0; }
.enunciado .tabla { overflow-x: auto; margin-bottom: 14px; }
.enunciado table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.enunciado th { background: var(--navy); color: #fff; text-align: left; padding: 9px 12px; }
.enunciado td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.enunciado tr:nth-child(even) td { background: var(--light); }

/* como abordarlo: un desplegable con todos los pasos */
.abordarlo {
  margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  max-width: 900px;
}
.abordarlo > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  padding: 13px 18px; font-weight: 600; font-size: 15.5px; color: var(--navy);
  border-radius: 12px;
}
.abordarlo > summary::-webkit-details-marker { display: none; }
.abordarlo > summary:hover { background: var(--light); }
.abordarlo > summary .flecha { color: var(--grey); transition: transform .2s ease; }
.abordarlo[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.abordarlo[open] > summary .flecha { transform: rotate(90deg); }
.abordarlo-interior { padding: 4px 18px 16px; font-size: 15px; }
.abordarlo-interior ol { margin: 10px 0 0; padding-left: 22px; }
.abordarlo-interior ol > li { margin-bottom: 12px; }
.abordarlo-interior ul { margin: 8px 0; padding-left: 20px; }
.abordarlo-interior li > p { margin: 0 0 6px; }
.abordarlo-interior li > p:last-child { margin-bottom: 0; }
.abordarlo-interior > p { margin: 12px 0 6px; }
.abordarlo-interior code {
  background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 13.5px;
}
.abordarlo-interior pre {
  background: #0F1B2D; color: #D8E4F0; border-radius: 9px; padding: 12px 14px; margin: 8px 0;
  overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.abordarlo-interior pre code { background: none; border: 0; padding: 0; color: inherit; }

/* pistas */
.pistas { margin: 18px 0; }
.pistas-grupo { margin: 0 0 10px; font-size: 15px; }
.pista-item {
  border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px;
  background: #FCFDFF;
}
.pista-item.abierta { border-style: solid; border-color: #F0D9AC; background: #FFFBF2; }
.pista-item b { color: var(--warn); font-size: 14px; }
.pista-item .texto { margin-top: 6px; font-size: 15px; }
.pista-item button {
  background: none; border: 0; color: var(--navy); cursor: pointer; font-size: 14.5px;
  font-family: inherit; padding: 0; text-decoration: underline;
}
.pista-item .texto p { margin: 0 0 8px; }
.pista-item .texto p:last-child { margin-bottom: 0; }
.pista-item .texto ul, .pista-item .texto ol { margin: 8px 0; padding-left: 20px; }
.pista-item .texto li { margin-bottom: 4px; }
.pista-item .texto code {
  background: #fff; border: 1px solid #EADFC6; border-radius: 5px; padding: 1px 5px; font-size: 13.5px;
}
.pista-item .texto pre {
  background: #0F1B2D; color: #D8E4F0; border-radius: 9px; padding: 12px 14px; margin: 8px 0;
  overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.pista-item .texto pre code { background: none; border: 0; padding: 0; color: inherit; }

/* bandera */
.caja-bandera {
  margin-top: 18px; padding: 16px 18px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.caja-bandera h4 { margin: 0 0 10px; font-size: 15px; }
.forma-bandera { display: flex; gap: 10px; flex-wrap: wrap; }
.forma-bandera input {
  flex: 1; min-width: 260px; padding: 11px 14px; border-radius: 9px;
  border: 1px solid var(--line); font-family: Consolas, monospace; font-size: 15px;
  background: #fff; color: var(--ink);
}
.forma-bandera input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--cyan); }
.respuesta { margin-top: 10px; font-size: 14.5px; font-weight: 600; min-height: 20px; }
.respuesta.bien { color: var(--ok); }
.respuesta.mal { color: var(--danger); }
.caja-bandera.hecho { background: #EAF7EE; border-color: #C7E8D3; }

/* avisos */
.aviso {
  display: flex; gap: 12px; padding: 14px 18px; border-radius: 12px;
  background: var(--light); border-left: 4px solid var(--cyan); margin-bottom: 18px;
}
.aviso.cerrado { background: #F6F7F9; border-left-color: #B9C4D3; }
.aviso b { display: block; margin-bottom: 2px; }
.aviso p { margin: 0; color: var(--grey); font-size: 15px; }

/* entrada */
.entrada { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--light), #fff 60%); padding: 24px; }
.entrada .caja {
  width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(16, 38, 70, .12); padding: 34px 34px 30px;
}
.entrada h1 { margin: 18px 0 6px; font-size: 25px; }
.entrada p { margin: 0 0 20px; color: var(--grey); font-size: 15px; }
.entrada label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.entrada input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 16px; font-family: inherit; margin-bottom: 14px;
}
.entrada input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--cyan); }
.entrada .boton { width: 100%; justify-content: center; }
.error { color: var(--danger); font-size: 14.5px; margin-bottom: 12px; }

/* admin */
.tabla-admin { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla-admin th { text-align: left; background: var(--navy); color: #fff; padding: 11px 14px; }
.tabla-admin td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tabla-admin tr:nth-child(even) td { background: var(--light); }
.tabla-admin .mini { font-size: 12.5px; color: var(--grey); }
.interruptores { display: grid; gap: 12px; }
.interruptor {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.interruptor b { flex: 1; }

.pie-pagina {
  border-top: 1px solid var(--line); padding: 22px; text-align: center;
  color: var(--grey); font-size: 13.5px;
}

@media (max-width: 640px) {
  .hero h1 { font-size: 27px; }
  .barra nav { gap: 10px; font-size: 13.5px; }
  .contenido { padding: 24px 16px 60px; }
}

/* =======================================================================
   Descargas y animaciones suaves. Nada llamativo: solo que las cosas
   entren y se muevan con calma.
   ======================================================================= */

.descarga { flex: 1; }
.descarga-datos { flex: 1; min-width: 0; }
.descarga .boton-descarga {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; margin-left: auto;
  background: var(--light); border: 1px solid var(--line); color: var(--navy);
  border-radius: 9px; padding: 8px 14px; font-size: 13.5px; font-weight: 700;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.descarga:hover .boton-descarga { background: var(--navy); border-color: var(--navy); color: #fff; }
.descarga .boton-descarga svg { display: block; }
.descarga { transition: border-color .22s ease, background .22s ease, transform .22s cubic-bezier(.22,.8,.3,1), box-shadow .22s ease; }
.descarga:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16,38,70,.10); }

@keyframes subir {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes temblar {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  50%      { transform: translateX(5px); }
  75%      { transform: translateX(-3px); }
}

.hero .interior > * { animation: subir .5s cubic-bezier(.22,.8,.3,1) both; }
.hero .interior > *:nth-child(2) { animation-delay: .06s; }
.hero .interior > *:nth-child(3) { animation-delay: .12s; }
.hero .interior > *:nth-child(4) { animation-delay: .18s; }

.rejilla .tarjeta-dia { animation: subir .5s cubic-bezier(.22,.8,.3,1) both; }
.rejilla .tarjeta-dia:nth-child(2) { animation-delay: .06s; }
.rejilla .tarjeta-dia:nth-child(3) { animation-delay: .12s; }
.rejilla .tarjeta-dia:nth-child(4) { animation-delay: .18s; }
.rejilla .tarjeta-dia:nth-child(5) { animation-delay: .24s; }
.rejilla .tarjeta-dia:nth-child(6) { animation-delay: .30s; }
.tarjeta-dia { transition: transform .26s cubic-bezier(.22,.8,.3,1), box-shadow .26s ease; }
.tarjeta-dia:not(.cerrada):hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(16,38,70,.14); }

.progreso-global .relleno { transition: width .7s cubic-bezier(.3,.9,.35,1); }

/* El panel del ejercicio se abre con una rejilla que crece, sin saltos. */
.ejercicio .panel {
  display: grid; grid-template-rows: 0fr; padding: 0 20px; opacity: 0;
  transition: grid-template-rows .34s cubic-bezier(.22,.8,.3,1), padding .34s ease, opacity .26s ease;
}
.ejercicio.abierto .panel { grid-template-rows: 1fr; padding: 4px 20px 20px; opacity: 1; }
.ejercicio .panel > * { min-width: 0; }
.ejercicio .panel-interior { overflow: hidden; min-height: 0; }
.ejercicio { transition: box-shadow .24s ease, border-color .24s ease; }
.ejercicio.abierto { box-shadow: 0 14px 34px rgba(16,38,70,.10); }
.ejercicio > header .flecha { transition: transform .28s cubic-bezier(.22,.8,.3,1); }

.pista-item { transition: border-color .28s ease, background .28s ease; }
.pista-item .texto { animation: subir .32s ease both; }
.boton { transition: background .2s ease, transform .16s ease, box-shadow .2s ease; }
.boton:not(.inerte):hover { transform: translateY(-1px); }
.boton:not(.inerte):active { transform: translateY(0); }
.caja-bandera { transition: background .35s ease, border-color .35s ease; }
.caja-bandera.temblor { animation: temblar .4s ease; }
.respuesta { animation: subir .28s ease both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
