:root {
  --border: #e7e2f2;
  --text-muted: #6b6580;
  --bg: #fafafc;
  --ink: #100f1a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
  background: var(--bg);
  color: var(--ink);
}
img { max-width: 100%; }
a { color: var(--color-primary, #7c3aed); text-decoration: none; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-muted); }

/* ---------- Nav ---------- */
.aluno-nav { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.aluno-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.aluno-brand { display: flex; align-items: center; }
.aluno-logo { height: 28px; width: auto; }
.aluno-brand span { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.aluno-nav-links a { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.aluno-user { display: flex; align-items: center; gap: 14px; }
.aluno-user-name { font-weight: 600; font-size: 0.88rem; }
.aluno-logout { color: var(--text-muted); font-size: 1rem; }
.aluno-logout:hover { color: var(--color-primary, #7c3aed); }

/* ---------- Page ---------- */
.page { padding: 36px 24px 80px; }
.page-title { font-size: 1.5rem; margin: 0 0 4px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; }
.back-link:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.9rem; padding: 11px 22px;
  border-radius: 10px; border: none; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-lg { padding: 14px 26px; font-size: 0.95rem; }
.btn-primary { background: var(--color-primary, #7c3aed); color: #fff; }
.btn-primary:hover { filter: brightness(0.9); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-done { background: #e8f9e0; color: #2f7a1f; cursor: default; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Course grid ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 28px; }

.course-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.08); }

.course-cover {
  height: 140px; background-color: var(--color-secondary, #100f1a);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6); font-size: 28px;
}
.course-info { padding: 16px; }
.course-info h3 { margin: 0 0 10px; font-size: 1rem; }

.progress-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar-lg { height: 8px; max-width: 420px; margin-top: 16px; }
.progress-fill { height: 100%; background: var(--color-primary, #7c3aed); border-radius: 99px; }
.progress-label { margin: 8px 0 0; font-size: 0.78rem; color: var(--text-muted); }

.empty-card {
  margin-top: 28px; padding: 60px 20px; text-align: center;
  background: #fff; border: 1px dashed var(--border); border-radius: 16px; color: var(--text-muted);
}
.empty-card i { font-size: 28px; margin-bottom: 12px; display: block; }

/* ---------- Course header ---------- */
.course-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }

/* ---------- Lesson list ---------- */
.lesson-list { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.lesson-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--border); color: var(--ink);
  transition: background 0.15s ease;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: #faf8ff; }

.lesson-status {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: var(--border); color: var(--text-muted);
}
.lesson-status.is-progress { background: #fff4d6; color: #8a6400; }
.lesson-status.is-done { background: var(--color-primary, #7c3aed); color: #fff; }

.lesson-title { flex: 1; font-weight: 600; font-size: 0.92rem; }
.lesson-duration { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Player ---------- */
.player-wrap {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #000; border-radius: 16px; overflow: hidden; margin-bottom: 20px;
}
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

.lesson-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.lesson-heading { font-size: 1.2rem; margin: 0; }
.lesson-description { color: var(--text-muted); line-height: 1.6; margin: 16px 0 32px; }

.lesson-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }

/* ---------- Auth pages ---------- */
.aluno-auth-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--color-primary, #7c3aed) 12%, transparent), transparent 50%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 32px; text-align: center; }
.auth-logo { height: 32px; width: auto; margin: 0 auto 16px; }
.auth-brand-name { font-size: 1.2rem; margin: 0 0 16px; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 20px; }
.auth-card label { display: block; text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 14px; }
.auth-card input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit;
}
.auth-footer { font-size: 0.85rem; color: var(--text-muted); margin-top: 18px; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.85rem; margin-bottom: 16px; text-align: left; }
.alert-error { background: #fde3e3; color: #a3231f; }

@media (max-width: 600px) {
  .course-header, .lesson-toolbar { flex-direction: column; align-items: flex-start; }
}
