/* ===== Academia EDUCAR-IA — Identidad "Bright Luxury Tech" ===== */
:root {
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --primary: #2563eb;      /* Azul cobalto eléctrico */
  --purple: #7c3aed;       /* Púrpura vivo */
  --pink: #ec4899;         /* Magenta (degradados) */
  --green: #10b981;        /* Verde menta éxito/progreso */
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 30px -5px rgba(37, 99, 235, 0.10);
  --shadow-hover: 0 20px 40px -10px rgba(37, 99, 235, 0.18);
  --radius: 20px;
  --grad: linear-gradient(135deg, #2563eb, #7c3aed);
  --grad-soft: linear-gradient(135deg, #0ea5e9, #2563eb);
  --grad-pink: linear-gradient(135deg, #7c3aed, #ec4899);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg-main);
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { text-decoration: none; color: inherit; }
header.top {
  background: var(--card-bg); padding: 13px 28px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--primary); }
.logo img { height: 36px; width: auto; }
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--text-muted); line-height: 1.15; }
.userbox { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.userbox b { color: var(--text-dark); }
main { flex: 1; width: 100%; max-width: 1150px; margin: 0 auto; padding: 26px 22px 46px; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; margin: 24px 0 12px; color: var(--text-dark); }
.sub { color: var(--text-muted); font-size: 14px; margin-bottom: 6px; }

/* ===== Tarjetas premium ===== */
.premium {
  background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 22px; transition: transform .2s ease, box-shadow .2s ease;
}
.premium:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* ===== Banner degradado (saludo / avisos) ===== */
.hero {
  background: var(--grad); color: #fff; border-radius: var(--radius); padding: 26px 30px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.hero h1 { color: #fff; font-size: 23px; }
.hero p { opacity: .92; font-size: 14px; margin-top: 4px; }
.badge-level {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); border-radius: 40px;
  padding: 8px 18px; font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}

/* ===== Progreso ===== */
.pbar-bg { background: #e2e8f0; border-radius: 99px; height: 10px; width: 100%; overflow: hidden; }
.pbar-fill { background: linear-gradient(90deg, var(--primary), var(--green)); height: 100%; border-radius: 99px; transition: width .5s ease; }

/* ===== Botones ===== */
.btn {
  background: var(--grad); color: #fff; font-weight: 700; border: none; border-radius: 14px; padding: 11px 22px;
  cursor: pointer; font-size: 14px; box-shadow: 0 4px 14px rgba(37,99,235,.28); display: inline-block; text-align: center;
  transition: opacity .15s;
}
.btn:hover { opacity: .92; }
.btn.ghost { background: #eef2ff; color: var(--primary); box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: 12.5px; border-radius: 10px; }
.btn-link { color: var(--primary); font-weight: 600; font-size: 13.5px; }

/* ===== Curso (dashboard) ===== */
.grid-cursos { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.curso-card { display: flex; flex-direction: column; gap: 12px; }
.curso-card .cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.curso-card h3 { font-size: 16px; font-weight: 800; line-height: 1.25; }
.curso-card .meta { font-size: 12.5px; color: var(--text-muted); }
.curso-card .pct { font-weight: 800; color: var(--green); font-size: 13px; white-space: nowrap; }

/* ===== Avisos ===== */
.grid-avisos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.aviso { border-radius: var(--radius); padding: 16px 18px; color: #fff; border: 0; }
.aviso.aviso { background: var(--grad-soft); }
.aviso.evento { background: var(--grad-pink); }
.aviso.logro { background: linear-gradient(135deg,#10b981,#0ea5e9); }
.aviso h4 { font-size: 14px; margin-bottom: 4px; }
.aviso p { font-size: 12.5px; opacity: .95; }

/* ===== Detalle curso: 2 columnas ===== */
.detalle { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .detalle { grid-template-columns: 1fr; } }
.modulos { border-radius: var(--radius); background: var(--card-bg); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
details.mes { border-bottom: 1px solid var(--border); }
details.mes:last-child { border-bottom: 0; }
details.mes summary {
  cursor: pointer; padding: 13px 16px; font-weight: 700; font-size: 13.5px; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fafcff;
}
details.mes summary::-webkit-details-marker { display: none; }
details.mes[open] summary { background: #f0f6ff; color: var(--primary); }
details.mes .mes-info { display: flex; align-items: center; gap: 10px; }
.mes-num {
  width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800;
  font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
details.mes .flecha { transition: transform .2s; color: var(--text-muted); font-size: 12px; }
details.mes[open] .flecha { transform: rotate(90deg); }
.lista-clases { padding: 0; }
.clase-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 56px; font-size: 13px;
  border-top: 1px solid #f1f5f9; cursor: pointer; color: var(--text-dark);
}
.clase-item:hover { background: #f8fafc; }
.clase-item.activa { background: #eef6ff; border-left: 3px solid var(--primary); }
.clase-item .ok { color: var(--green); font-weight: 800; width: 16px; }
.clase-item .pend { color: #cbd5e1; width: 16px; }
.clase-item .sub-num { color: var(--text-muted); font-weight: 600; min-width: 46px; font-size: 11.5px; }

/* ===== Reproductor / material ===== */
.zona-clase { display: flex; flex-direction: column; gap: 16px; }
.player-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; aspect-ratio: 16/9; position: relative; }
.player-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* watermark anti-piratería: identifica al alumno (disuasivo para compartir/grabar) */
.wm {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.16); font-size: 17px; font-weight: 700; letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,.35); user-select: none;
  transform: rotate(-24deg); white-space: nowrap; overflow: hidden;
}
.player-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; gap: 10px; text-align: center; padding: 20px;
}
.player-placeholder .ico { font-size: 46px; }
.player-placeholder p { font-size: 14px; opacity: .85; max-width: 420px; }
.titulo-clase { font-size: 19px; font-weight: 800; }
.barra-clase { margin: 8px 0 0; }

/* ===== Materiales ===== */
.grid-materiales { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mat-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px; transition: box-shadow .15s;
}
.mat-card:hover { box-shadow: var(--shadow); }
.mat-card .mi { width: 38px; height: 38px; border-radius: 12px; background: #eef2ff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.mat-card b { font-size: 13px; display: block; line-height: 1.3; }
.mat-card small { color: var(--text-muted); font-size: 11.5px; }

/* ===== Login ===== */
.login-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 26px; align-items: stretch; max-width: 1000px; margin: 26px auto; }
@media (max-width: 820px) { .login-page { grid-template-columns: 1fr; } }
.banner-carousel {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative;
  min-height: 480px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
}
.banner-slide {
  display: none; padding: 34px 34px 40px; color: #fff; min-height: 480px; height: 100%;
  flex-direction: column; justify-content: space-between; align-items: stretch; position: absolute; inset: 0;
}
.banner-slide.activo { display: flex; }
.banner-slide .b-icono { font-size: 74px; text-align: center; flex: 1; display: flex; align-items: center; justify-content: center; text-shadow: 0 8px 24px rgba(0,0,0,.15); }
.banner-slide .b-img { flex: 1; min-height: 0; object-fit: contain; padding: 10px 0; }
.banner-slide .b-texto { }
.banner-slide h2 { color: #fff; font-size: 25px; margin: 0 0 8px; }
.banner-slide p { font-size: 14.5px; opacity: .93; }
.banner-slide .b-link { display: inline-block; margin-top: 10px; color: #fff; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.18); padding: 7px 16px; border-radius: 30px; border: 1px solid rgba(255,255,255,.35); }
.banner-slide .b-link:hover { background: rgba(255,255,255,.3); }
.banner-dots { display: flex; gap: 8px; position: absolute; top: 18px; right: 20px; z-index: 10; }
.banner-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; transition: background .2s; }
.banner-dots span.activo { background: #fff; }
.banner-dots span:hover { background: rgba(255,255,255,.85); }
.login-card {
  background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 36px 34px; align-self: center;
}
.login-card h2 { margin: 6px 0 2px; font-size: 21px; }
.login-card .tag { color: var(--text-muted); font-size: 13.5px; margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 14.5px;
  font-family: inherit; background: #fbfdff;
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.btn-full { width: 100%; margin-top: 20px; }
.err-box { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; padding: 11px 14px; border-radius: 12px; font-size: 13px; margin-top: 16px; }
.ok-box { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: 11px 14px; border-radius: 12px; font-size: 13px; margin-top: 16px; }
.mascota { text-align: center; font-size: 40px; margin-top: 14px; opacity: .8; }

/* ===== Ruta de aprendizaje ===== */
.mini-curso { display: flex; flex-direction: column; gap: 10px; }
.mini-curso .cabeza { display: flex; justify-content: space-between; gap: 8px; }
.mini-curso h4 { font-size: 15px; font-weight: 800; }
.mini-curso .nivel-tag { font-size: 11px; font-weight: 700; color: var(--purple); background: #f3efff; padding: 3px 10px; border-radius: 20px; }

footer { text-align: center; padding: 20px; color: var(--text-muted); font-size: 12.5px; border-top: 1px solid var(--border); background: var(--card-bg); }
.bloqueado { opacity: .72; filter: saturate(.7); position: relative; }
.bloqueado:hover { opacity: .85; }
