:root{
  --navy-deep:#071E3D;
  --navy:#0D3B66;
  --navy-soft:#13497D;
  --gold:#E8A820;
  --gold-hover:#F2BB3F;
  --bg:#F3F5F9;
  --card:#FFFFFF;
  --ink:#0F2438;
  --muted:#5B6B7F;
  --line:#E4E9F0;
  --radius:14px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{font-family:'Playfair Display', serif; margin:0;}
a{text-decoration:none; color:inherit;}

/* ---------- Top bar ---------- */
.topbar{
  background:var(--navy-deep);
  color:#fff;
  padding:16px 40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{font-weight:700; letter-spacing:.5px; font-size:15px; color:#fff;}
.brand b{color:var(--gold);}
.topnav{display:flex; gap:28px; font-size:14px; font-weight:500;}
.topnav a{color:#CBD6E6; transition:color .2s; position:relative;}
.topnav a.active, .topnav a:hover{color:#fff;}
.topnav a.active::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-6px;
  height:2px; background:var(--gold); border-radius:2px;
}

/* ---------- Hero ---------- */
.hero{
  background:linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color:#fff;
  padding:36px 40px 54px;
  position:relative;
  overflow:hidden;
}
.hero::before{
  content:"";
  position:absolute; top:-120px; right:-80px;
  width:360px; height:360px; border-radius:50%;
  background:radial-gradient(circle at 30% 30%, rgba(232,168,32,.18), transparent 70%);
}
.hero-inner{max-width:1180px; margin:0 auto; position:relative;}

.breadcrumb{
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:600; color:#B9C8DD;
  margin-bottom:18px; transition:color .2s;
}
.breadcrumb svg{width:15px; height:15px;}
.breadcrumb:hover{color:#fff;}

.hero .tag{
  display:inline-block;
  font-size:11.5px; font-weight:700; letter-spacing:.4px; text-transform:uppercase;
  color:var(--navy-deep);
  background:var(--gold);
  padding:5px 12px;
  border-radius:6px;
  margin-bottom:14px;
}
.hero h1{font-size:32px; line-height:1.2; max-width:680px;}
.hero p{margin:12px 0 0; color:#C7D3E3; font-size:15.5px; max-width:560px;}

.hero-meta{display:flex; gap:24px; margin-top:26px; flex-wrap:wrap;}
.hero-meta span{
  display:flex; align-items:center; gap:7px;
  font-size:13.5px; font-weight:500; color:#DCE5F1;
}
.hero-meta svg{width:16px; height:16px; stroke:var(--gold);}

/* ---------- Layout ---------- */
.wrap{
  max-width:1180px; margin:0 auto;
  display:grid; grid-template-columns:260px 1fr; gap:24px;
  padding:34px 40px 90px;
  align-items:start;
}

aside{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px;
  position:sticky;
  top:20px;
}
.side-label{
  font-size:11.5px; font-weight:700; letter-spacing:1px; text-transform:uppercase;
  color:var(--muted); margin:0 0 14px;
}
aside ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px;}
aside li{
  font-size:14px; font-weight:500; color:var(--muted);
  padding:10px 12px; border-radius:8px;
  border-left:3px solid transparent;
  cursor:pointer;
  transition:background .18s, color .18s;
}
aside li:hover{background:var(--bg); color:var(--navy);}
aside li.active{
  background:#EAF0F8; color:var(--navy); font-weight:700;
  border-left-color:var(--gold);
}

.side-progress{margin-top:22px; padding-top:18px; border-top:1px solid var(--line);}
.side-progress-head{
  display:flex; justify-content:space-between;
  font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:8px;
}
#progressPct{color:var(--navy); font-weight:700;}
.progress-track{height:6px; border-radius:999px; background:var(--bg); overflow:hidden;}
.progress-fill{
  height:100%; width:0%;
  background:linear-gradient(90deg, var(--gold), var(--gold-hover));
  border-radius:999px;
  transition:width .35s ease;
}

main{display:flex; flex-direction:column; gap:22px;}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px;
}

.card-head{
  margin-bottom:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}
.card-head h2{font-size:19px; color:var(--ink);}

/* Pestañas de video (para cursos con varios videos) */
.video-tabs{
  display:flex;
  gap:6px;
  overflow-x:auto;
  padding-bottom:2px;
  scrollbar-width:thin;
}
.video-tabs::-webkit-scrollbar{height:5px;}
.video-tabs::-webkit-scrollbar-thumb{background:var(--line); border-radius:99px;}

.video-tabs .tab{
  flex:0 0 auto;
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--muted);
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  padding:8px 14px;
  border-radius:999px;
  cursor:pointer;
  white-space:nowrap;
  transition:all .18s;
}
.video-tabs .tab:hover{border-color:var(--navy-soft); color:var(--navy);}
.video-tabs .tab.active{
  background:var(--navy);
  border-color:var(--navy);
  color:#fff;
}
.video-tabs .tab.watched:not(.active)::after{
  content:"✓";
  margin-left:6px;
  color:var(--gold);
  font-weight:700;
}

.video-frame{
  border-radius:10px;
  overflow:hidden;
  background:#000;
}
.video-frame iframe{
  width:100%;
  height:600px;
  border:0;
  display:block;
}

.material-card{
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
}
.material-icon{
  width:52px; height:52px; flex:0 0 auto;
  border-radius:12px;
  background:#EAF0F8;
  display:flex; align-items:center; justify-content:center;
}
.material-text{flex:1; min-width:200px;}
.material-text h2{font-size:18px; margin-bottom:4px;}
.material-text p{margin:0; font-size:13.5px; color:var(--muted);}

.btn{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--gold);
  color:var(--navy-deep);
  padding:12px 20px;
  border-radius:9px;
  font-weight:700;
  font-size:14px;
  border:0;
  cursor:pointer;
  transition:background .18s, transform .18s;
  white-space:nowrap;
}
.btn svg{width:16px; height:16px;}
.btn:hover{background:var(--gold-hover); transform:translateY(-1px);}

.grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:18px;
}
.info{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:20px;
}
.info-icon{
  width:38px; height:38px;
  border-radius:10px;
  background:#EAF0F8;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:12px;
}
.info-icon svg{width:19px; height:19px;}
.info h3{
  font-size:12px; font-weight:700; letter-spacing:.5px; text-transform:uppercase;
  color:var(--muted); font-family:'DM Sans', sans-serif; margin-bottom:4px;
}
.info p{margin:0; font-size:15px; font-weight:600; color:var(--ink);}

.status-card button{
  background:var(--gold);
  color:var(--navy-deep);
  border:0;
  padding:10px 16px;
  border-radius:8px;
  font-weight:700;
  font-size:13.5px;
  cursor:pointer;
  width:100%;
  transition:background .18s;
}
.status-card button:hover{background:var(--gold-hover);}
.status-card button.done{
  background:#E6F4EA;
  color:#1E7B3C;
}
.status-card button.done:hover{background:#D9EFDF;}

footer{
  border-top:1px solid var(--line);
  padding:26px 40px;
  text-align:center;
  font-size:12.5px;
  color:var(--muted);
}

@media (max-width:900px){
  .wrap{grid-template-columns:1fr;}
  aside{position:static;}
  .grid{grid-template-columns:1fr;}
  .video-frame iframe{height:360px;}
}
@media (max-width:640px){
  .topbar, .hero-inner, .wrap, footer{padding-left:20px; padding-right:20px;}
  .hero{padding-left:20px; padding-right:20px;}
  .hero h1{font-size:24px;}
}
