/* Página de inicio: cabecera, tarjetas de lecciones y modal de estudiante */

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(120% 140% at 0% 0%, #22379a 0%, var(--noche) 60%);
  padding: calc(40px + env(safe-area-inset-top)) 16px 56px;
}
.hero-in { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; }
.hero-deco {
  position: absolute; right: -30px; bottom: -40px; width: 300px; height: 300px;
  color: rgba(255,255,255,.08); transform: rotate(-12deg);
}
.eyebrow {
  font-family: var(--f-mono); font-size: 12px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: #ffb38a;
}
.eyebrow.oscuro { color: var(--naranja); }
.hero h1 {
  font-family: var(--f-titulo); font-weight: 400; text-transform: uppercase;
  font-size: clamp(48px, 11vw, 104px); line-height: .95; letter-spacing: .005em; margin: 10px 0 8px;
}
.lema { font-size: clamp(17px, 2.4vw, 21px); font-weight: 600; color: #c9d3ff; }

.quien {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 28px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 6px 8px 6px 6px; max-width: 100%;
}
.quien[hidden] { display: none; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--naranja); font-weight: 800; font-size: 15px;
}
.quien-hola { font-size: 12px; color: #c9d3ff; line-height: 1.1; }
.quien-nombre { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.quien-cambiar {
  margin-left: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; flex: none;
  background: rgba(255,255,255,.12); transition: background .15s ease;
}
@media (hover: hover) { .quien-cambiar:hover { background: rgba(255,255,255,.22); } }

.contenido { max-width: 1072px; margin: 0 auto; padding: 0 16px 40px; position: relative; z-index: 2; }

.estado:empty { display: none; }
.estado {
  background: #fff; border: 1px solid var(--borde); border-left: 4px solid var(--naranja);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-size: 14.5px; color: var(--tx2);
  box-shadow: var(--sombra);
}
.estado.ok { border-left-color: var(--verde); }

.progreso {
  background: #fff; border: 1px solid var(--borde); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--sombra); margin-bottom: 8px;
}
.progreso[hidden] { display: none; }
.progreso-barra { height: 10px; border-radius: 99px; background: var(--azul-suave); overflow: hidden; }
.progreso-barra span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--azul), var(--naranja));
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.progreso p { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--tx2); }

.seccion {
  font-family: var(--f-titulo); font-weight: 400; text-transform: uppercase; font-size: 28px;
  color: var(--azul); margin: 28px 0 14px;
}

/* Tarjetas */
.tarjetas { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 720px) { .tarjetas { grid-template-columns: 1fr; gap: 14px; } }

.tarjeta {
  display: flex; align-items: center; gap: 18px; width: 100%; text-align: left; text-decoration: none;
  background: var(--tarjeta); border: 2px solid var(--borde); border-radius: var(--radio);
  padding: 20px 22px; min-height: 112px;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, border-color .18s ease;
}
a.tarjeta:active { transform: scale(.985); }
@media (hover: hover) {
  a.tarjeta:hover { transform: translateY(-2px); box-shadow: var(--sombra); border-color: #cfcde6; }
}
.num {
  width: 64px; height: 64px; border-radius: 18px; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums;
  background: var(--c, var(--azul)); position: relative;
}
.tarjeta-cuerpo { flex: 1; min-width: 0; }
.tarjeta h3 { font-size: 20px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.tarjeta .meta { font-size: 14.5px; color: var(--tx2); margin-top: 3px; }
.accion {
  flex: none; font-weight: 800; font-size: 14px; letter-spacing: .04em; color: var(--morado);
  text-transform: uppercase;
}

/* Estados */
.tarjeta.completada .num::after {
  content: "✓"; position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--verde); color: #fff; font-size: 13px; display: grid; place-items: center;
  border: 3px solid var(--tarjeta);
}
.tarjeta.completada .accion { color: var(--verde); }
.tarjeta.bloqueada { cursor: not-allowed; }
.tarjeta.bloqueada .num { background: #c9ccd8; }
.tarjeta.bloqueada h3 { color: #7b8296; }
.tarjeta.bloqueada .accion { color: var(--gris); font-size: 18px; letter-spacing: 0; }
.tarjeta.pronto .accion { font-size: 12px; color: var(--gris); }

.ayuda { margin-top: 22px; font-size: 14px; color: var(--tx2); max-width: 64ch; }
.pie {
  text-align: center; padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  font-family: var(--f-mono); font-size: 12px; color: var(--gris); letter-spacing: .08em;
}

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(10,18,51,.62); backdrop-filter: blur(4px);
  animation: aparecer .2s ease-out;
}
.modal[hidden] { display: none; }
.modal-caja {
  width: min(460px, 100%); background: #fff; border-radius: 24px; padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(10,18,51,.35);
  animation: subir .28s cubic-bezier(.2,.8,.2,1);
}
.modal-caja h2 { font-family: var(--f-titulo); font-weight: 400; text-transform: uppercase; font-size: 36px; color: var(--azul); margin: 4px 0 8px; }
.modal-texto { color: var(--tx2); font-size: 15px; margin-bottom: 18px; }
.campo { display: block; margin-bottom: 18px; }
.campo span { display: block; font-size: 13px; font-weight: 700; color: var(--tx2); margin-bottom: 6px; }
.campo select {
  width: 100%; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 12px;
  border: 2px solid var(--borde); background: #fff; color: var(--tx);
}
.campo select:focus, .campo input:focus { outline: none; border-color: var(--azul); }
.campo input {
  width: 100%; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 12px;
  border: 2px solid var(--borde); background: #fff; color: var(--tx);
}
.error { min-height: 20px; margin: -6px 0 10px; color: #c92a2a; font-size: 14px; font-weight: 600; }
.btn-texto { display: block; width: 100%; margin-top: 10px; padding: 10px; font-weight: 700; font-size: 14px; color: var(--tx2); }
.btn-primario {
  width: 100%; padding: 15px 18px; border-radius: 14px; font-weight: 800; font-size: 16px;
  color: #fff; background: var(--azul); transition: background .15s ease, transform .12s ease;
}
.btn-primario:active { transform: scale(.98); }
.btn-primario:disabled { background: #b7bfdc; cursor: not-allowed; }
@media (hover: hover) { .btn-primario:not(:disabled):hover { background: var(--azul-2); } }

@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* Borrar trabajos guardados (solo este navegador) */
.reiniciar { margin-top: 10px; }
.btn-reiniciar {
  padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--tx2);
  background: transparent; border: 1.5px solid #d6dbec; transition: background .15s ease, color .15s ease;
}
@media (hover: hover) { .btn-reiniciar:hover { background: #eef1fa; color: #1e3fa8; } }
.btn-reiniciar.confirmar { background: #e8590c; border-color: #e8590c; color: #fff; }
