/* ============================================================================
   SISTEMA DE CAPÍTULOS EDUCACIONAIS - MÉTODOO™
   Estilos baseados nos arquivos HTML originais
   ============================================================================ */

:root {
  --bg: #0f0f12;
  --card: #16171b;
  --muted: #a9b0be;
  --text: #eef2f7;
  --accent: #7c4dff;
  --accent-2: #00d2a8;
  --border: #24262c;
  --success: #21c37a;
  --warning: #ffb020;
  --danger: #ff5d5d;
}

* { box-sizing: border-box; }

body.chapters-page {
  margin: 0;
  padding-top: 70px; /* Espaço para navbar fixa */
  background: radial-gradient(1200px 600px at 80% -10%, #1a1c22 0%, var(--bg) 60%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #17181d 0%, #121318 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.navbar-container {
  width: 70% !important;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-logo-img {
  height: 32px;
  width: auto;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  padding: 8px 12px;
  background: rgba(255,255,255,.05);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.navbar-username {
  font-size: .9rem;
  font-weight: 500;
}

.navbar-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.navbar-logout-form {
  margin: 0;
}

.navbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}

.navbar-btn:hover {
  background: rgba(255,255,255,.05);
  border-color: var(--accent);
  color: var(--accent);
}

.navbar-btn:hover .navbar-icon {
  color: var(--accent);
}

a { color: var(--accent-2); text-decoration: none; }
.container { width: 70% !important; max-width: 1200px; margin: 0 auto; }

/* Cards */
.card {
  background: linear-gradient(180deg, #17181d 0%, #121318 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.section { padding: clamp(48px, 7vw, 96px) 0; }

/* Chips e Pills */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: #121318;
  font-size: .8rem;
}

.pill {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
}

/* Botões */
.btn {
  --bgc: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: linear-gradient(135deg, var(--bgc) 0%, #5c35ff 50%, #3f2bd6 100%);
  color: #fff;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  border: 0;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(92,53,255,.35);
  transition: transform .15s ease, box-shadow .2s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(92,53,255,.45);
}

.btn.secondary {
  --bgc: #293041;
  background: #1c2230;
  box-shadow: inset 0 0 0 1px #2a3142;
  color: #eaf2ff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

/* Hero Section */
.hero .wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: center;
}

.kicker {
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .85rem;
}

.title-xl {
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.05;
  margin: .3rem 0 .6rem;
  font-weight: 900;
}

.subtitle {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: .8rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.hero .visual {
  position: relative;
  height: 100%;
}

.hero .visual video {
  width: 60%;
  max-width: 100%;
  border-radius: 16px;
  display: block;
  margin-left: auto;
}

/* Grid 2 colunas */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.quote {
  border-left: 3px solid var(--accent-2);
  padding-left: 14px;
  color: #e7f7f1;
}

/* Hero do Capítulo (vídeo à esquerda, texto à direita) */
.cap-hero {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 42px;
  align-items: center;
}

.cap-hero .video-col {
  display: flex;
  justify-content: center;
}

.cap-hero .frame {
  width: 100%;
  max-width: 420px;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  display: flex;
  justify-content: center;
}

.cap-hero video {
  width: 80%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 9 / 16;
}

/* Duas colunas (exemplos) */
.two-col {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
  align-items: start;
}

/* CAP 0 — HERO do capítulo (vídeo à esquerda, título à direita) */
.cap0-hero {
  display: grid !important;
  grid-template-columns: 0.9fr 1.1fr !important;
  align-items: stretch !important;
  gap: 42px !important;
  padding: 32px 0 8px !important;
}

.cap0-video {
  display: flex !important;
  justify-content: center !important;
}

.cap0-video .frame {
  width: 100% !important;
  height: 100% !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  background: #000 !important;
  box-shadow: 0 14px 40px rgba(0,0,0,.35) !important;
  display: flex !important;
  justify-content: center !important;
}

.cap0-video video {
  width: 80% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  aspect-ratio: auto !important;
}

.cap0-copy .title-xl {
  margin: .35rem 0 .6rem !important;
  line-height: 1.05 !important;
}

.cap0-copy .subtitle {
  color: var(--muted) !important;
}

.cap0-examples {
  margin-top: 14px !important;
}

/* Wizard (formulário multi-etapas) */
.cap0-wizard {
  width: min(760px, 100%) !important;
  margin: 16px auto 0 !important;
  padding: 18px !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
}

.wizard-progress {
  flex-shrink: 0 !important;
  margin-bottom: 16px !important;
}

.wizard-step {
  flex: 1 1 auto !important;
  max-height: 420px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 8px !important;
}

.wizard-nav {
  flex-shrink: 0 !important;
  margin-top: 16px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--border) !important;
}

.wizard-step::-webkit-scrollbar {
  width: 6px;
}

.wizard-step::-webkit-scrollbar-track {
  background: #121318;
  border-radius: 3px;
}

.wizard-step::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.wizard-step::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* File Upload Preview */
.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.file-preview-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0f1116;
  aspect-ratio: 1;
}

.file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-item .file-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: rgba(0,0,0,.8);
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.8);
  border: 1px solid var(--border);
  color: var(--danger);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.file-preview-remove:hover {
  background: var(--danger);
  color: white;
}

.upload-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  cursor: pointer;
}

.upload-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.competitor-item input[type="text"] {
  flex: 1 !important;
  min-width: 0 !important;
}

.wizard {
  width: min(760px, 100%);
  margin: 16px auto 0;
  padding: 18px;
}

.wizard-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.wizard-track {
  height: 8px;
  background: #121318;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.wizard-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #5c35ff 60%, #3f2bd6 100%);
  transition: width .25s ease;
}

.wizard-steps {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.wizard-steps li {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  background: #0f1116;
}

.wizard-steps li.active {
  color: #fff;
  border-color: #4a3cff;
  background: #221c3f;
}

.wizard-steps li.done {
  color: #0adf9a;
  border-color: #137b5f;
  background: rgba(10,223,154,.08);
}

.wizard-step {
  display: none;
  gap: 12px;
}

.wizard-step.active {
  display: grid;
}

.wizard-nav {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Formulários */
.form {
  display: grid;
  gap: 12px;
}

.form label {
  font-size: .9rem;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.input, textarea, select {
  width: 100%;
  background: #0f1116;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .8rem .9rem;
  font-family: inherit;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,77,255,.15);
}

/* Checklist (questionário) */
.checklist {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed #2a2d36;
  border-radius: 12px;
  background: #101218;
}

.yn {
  display: flex;
  gap: 10px;
  align-items: center;
}

.yn label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .35rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s ease;
}

.yn label:hover {
  border-color: var(--accent-2);
  background: rgba(0,210,168,.05);
}

.yn input {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid #3b3f4a;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  cursor: pointer;
}

.yn input:checked {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(0,210,168,.2) inset;
}

/* Scorebox (resultado do diagnóstico) */
.scorebox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: #0f131a;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 14px;
}

.badge {
  font-weight: 800;
  letter-spacing: .04em;
  padding: .32rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.badge.ok {
  color: #0adf9a;
  border-color: #137b5f;
  background: rgba(10,223,154,.08);
}

.badge.mid {
  color: #ffd36b;
  border-color: #8a6b2a;
  background: rgba(255,211,107,.08);
}

.badge.bad {
  color: #ff7b7b;
  border-color: #8a2a2a;
  background: rgba(255,123,123,.08);
}

/* Botão "Voltar" flutuante */
.back-link {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 1000;
  border-radius: 999px;
  padding: .85rem 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.back-link .icon {
  width: 18px;
  height: 18px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
}

.mini {
  color: var(--muted);
  font-size: .85rem;
}

/* Responsivo */
@media (max-width: 920px) {
  .hero .wrap,
  .grid-2,
  .two-col,
  .cap-hero,
  .cap0-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
  }
  
  .hero .visual {
    min-height: 240px;
  }
  
  .cap-hero .frame,
  .cap0-video .frame {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
  }
  
  .cap-hero video,
  .cap0-video video {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  
  .back-link {
    top: 16px;
    left: 16px;
  }
  
  .wizard-nav {
    justify-content: space-between;
  }
  
  .cap0-wizard .wizard-nav {
    justify-content: space-between;
  }
  
  .palette-controls {
    grid-template-columns: 1fr 1fr;
  }
  
  .palette-controls .btn {
    grid-column: 1 / -1;
  }
}

/* Paleta de cores */
.palette-controls {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 10px 0 12px;
}

.palette-controls input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f1116;
  cursor: pointer;
}

.palette-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.palette-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #101218;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all .2s ease;
}

.palette-chip:hover {
  background: #1a1d25;
  border-color: var(--accent);
}

.palette-chip .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
}

.palette-chip .hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
  color: var(--muted);
}

/* Repeater (campos dinâmicos) */
.repeater {
  display: grid;
  gap: 10px;
}

.repeater-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.repeater-list {
  display: grid;
  gap: 8px;
}

.repeater-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

/* Upload preview */
.uploader .drop-area {
  background: #101218;
  border: 1px dashed #2a2d36;
  border-radius: 12px;
  padding: 12px;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.thumb {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  border: 1px solid var(--border);
  background: #0f1116;
  color: var(--text);
  border-radius: 6px;
  font-size: .7rem;
  padding: .15rem .35rem;
  cursor: pointer;
}

/* Hidden utility */
[hidden] {
  display: none !important;
}
