/* ===========================
   CloudiLMS - Front-end CSS
   =========================== */
:root {
  --bg:        #0f172a;
  --bg2:       #1e293b;
  --bg3:       #334155;
  --text:      #f1f5f9;
  --text2:     #94a3b8;
  --text3:     #64748b;
  --primary:   #38bdf8;
  --primary2:  #0ea5e9;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --radius:    .75rem;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary2); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ─────────────────────────────────── */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.site-logo { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.site-nav  { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: var(--text2); font-size: .95rem; transition: color .2s; }
.site-nav a:hover { color: var(--text); }
.btn-nav { padding: .4rem .9rem; border-radius: 9999px; border: 1px solid var(--bg3); color: var(--text) !important; }
.btn-nav-primary { background: var(--primary); color: var(--bg) !important; border-color: var(--primary); font-weight: 600; }
.btn-nav-primary:hover { background: var(--primary2); }

/* ── Main / Footer ──────────────────────────── */
.site-main   { padding: 2rem 0 4rem; }
.site-footer { background: var(--bg2); border-top: 1px solid var(--bg3); padding: 1.5rem 0; text-align: center; color: var(--text3); font-size: .875rem; }

/* ── Hero ───────────────────────────────────── */
.hero { text-align: center; padding: 3rem 1rem; }
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: .75rem; }
.hero p  { color: var(--text2); font-size: 1.125rem; }

/* ── Course grid ────────────────────────────── */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
/* course-card-wrap sits inside the grid cell */
.course-card-wrap .course-card {
  border-radius: var(--radius) var(--radius) 0 0;
}
.course-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
  color: var(--text);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.course-thumb {
  height: 180px;
  background-size: cover; background-position: center;
  background-color: var(--bg3);
}
.course-thumb-placeholder { display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.course-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.course-title  { font-size: 1.1rem; font-weight: 600; }
.course-desc   { color: var(--text2); font-size: .9rem; flex: 1; }
.course-meta   { display: flex; justify-content: space-between; align-items: center; font-size: .875rem; color: var(--text3); margin-top: auto; }
.btn-enroll    { color: var(--primary); font-weight: 600; }

/* ── Course page ────────────────────────────── */
.course-hero {
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: var(--radius); padding: 2rem; margin-bottom: 2rem;
  display: flex; gap: 2rem; flex-wrap: wrap;
}
.course-hero-thumb { width: 280px; height: 175px; border-radius: .5rem; background-size: cover; background-position: center; flex-shrink: 0; background-color: var(--bg3); }
.course-hero-info  { flex: 1; min-width: 260px; }
.course-hero-info h1 { font-size: 1.75rem; margin-bottom: .75rem; }
.course-hero-desc  { color: var(--text2); margin-bottom: 1rem; }
.course-hero-meta  { display: flex; gap: 1.5rem; color: var(--text3); font-size: .9rem; margin-bottom: 1.25rem; }
.btn-hero { display: inline-block; padding: .75rem 1.75rem;
  background: var(--primary); color: var(--bg);
  font-weight: 700; border-radius: 9999px; font-size: 1rem;
  transition: background .2s;
}
.btn-hero:hover { background: var(--primary2); color: var(--bg); }
.btn-cert { background: #c9a84c; color: #1a0a00; }
.btn-cert:hover { background: #b8973e; color: #1a0a00; }
.btn-hero-alt { background: var(--bg3); color: var(--text); display: block; }
.btn-hero-alt:hover { background: var(--bg4); color: var(--text); }

/* ── Lesson list (course page) ──────────────── */
.lesson-list-public h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.public-lessons { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.public-lesson-item {
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: .5rem; overflow: hidden;
}
.public-lesson-item.lesson-done { border-color: #166534; }
.lesson-link, .lesson-locked {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1.25rem; color: var(--text);
  transition: background .15s;
}
.lesson-link:hover { background: var(--bg3); color: var(--text); }
.lesson-locked { cursor: default; color: var(--text3); }
.lesson-index { font-size: .8rem; color: var(--text3); min-width: 1.5rem; }
.lesson-name  { flex: 1; }
.lesson-dur   { font-size: .8rem; color: var(--text3); }
.lesson-check { color: var(--success); font-weight: 700; }
.lesson-lock  { color: var(--text3); }

/* ── Watch layout ───────────────────────────── */
.watch-layout {
  display: flex; height: calc(100vh - 64px); overflow: hidden;
  margin: -2rem -.5rem; /* override container padding */
}
.watch-sidebar {
  width: 340px; flex-shrink: 0;
  background: var(--bg2); border-right: 1px solid var(--bg3);
  display: flex; flex-direction: column; overflow: hidden;
}
.watch-sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--bg3);
  font-size: .875rem;
}
.watch-sidebar-header a { color: var(--text2); display: block; margin-bottom: .75rem; }
.progress-bar-wrap { display: flex; align-items: center; gap: .5rem; }
.progress-bar-track { flex: 1; height: 6px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.progress-bar-fill  { height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; }
.progress-label { font-size: .75rem; color: var(--text3); white-space: nowrap; }
.watch-lesson-list { flex: 1; overflow-y: auto; list-style: none; padding: .5rem; }
.watch-lesson-item a {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .75rem; border-radius: .5rem; color: var(--text2);
  transition: background .15s;
}
.watch-lesson-item a:hover { background: var(--bg3); color: var(--text); }
.watch-lesson-item.active a { background: rgba(56,189,248,.1); color: var(--primary); }
.watch-lesson-item.done .wl-check { color: var(--success); }
.wl-index { font-size: .75rem; color: var(--text3); margin-top: .15rem; min-width: 1.25rem; }
.wl-title { flex: 1; font-size: .9rem; }
.wl-check { color: var(--text3); font-size: .875rem; }
.watch-main  { flex: 1; display: flex; flex-direction: column; overflow-y: auto; min-width: 0; }
.video-container { background: #000; aspect-ratio: 16/9; max-height: calc(100vh - 160px); width: 100%; flex-shrink: 0; }
.video-container iframe { width: 100%; height: 100%; display: block; }
.watch-controls {
  background: var(--bg2); border-top: 1px solid var(--bg3);
  padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.watch-lesson-title h2 { font-size: 1.1rem; }
.duration { color: var(--text3); font-size: .875rem; }
.watch-actions { display: flex; gap: .75rem; align-items: center; }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-block; padding: .5rem 1rem;
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--bg3); border-radius: .5rem;
  font-size: .9rem; cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--bg2); color: var(--text); }
.btn-primary { background: var(--primary); color: var(--bg); border-color: var(--primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary2); border-color: var(--primary2); color: var(--bg); }
.btn-nav-prev, .btn-nav-next { background: var(--bg3); }
.btn-complete { background: var(--bg3); }
.btn-done { background: #166534; border-color: #166534; color: #bbf7d0; }
.btn-locked {
  background: var(--bg3); border-color: rgba(255,255,255,.1);
  color: var(--text3); cursor: not-allowed; opacity: .7;
}
.btn-locked:hover { background: var(--bg3); opacity: .7; }
.w-full { width: 100%; text-align: center; }

/* ── Guest landing ─────────────────────────── */
.guest-landing { padding: 2rem 0; }
.guest-hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 3rem;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}
@media (max-width: 860px) {
  .guest-hero { grid-template-columns: 1fr; gap: 2rem; min-height: unset; }
}
.guest-hero-text h1 {
  font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2;
}
.guest-hero-sub {
  font-size: 1.1rem; color: var(--text2); margin-bottom: 1.75rem; max-width: 480px;
}
.guest-features {
  list-style: none; display: flex; flex-direction: column; gap: .75rem;
}
.guest-features li {
  font-size: 1rem; color: var(--text2);
  display: flex; align-items: center; gap: .5rem;
}
.guest-login-card {
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: var(--radius); padding: 2rem;
}
.guest-login-title {
  font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; text-align: center;
}

/* ── Auth ───────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; align-items: flex-start; padding-top: 3rem; }
.auth-box {
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 420px;
}
.auth-title { font-size: 1.5rem; margin-bottom: 1.5rem; text-align: center; }
.auth-link  { text-align: center; color: var(--text3); font-size: .9rem; margin-top: 1.25rem; }

/* ── Forms ──────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; color: var(--text2); margin-bottom: .3rem; }
.form-control {
  width: 100%; padding: .6rem .85rem;
  background: var(--bg); border: 1px solid var(--bg3);
  border-radius: .5rem; color: var(--text); font-size: .95rem;
}
.form-control:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* ── Alerts ─────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: .5rem; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #052e16; color: #86efac; border: 1px solid #14532d; }
.alert-danger  { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }

/* ── Progress mini ──────────────────────────── */
.progress-mini-wrap { display: flex; align-items: center; gap: .5rem; }
.progress-mini-track { flex: 1; height: 5px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.progress-mini-fill  { height: 100%; background: var(--primary); border-radius: 99px; }
.progress-mini-wrap span { font-size: .75rem; color: var(--text3); }

/* ── Topic sections (course page) ──────────── */
.topic-section { margin-bottom: 1.5rem; }
.topic-section-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; background: var(--bg3);
  border-radius: .375rem; margin-bottom: .5rem;
  cursor: default;
}
.topic-section-icon { font-size: 1rem; }
.topic-section-title { font-weight: 600; font-size: .95rem; flex: 1; }
.topic-section-count { font-size: .8rem; color: var(--text3); }

/* ── Watch sidebar topics ───────────────────── */
.watch-topic-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .4rem .75rem; background: var(--bg3);
  font-size: .8rem; font-weight: 600; color: var(--text2);
  list-style: none; cursor: default;
  border-top: 1px solid rgba(255,255,255,.06);
}
.watch-topic-header:first-child { border-top: none; }
.wth-count {
  font-size: .72rem; background: rgba(255,255,255,.1);
  border-radius: 99px; padding: .1rem .45rem; color: var(--text3);
}
.watch-lesson-item.indented a { padding-left: 1.6rem; }

/* ── Aula bloqueada (modo sequencial) ──────────── */
.watch-lesson-item.locked { opacity: .5; cursor: default; }
.watch-lesson-item.locked .wl-lock-wrap {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .55rem .75rem; width: 100%; box-sizing: border-box;
}
.wl-lock { font-size: .8rem; margin-top: .1rem; }

/* ── Bloqueador de seek (barra inferior do player) ── */
.video-container { position: relative; background: #000; aspect-ratio: 16/9; max-height: calc(100vh - 160px); width: 100%; flex-shrink: 0; }
/* Mantido para compatibilidade, mas substituído por gdrive-controls-blocker */
.seek-blocker {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  z-index: 5;
  cursor: not-allowed;
}
/* Cobre toda a barra de controles inferior do Drive (barra de progresso + play + volume) */
.gdrive-controls-blocker {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  z-index: 5;
  background: #000;
  cursor: default;
}
/* Cobre o botão de atalho para o Google Drive (canto superior direito) */
.gdrive-link-blocker {
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 50px;
  z-index: 5;
  background: #000;
}

/* ── Empty state ────────────────────────────── */
.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-icon  { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h2  { font-size: 1.5rem; color: var(--text2); margin-bottom: .75rem; }
.empty-state p   { color: var(--text3); }

.page-heading { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; }

/* ── Front-end alerts ───────────────────────────────── */
.alert-front {
  padding: .75rem 1.1rem; border-radius: .5rem;
  margin-bottom: 1.25rem; font-size: .93rem;
}
.alert-front-success { background: #052e16; color: #86efac; border: 1px solid #14532d; }

/* ── Dashboard course card with unenroll ────────────── */
.course-card-wrap { position: relative; display: flex; flex-direction: column; }
.course-card-wrap .course-card { flex: 1; }
.course-unenroll-form { margin: 0; }
.btn-unenroll {
  display: block; width: 100%;
  padding: .35rem .75rem; text-align: center;
  background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.2);
  border-top: none; border-radius: 0 0 var(--radius) var(--radius);
  color: #fca5a5; font-size: .78rem; cursor: pointer;
  transition: background .15s;
}
.btn-unenroll:hover { background: rgba(239,68,68,.18); }

/* Cancel enroll on course page */
.btn-unenroll-course {
  background: none; border: none; color: var(--text3);
  font-size: .8rem; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
  transition: color .15s;
}
.btn-unenroll-course:hover { color: #fca5a5; }

/* ── Meus Certificados ──────────────────────────────── */
.page-heading-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.btn-back-link {
  font-size: .9rem; color: var(--text3);
  padding: .35rem .75rem; border-radius: .4rem;
  border: 1px solid var(--bg3); transition: color .15s, border-color .15s;
}
.btn-back-link:hover { color: var(--text); border-color: var(--text3); }

.cert-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.cert-card {
  background: var(--bg2);
  border: 1px solid rgba(201,168,76,.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.cert-card:hover {
  border-color: rgba(201,168,76,.65);
  box-shadow: 0 4px 24px rgba(201,168,76,.12);
}
.cert-card-seal {
  font-size: 2.75rem; text-align: center; line-height: 1;
}
.cert-card-body { display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.cert-card-course {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  line-height: 1.35;
}
.cert-card-student { font-size: .9rem; color: var(--text2); }
.cert-card-meta {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem;
}
.cert-meta-badge {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--bg3);
  border-radius: 9999px;
  padding: .2rem .65rem;
  font-size: .78rem; color: var(--text2);
}
.cert-code-badge { font-family: monospace; letter-spacing: .04em; }
.cert-card-actions {
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.btn-cert-view, .btn-cert-print, .btn-cert-share {
  flex: 1; min-width: 90px;
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .5rem .75rem; border-radius: .4rem;
  font-size: .83rem; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: opacity .15s;
}
.btn-cert-view  { background: rgba(201,168,76,.15); color: #c9a84c; border: 1px solid rgba(201,168,76,.35); }
.btn-cert-print { background: rgba(56,189,248,.1);  color: var(--primary); border: 1px solid rgba(56,189,248,.3); }
.btn-cert-share { background: rgba(255,255,255,.05); color: var(--text2); border: 1px solid var(--bg3); }
.btn-cert-view:hover, .btn-cert-print:hover, .btn-cert-share:hover { opacity: .75; }
.cert-list-info {
  font-size: .85rem; color: var(--text3); text-align: center;
  margin-top: .5rem;
}

/* ── Dashboard trails bar ───────────────────────────── */
.dashboard-trails-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: var(--radius); padding: .75rem 1rem;
  margin-bottom: 1.5rem;
}
.dashboard-trails-label { font-size: .85rem; color: var(--text3); white-space: nowrap; }
.dashboard-trail-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .75rem; border-radius: 9999px;
  font-size: .82rem; font-weight: 600; transition: opacity .15s;
}
.dashboard-trail-chip:hover { opacity: .8; }
.chip-unlocked { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.3); }
.chip-locked   { background: rgba(239,68,68,.1);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.dashboard-trails-more { font-size: .82rem; color: var(--primary); margin-left: auto; white-space: nowrap; }

/* ── Index Trail Sections (catálogo agrupado) ──────────── */
.index-trails {
  display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem;
}
.index-trail {
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: var(--radius); overflow: hidden;
}
.index-trail--locked { border-color: rgba(239,68,68,.3); }
.index-trail > summary { list-style: none; }
.index-trail > summary::-webkit-details-marker { display: none; }
.index-trail-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: 1rem 1.5rem;
  cursor: pointer; user-select: none;
  transition: background .15s;
}
.index-trail-summary:hover { background: rgba(255,255,255,.03); }
.index-trail-left  { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.index-trail-icon  { font-size: 1.1rem; flex-shrink: 0; }
.index-trail-name  { font-size: 1rem; font-weight: 700; }
.index-trail-desc  { font-size: .8rem; color: var(--text2); margin-top: .15rem; }
.index-trail-right { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.index-trail-count { font-size: .8rem; color: var(--text3); white-space: nowrap; }
.index-trail-chevron {
  font-size: .65rem; color: var(--text3);
  transition: transform .2s; display: inline-block;
}
details[open] > summary .index-trail-chevron { transform: rotate(180deg); }
.index-trail-courses {
  padding: .25rem 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.index-trail-empty {
  padding: .5rem 1.5rem 1.25rem;
  font-size: .875rem; color: var(--text3);
}
.trail-status-pill--neutral {
  background: rgba(148,163,184,.1); color: var(--text2);
  border: 1px solid rgba(148,163,184,.2);
}

/* ── Cursos Avulsos (standalone) ──────────────────────── */
.index-standalone { margin-top: 2rem; }
.index-standalone-header {
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--bg3);
}

/* ── Trail cards (student view) ───────────────────────── */
.trails-grid {
  display: flex; flex-direction: column; gap: 2rem;
}
.trail-card {
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: var(--radius); overflow: hidden;
}
.trail-card--locked { border-color: rgba(239,68,68,.35); }
.trail-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 1.25rem 1.5rem;
}
.trail-card-title {
  display: flex; align-items: flex-start; gap: .75rem;
}
.trail-card-icon { font-size: 1.1rem; margin-top: .15rem; }
.trail-card-title h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.trail-card-desc { font-size: .875rem; color: var(--text2); margin-top: .25rem; }
.trail-status-pill {
  white-space: nowrap; padding: .3rem .85rem; border-radius: 9999px;
  font-size: .78rem; font-weight: 700; flex-shrink: 0;
}
.trail-status-pill--unlocked { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.3); }
.trail-status-pill--locked   { background: rgba(239,68,68,.1);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }

.trail-progress-bar-wrap {
  height: 4px; background: var(--bg3); margin: 0 1.5rem;
}
.trail-progress-bar {
  height: 4px; background: var(--success); border-radius: 2px;
  transition: width .3s;
}
.trail-progress-label {
  font-size: .8rem; color: var(--text3); padding: .4rem 1.5rem .25rem;
}
.trail-locked-notice {
  margin: .75rem 1.5rem;
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: .5rem; padding: .75rem 1rem;
  font-size: .875rem; color: #fca5a5;
}

/* Trail course sequence */
.trail-course-sequence {
  list-style: none; margin: 1rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .5rem;
}
.trail-seq-item {
  display: flex; align-items: center; gap: .85rem;
  background: var(--bg3); border-radius: .5rem;
  padding: .75rem 1rem; border: 1px solid transparent;
  transition: border-color .15s;
}
.trail-seq-item--done   { border-color: rgba(34,197,94,.3); }
.trail-seq-item--active { border-color: rgba(56,189,248,.3); }
.trail-seq-item--blocked { opacity: .65; }
.trail-seq-num {
  font-size: .78rem; font-weight: 700; color: var(--text3);
  background: var(--bg); border-radius: 50%; width: 1.75rem; height: 1.75rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.trail-seq-info  { flex: 1; min-width: 0; }
.trail-seq-title { font-size: .9rem; font-weight: 500; display: block; }
.trail-seq-progress { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; }
.trail-seq-bar   { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; }
.trail-seq-fill  { height: 4px; background: var(--primary); border-radius: 2px; }

/* ── Questionários (aluno) ──────────────────────────────────────────────── */
/* ── Quiz page (aluno) ─────────────────────────────────────────────────── */
.quiz-page {
  max-width: 820px; margin: 0 auto; padding: 2rem 1rem 4rem;
}

/* Header */
.quiz-header {
  margin-bottom: 1.5rem;
  background: var(--bg2); border-radius: .75rem;
  padding: 1.5rem 2rem;
  border: 1px solid var(--bg3);
  border-left: 4px solid var(--primary);
}
.quiz-header a {
  color: var(--primary); font-size: .875rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: .25rem; margin-bottom: .4rem;
  opacity: .8; transition: opacity .15s;
}
.quiz-header a:hover { opacity: 1; }
.quiz-header h1 { font-size: 1.45rem; margin: .25rem 0; color: #f1f5f9; font-weight: 700; }
.quiz-header-desc { color: var(--text2); font-size: .9rem; margin: .4rem 0 0; line-height: 1.55; }
.quiz-meta {
  display: flex; gap: .6rem; flex-wrap: wrap; font-size: .825rem;
  color: var(--text2); margin-top: .85rem; padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.quiz-meta span {
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(255,255,255,.05); padding: .2rem .65rem;
  border-radius: 2rem; border: 1px solid rgba(255,255,255,.07);
}
.quiz-already-passed {
  margin-top: .75rem; padding: .6rem 1rem;
  background: rgba(16,185,129,.1); color: #6ee7b7;
  border-radius: .4rem; font-size: .875rem;
  border-left: 3px solid #10b981;
}

/* Progress bar */
.quiz-progress-wrap {
  display: flex; align-items: center; gap: .85rem; margin-bottom: 1.5rem;
  background: var(--bg2); border-radius: .5rem;
  padding: .65rem 1.1rem; border: 1px solid var(--bg3);
}
.quiz-progress-bar {
  flex: 1; height: 7px; background: var(--bg3);
  border-radius: 3px; overflow: hidden;
}
.quiz-progress-fill {
  height: 7px; border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .35s ease;
}
.quiz-progress-text { font-size: .8rem; color: var(--text2); white-space: nowrap; flex-shrink: 0; }

/* Question blocks */
.quiz-question-block {
  background: var(--bg2); border-radius: .75rem;
  padding: 1.5rem 1.75rem; margin-bottom: 1.1rem;
  border: 1px solid var(--bg3);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: border-color .2s, box-shadow .2s;
}
.quiz-question-block:focus-within {
  border-color: rgba(99,102,241,.45);
  box-shadow: 0 2px 10px rgba(0,0,0,.12), 0 0 0 3px rgba(99,102,241,.08);
}
.quiz-question-text {
  display: flex; gap: .85rem; align-items: flex-start;
  font-size: 1rem; line-height: 1.55; margin: 0 0 1.1rem;
  font-weight: 500; color: #e2e8f0;
}

/* Number badge */
.quiz-q-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 .4rem;
  background: rgba(99,102,241,.2); color: #c7d2fe;
  border-radius: .375rem; font-weight: 700; font-size: .8rem;
  flex-shrink: 0; margin-top: .1rem;
  border: 1px solid rgba(99,102,241,.3);
}

/* Options */
.quiz-options-group { display: flex; flex-direction: column; gap: .5rem; }
.quiz-option-label {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1.1rem; border-radius: .5rem;
  border: 2px solid rgba(255,255,255,.07); cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}
.quiz-option-label:hover {
  border-color: rgba(99,102,241,.5);
  background: rgba(99,102,241,.06);
  transform: translateX(3px);
}
.quiz-option-label.selected {
  border-color: #6366f1;
  background: rgba(99,102,241,.13);
}
/* Custom radio */
.quiz-option-label input[type=radio] {
  appearance: none; -webkit-appearance: none;
  width: 1.1rem; height: 1.1rem;
  border: 2px solid rgba(255,255,255,.3); border-radius: 50%;
  flex-shrink: 0; cursor: pointer;
  transition: border-color .15s; position: relative;
}
.quiz-option-label input[type=radio]::before {
  content: ''; display: block;
  width: .5rem; height: .5rem;
  background: #6366f1; border-radius: 50%;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform .15s;
}
.quiz-option-label input[type=radio]:checked { border-color: #6366f1; }
.quiz-option-label input[type=radio]:checked::before { transform: translate(-50%, -50%) scale(1); }
.quiz-option-text { font-size: .95rem; line-height: 1.4; color: #e2e8f0; }

/* Submit area */
.quiz-submit-wrap {
  display: flex; gap: .75rem; justify-content: flex-end; align-items: center;
  margin-top: 1.5rem; padding: 1.1rem 1.5rem;
  border-radius: .75rem; background: var(--bg2); border: 1px solid var(--bg3);
}
.btn-quiz-submit { min-width: 180px; font-size: .95rem; }

/* Resultado */
.quiz-result-card {
  max-width: 560px; margin: 3rem auto;
  background: var(--bg2); border-radius: 1rem;
  padding: 2.75rem 2rem 2.25rem; text-align: center;
  border: 2px solid var(--bg3);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.quiz-result-card.passed {
  border-color: #10b981;
  box-shadow: 0 8px 32px rgba(16,185,129,.12);
}
.quiz-result-card.failed {
  border-color: #ef4444;
  box-shadow: 0 8px 32px rgba(239,68,68,.12);
}
.quiz-result-icon { font-size: 3.5rem; margin-bottom: .6rem; line-height: 1; }
.quiz-result-title { font-size: 1.75rem; margin: 0 0 1.5rem; font-weight: 700; }
.quiz-result-card.passed .quiz-result-title { color: #6ee7b7; }
.quiz-result-card.failed .quiz-result-title { color: #fca5a5; }
.quiz-result-score {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,.04); border-radius: .75rem;
  padding: 1.25rem 2rem; border: 1px solid rgba(255,255,255,.07);
}
.quiz-score-value {
  font-size: 3.75rem; font-weight: 800; line-height: 1;
  letter-spacing: -.02em;
}
.quiz-result-card.passed .quiz-score-value { color: #6ee7b7; }
.quiz-result-card.failed .quiz-score-value { color: #fca5a5; }
.quiz-score-label { font-size: .875rem; color: var(--text2); margin-top: .35rem; }
.quiz-result-info { color: var(--text2); font-size: .95rem; margin-bottom: 1.75rem; line-height: 1.6; }
.quiz-result-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: .7rem 1.75rem; font-size: 1rem; }

/* Questionários pendentes na página do curso */
.quiz-pending-block {
  background: rgba(59,130,246,.1); border: 2px solid rgba(59,130,246,.35);
  border-radius: .6rem; padding: 1rem 1.25rem; margin-top: .75rem;
}
.quiz-pending-title { font-weight: 700; color: #93c5fd; margin-bottom: .25rem; font-size: .95rem; }
.quiz-pending-desc  { color: var(--text2); font-size: .85rem; margin-bottom: .75rem; }
.quiz-pending-list  { display: flex; flex-direction: column; gap: .5rem; }
.quiz-pending-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; border-radius: .4rem;
  background: rgba(59,130,246,.15); color: #93c5fd;
  text-decoration: none; font-size: .9rem;
  border: 1px solid rgba(59,130,246,.3);
  transition: background .15s;
}
.quiz-pending-btn:hover { background: rgba(59,130,246,.25); }
.quiz-pending-btn small { color: var(--text2); font-size: .8rem; margin-left: auto; }

.quiz-empty { color: var(--text2); text-align: center; margin-bottom: 1.5rem; }

.trail-seq-progress span { font-size: .75rem; color: var(--text3); }

.trail-seq-action { flex-shrink: 0; }
.btn-trail-action {
  display: inline-block; padding: .35rem .9rem; border-radius: .4rem;
  font-size: .8rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: opacity .15s;
}
.btn-trail-action:hover { opacity: .8; }
.btn-trail-done    { background: rgba(34,197,94,.12); color: #4ade80; }
.btn-trail-continue { background: rgba(56,189,248,.15); color: var(--primary); }
.btn-trail-enroll  { background: var(--primary); color: var(--bg); }
.btn-trail-blocked { background: rgba(239,68,68,.08); color: #fca5a5; cursor: default; }

/* Enrollment blocked notice on course page */
.trail-blocked-notice {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: .5rem; padding: 1rem 1.25rem;
  color: #fca5a5; font-size: .9rem; margin-top: .75rem;
  display: inline-block;
}

/* ── Enrollment expired notices ─────────────────────────────────────────── */
.enrollment-expired-notice {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35);
  border-left: 4px solid #ef4444;
  border-radius: .5rem; padding: 1rem 1.25rem;
  color: #fca5a5; font-size: .9rem; margin-top: .75rem;
  display: inline-block; line-height: 1.6;
}

/* Dashboard card: expired state */
.course-card-expired .course-card { opacity: .65; pointer-events: none; filter: grayscale(.4); }
.course-card-expired .course-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
}
.course-card-expired .course-thumb { position: relative; }
.course-expired-badge {
  font-size: .75rem; font-weight: 700; color: #fca5a5;
  background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3);
  border-radius: .25rem; padding: .15rem .5rem; display: inline-block;
  margin-bottom: .4rem;
}
.course-expiry-warning {
  font-size: .75rem; color: #fbbf24;
  background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.3);
  border-radius: .25rem; padding: .15rem .5rem; display: inline-block;
  margin-bottom: .4rem;
}
.course-expiry-info {
  font-size: .75rem; color: #93c5fd;
  background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.2);
  border-radius: .25rem; padding: .15rem .5rem; display: inline-block;
  margin-bottom: .4rem;
}
.badge-expired-small {
  font-size: .72rem; color: #fca5a5;
  background: rgba(239,68,68,.12); border-radius: .2rem;
  padding: .1rem .4rem; border: 1px solid rgba(239,68,68,.25);
}
.course-expired-notice {
  font-size: .75rem; color: #94a3b8;
  padding: .4rem .75rem .6rem;
  text-align: center; line-height: 1.4;
}

/* ── Quiz items na sidebar de aulas (watch.php) ─────────────────────────── */
.watch-quiz-item {
  background: rgba(59,130,246,.05);
  border-left: 3px solid rgba(59,130,246,.35);
}
.watch-quiz-item a { color: #93c5fd !important; }
.watch-quiz-item a:hover { background: rgba(59,130,246,.1) !important; }
.watch-quiz-item.done a { color: #6ee7b7 !important; }
.wl-quiz-icon {
  background: rgba(59,130,246,.15) !important;
  color: #93c5fd !important; font-size: .85rem;
}
.watch-quiz-eoc { border-left: 3px solid rgba(59,130,246,.5); }

/* ── Corpo da aula (texto/HTML associado) ───────────────────────────────── */
.lesson-body {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255,255,255,.08);
  line-height: 1.75;
  color: #e2e8f0;
  font-size: .975rem;
}
.lesson-body h1,.lesson-body h2,.lesson-body h3 { color: #f1f5f9; margin: 1rem 0 .5rem; }
.lesson-body a   { color: #60a5fa; text-decoration: underline; }
.lesson-body ul,.lesson-body ol { padding-left: 1.5rem; margin: .5rem 0; }
.lesson-body code { background: rgba(255,255,255,.1); padding: .1em .35em; border-radius: 3px; font-size: .9em; }
.lesson-body pre  { background: rgba(0,0,0,.35); padding: 1rem; border-radius: .5rem; overflow-x: auto; }
.lesson-body blockquote { border-left: 3px solid #60a5fa; padding-left: 1rem; color: #94a3b8; margin: .75rem 0; }

/* ── Anexos da aula ─────────────────────────────────────────────────────── */
.lesson-attachments {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.lesson-attachments-title {
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 0 0 .25rem;
  letter-spacing: .03em;
}
.attachment-item {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .75rem;
  overflow: hidden;
}
.attachment-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
}
.attachment-icon { font-size: 1.2rem; flex-shrink: 0; }
.attachment-name { flex: 1; font-weight: 500; color: #e2e8f0; font-size: .95rem; }
.attachment-download {
  flex-shrink: 0;
  font-size: .8rem !important;
  padding: .3rem .75rem !important;
}
.attachment-embed {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.attachment-embed-audio {
  padding: .75rem 1rem;
  background: rgba(255,255,255,.04);
}
.attachment-embed--pdf {
  aspect-ratio: unset;
  height: 520px;
}
.attachment-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .watch-layout { flex-direction: column; height: auto; }
  .watch-sidebar { width: 100%; max-height: 40vh; }
  .video-container { height: 56vw; min-height: 200px; }
  .course-hero { flex-direction: column; }
  .course-hero-thumb { width: 100%; }
  .site-nav { gap: 1rem; }
  .hero h1 { font-size: 1.75rem; }
  .lesson-body,.lesson-attachments { padding: 1rem; }
  .attachment-embed--pdf { height: 70vw; min-height: 300px; }
}
