:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273449;
  --accent: #22c55e;
  --accent-dark: #16a34a;
  --accent-2: #38bdf8;
  --warning: #fbbf24;
  --danger: #f87171;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --radius: 12px;
}

/* ===== CARDS DE PREÇO (tela de compra na área) ===== */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.price-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
}
.price-card.destaque {
  border: 2px solid var(--accent);
  box-shadow: 0 20px 60px rgba(34,197,94,0.15);
}
.price-card .badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--accent);
  color: var(--bg);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.price-card .label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
}
.price-card .valor {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.price-card .valor .cifrao { font-size: 1.4rem; vertical-align: top; margin-right: 4px; color: var(--muted); }
.price-card .complemento { color: var(--muted); margin-bottom: 24px; }
.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.price-card ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.price-card ul li::before {
  content: '✓ ';
  color: var(--accent);
  font-weight: 700;
  margin-right: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: rgba(56,189,248,0.1); color: var(--accent-2); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
h1, h2, h3 { margin-top: 0; }

/* ===== TOP NAV (área do aluno) ===== */
.topnav {
  background: rgba(15,23,42,0.95);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav .logo { font-weight: 700; }
.topnav .logo .accent { color: var(--accent); }
.topnav .user { display: flex; align-items: center; gap: 14px; font-size: 0.92rem; color: var(--muted); }
.topnav .user a { color: var(--accent-2); }

/* ===== LAYOUT ADMIN (sidebar + main) ===== */
.adminlayout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar .brand { padding: 0 22px 24px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.sidebar .brand strong { color: var(--accent); }
.sidebar nav a {
  display: block;
  padding: 12px 22px;
  color: var(--text);
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: var(--panel-2); text-decoration: none; }
.sidebar nav a.active { background: var(--panel-2); border-left-color: var(--accent); color: var(--accent); }
.sidebar nav a.exit { margin-top: 18px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 18px; }

.main {
  flex: 1;
  padding: 30px 36px;
  min-width: 0;
}

/* ===== CONTAINER GENÉRICO ===== */
.container {
  max-width: 980px;
  margin: 30px auto;
  padding: 0 24px;
}
.container-sm {
  max-width: 480px;
  margin: 50px auto;
  padding: 0 24px;
}

/* ===== CARD ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }

/* ===== BOTÕES ===== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s, transform 0.05s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--bg); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ===== FORMS ===== */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== TABELA ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.table th {
  background: var(--panel-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--panel-2); }
.table .actions { white-space: nowrap; }
.table .actions a, .table .actions button { margin-right: 6px; }

/* ===== ALERTAS ===== */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
}
.alert-success { background: rgba(34,197,94,0.12); border-left: 4px solid var(--accent); }
.alert-danger  { background: rgba(248,113,113,0.12); border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(251,191,36,0.10); border-left: 4px solid var(--warning); }
.alert-info    { background: rgba(56,189,248,0.10); border-left: 4px solid var(--accent-2); }

/* ===== DASHBOARD STATS ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.stat .num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ===== LISTA DE AULAS (área do aluno) ===== */
.modulos { display: flex; flex-direction: column; gap: 14px; }
.modulo {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.modulo-head {
  padding: 18px 24px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.modulo-head h3 { margin: 0 0 4px; }
.modulo-head .desc { color: var(--muted); font-size: 0.9rem; margin: 0; }
.modulo-aulas { padding: 8px 0; }
.aula-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.aula-link:last-child { border-bottom: none; }
.aula-link:hover { background: var(--panel-2); text-decoration: none; }
.aula-link.atual { background: rgba(34,197,94,0.08); }
.aula-link .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.aula-link.concluida .check { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.aula-link .info { flex: 1; }
.aula-link .titulo { font-weight: 500; }
.aula-link .meta { font-size: 0.8rem; color: var(--muted); }

/* ===== PLAYER DE AULA ===== */
.aula-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: flex-start;
}
.aula-main {}
.aula-side {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}
.aula-side h4 {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-placeholder {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.aula-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
  .aula-layout { grid-template-columns: 1fr; }
  .aula-side { position: static; max-height: none; }
  .adminlayout { flex-direction: column; }
  .sidebar { width: 100%; padding: 14px 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; }
  .sidebar nav a.active { border-bottom-color: var(--accent); border-left-color: transparent; }
  .sidebar nav a.exit { border-top: none; margin-top: 0; padding-top: 12px; }
  .main { padding: 20px 16px; }
  .field-row { grid-template-columns: 1fr; }
}
