/* ============ RESET / BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #008060;
  --primary-dark: #006e52;
  --bg: #f6f6f7;
  --card: #ffffff;
  --text: #202223;
  --text-muted: #6d7175;
  --border: #e1e3e5;
  --danger: #d72c0d;
  --success: #008060;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============ HEADER ============ */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav { display: flex; gap: 20px; align-items: center; }
.nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover { color: var(--primary); }

.user-info {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============ CONTAINER ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 48px 32px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  text-align: center;
}
.hero h1 { font-size: 32px; margin-bottom: 8px; }
.hero p { opacity: .9; font-size: 16px; }

/* ============ FILTROS ============ */
.filtros {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filtro-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.filtro-btn:hover { border-color: var(--primary); }
.filtro-btn.ativo {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============ GRID PRODUTOS ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.produto-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.produto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.produto-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  overflow: hidden;
}
.produto-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  display: block;
  transition: opacity .25s ease;
}
.produto-flip {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.92);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary);
  transition: transform .15s, background .15s;
  z-index: 2;
}
.produto-flip:hover {
  background: white;
  transform: rotate(45deg) scale(1.08);
}
.produto-flip-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
  pointer-events: none;
}

.produto-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.produto-categoria {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.produto-nome {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.produto-descricao {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

.produto-preco {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

/* ============ BOTÕES ============ */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f0f0f0; }

.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}
.lightbox.ativo { display: flex; }
.lightbox-img {
  max-width: min(90vw, 720px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  transition: opacity .2s ease;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.lightbox-fechar {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,.15);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  transition: background .15s;
}
.lightbox-fechar:hover { background: rgba(255,255,255,.3); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  color: white;
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  transition: background .15s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); transform: translateY(-50%) scale(1.05); }
.lightbox-nav.esq { left: 24px; }
.lightbox-nav.dir { right: 24px; }

.lightbox-info {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-align: center;
  font-size: 14px;
}
.lightbox-info strong { font-size: 18px; display: block; margin-bottom: 4px; }
.lightbox-info .badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  padding: 4px 12px;
  border-radius: 12px;
  margin-top: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 600px) {
  .lightbox-nav { width: 44px; height: 44px; font-size: 22px; }
  .lightbox-nav.esq { left: 8px; }
  .lightbox-nav.dir { right: 8px; }
}

/* ============ MODAL ============ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-bg.ativo { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin-bottom: 16px; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,128,96,.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.auth-box {
  max-width: 420px;
  margin: 60px auto;
  background: var(--card);
  padding: 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-box h1 { margin-bottom: 20px; color: var(--primary); }
.auth-box p { font-size: 14px; color: var(--text-muted); margin-top: 16px; text-align: center; }
.auth-box a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* ============ MENSAGENS ============ */
.msg {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  display: none;
}
.msg.ativo { display: block; }
.msg.erro { background: #fdecea; color: var(--danger); border: 1px solid #f5c2bd; }
.msg.sucesso { background: #e3f5ec; color: var(--success); border: 1px solid #b8e0c9; }

/* ============ TABELA (admin/pedidos) ============ */
.tabela {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-collapse: collapse;
}
.tabela th, .tabela td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.tabela th {
  background: #f9f9fa;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.tabela tr:last-child td { border-bottom: none; }

.acoes-row { display: flex; gap: 8px; }
.acoes-row .btn { padding: 6px 12px; font-size: 12px; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.tag-pendente { background: #fff4e5; color: #b25e00; }
.tag-confirmado, .tag-received { background: #e3f5ec; color: var(--success); }
.tag-cancelado { background: #fdecea; color: var(--danger); }

/* ============ SECTION TITLE ============ */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title h2 { font-size: 22px; }

/* ============ ÁREA DE MEMBROS (dashboard / curso) ============ */
.membro-body {
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}
.membro-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.membro-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.membro-logo {
  font-size: 22px;
  font-weight: 800;
  color: white;
  text-decoration: none;
  letter-spacing: -.5px;
}
.membro-logo span { color: var(--primary); }
.membro-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.membro-nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color .15s;
}
.membro-nav a:hover { color: white; }
.membro-nav a.ativo { color: white; }
.membro-nav a.ativo::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.membro-nav .btn-loja {
  background: var(--primary);
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
}
.membro-nav .btn-loja:hover { background: var(--primary-dark); color: white; }
.membro-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 14px;
}
.membro-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 14px;
}

.membro-container { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }

.membro-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.membro-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 80% 20%, rgba(16,185,129,.18), transparent 50%);
}
.membro-hero h1 {
  font-size: 30px;
  margin-bottom: 8px;
  position: relative;
  color: white;
}
.membro-hero p {
  color: #cbd5e1;
  font-size: 16px;
  position: relative;
  max-width: 600px;
}

.membro-section-title {
  font-size: 22px;
  margin-bottom: 18px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}
.membro-section-sub {
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 24px;
}

/* Grid de cursos */
.cursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.curso-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.curso-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.curso-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #0f172a center/cover no-repeat;
  overflow: hidden;
}
.curso-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15,23,42,.85));
}
.curso-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary);
  z-index: 2;
  transition: transform .2s;
}
.curso-card:hover .curso-play { transform: translate(-50%, -50%) scale(1.1); }
.curso-duracao {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,.7);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}
.curso-info { padding: 18px; flex: 1; }
.curso-categoria {
  display: inline-block;
  background: rgba(16,185,129,.15);
  color: #10b981;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
}
.curso-titulo {
  font-size: 17px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  line-height: 1.3;
}
.curso-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Página do curso */
.curso-pagina {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .curso-pagina { grid-template-columns: 1fr; }
}
.curso-video-wrap {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.curso-video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.curso-meta {
  background: #1e293b;
  border-radius: 12px;
  padding: 24px;
  margin-top: 16px;
}
.curso-meta h1 { color: white; font-size: 26px; margin-bottom: 8px; }
.curso-meta .sub { color: #94a3b8; font-size: 14px; margin-bottom: 16px; }
.curso-meta p { color: #cbd5e1; line-height: 1.6; }

.curso-sidebar {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  align-self: start;
}
.curso-sidebar h3 { color: white; font-size: 15px; margin-bottom: 14px; }
.curso-sidebar-item {
  display: block;
  padding: 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 6px;
  background: #0f172a;
  border: 1px solid #334155;
  transition: border-color .15s;
}
.curso-sidebar-item:hover { border-color: var(--primary); color: white; }
.curso-sidebar-item.atual { border-color: var(--primary); background: rgba(0,128,96,.1); color: white; }
.curso-sidebar-item.visto { opacity: .85; }
.modulo-bloco { margin-bottom: 10px; }
.modulo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 6px;
}
.modulo-header:hover { border-color: var(--primary); }
.modulo-titulo {
  color: #a78bfa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.modulo-contagem { color: #94a3b8; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.modulo-chevron { transition: transform .2s; color: #94a3b8; font-size: 10px; }
.modulo-bloco.fechado .modulo-chevron { transform: rotate(-90deg); }
.modulo-bloco.fechado .modulo-aulas { display: none; }
.modulo-aulas { padding-left: 0; }
.curso-sidebar-item .check {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #475569;
  margin-right: 8px;
  text-align: center;
  font-size: 11px;
  line-height: 16px;
  vertical-align: middle;
}
.curso-sidebar-item.visto .check { background: #10b981; border-color: #10b981; color: white; }

.progresso-bar {
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.progresso-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #10b981);
  transition: width .3s ease;
}
.progresso-texto { font-size: 12px; color: #94a3b8; margin-top: 6px; }

.materiais-list { margin-top: 14px; }
.material-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  text-decoration: none;
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 6px;
  transition: border-color .15s;
}
.material-item:hover { border-color: var(--primary); color: white; }
.material-icone {
  width: 32px; height: 32px;
  background: rgba(16,185,129,.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
}

.btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 18px;
}
.btn-voltar:hover { color: white; }

@media (max-width: 600px) {
  .membro-header-inner { flex-wrap: wrap; gap: 12px; }
  .membro-nav { width: 100%; overflow-x: auto; gap: 18px; }
  .membro-nav a.ativo::after { bottom: -8px; }
  .membro-hero { padding: 28px 20px; }
  .membro-hero h1 { font-size: 24px; }
}

/* ============ RESPONSIVO ============ */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 24px; }
  .container { padding: 20px 16px; }
}
