/* ===================================================
   CURRICULUMPRO - INTERFACE DO APLICATIVO
   Design moderno, intuitivo, responsivo e monetizado
   =================================================== */

:root {
  --app-bg: #f8fafc;
  --surface: #ffffff;
  --surface-border: #e2e8f0;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-light: #eff6ff;
  --text-dark: #0f172a;
  --text-gray: #475569;
  --text-light: #94a3b8;
  --success: #16a34a;
  --success-hover: #15803d;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--app-bg);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header Principal */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-dark);
}

.brand-logo svg {
  width: 32px;
  height: 32px;
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botões do Sistema */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: white;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
}

.btn-success:hover {
  background: var(--success-hover);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--surface-border);
  color: var(--text-gray);
}

.btn-outline:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Banner de Propaganda (Preparado para Google AdSense e Patrocinadores) */
.ads-banner-area {
  max-width: 1440px;
  margin: 10px auto;
  padding: 0 20px;
}

.ads-box {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  position: relative;
  overflow: hidden;
}

.ads-box.has-ad-network {
  background: transparent;
  border: none;
  padding: 4px 0;
  justify-content: center;
  box-shadow: none;
}

.ads-adsterra-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

.ads-adsterra-wrapper iframe {
  max-width: 100%;
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  .ads-banner-area {
    padding: 0;
    margin: 6px auto;
  }
  .ads-box#top-ad-slot,
  .ads-box#bottom-ad-slot {
    padding: 2px 0;
  }
}

.ads-box-tag {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 9px;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.ads-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ads-icon {
  width: 44px;
  height: 44px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16a34a;
  font-size: 20px;
  flex-shrink: 0;
}

.ads-text-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.ads-text-sub {
  font-size: 12px;
  color: #64748b;
}

/* Layout Principal: Grid Editor + Preview */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 20px 40px 20px;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: start;
}

/* Alternador Mobile (Editar vs Visualizar) */
.mobile-view-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.mobile-tab-btn {
  padding: 8px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.mobile-tab-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* Painel do Editor */
.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.editor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-border);
}

.editor-card-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
}

/* Seletores de Modelos e Cores (Conforme Fotos do Usuário) */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.template-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.template-filter-btn {
  border: 1px solid var(--surface-border);
  background: #ffffff;
  color: var(--text-gray);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.template-filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.template-desc {
  display: block;
  font-size: 10px;
  color: #64748b;
  line-height: 1.3;
}

.template-card-option:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.template-card-option {
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
  background: #f8fafc;
}

.template-card-option:hover {
  border-color: #cbd5e1;
}

.template-card-option.active {
  border-color: var(--brand);
  background: #eff6ff;
}

.template-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.tag-creative { background: #dbeafe; color: #1e40af; }
.tag-europeu { background: #e0e7ff; color: #4338ca; }
.tag-ats { background: #dcfce7; color: #166534; }
.tag-minimal { background: #f1f5f9; color: #334155; }
.tag-modern { background: #cffafe; color: #0e7490; }
.tag-exec { background: #fef3c7; color: #92400e; }

.template-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
}

/* Paleta de Cores Dinâmica */
.color-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-swatch-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 0 1px #cbd5e1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch-circle:hover {
  transform: scale(1.15);
}

.color-swatch-circle.active {
  box-shadow: 0 0 0 3px var(--brand);
  transform: scale(1.1);
}

.color-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  cursor: pointer;
}

.color-custom input[type="color"] {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.color-hint {
  margin-top: 8px;
  font-size: 11.5px;
  color: #92400e;
  background: #fef3c7;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

/* Campos de Formulário */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 4px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-dark);
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Upload de Foto */
.photo-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px dashed #cbd5e1;
}

.photo-thumb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #e2e8f0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Itens Repetíveis (Experiências, Formações, etc.) */
.repeatable-item {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
}

.repeatable-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Painel de Preview */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 76px;
}

.preview-toolbar {
  width: 100%;
  max-width: 210mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
}

.preview-scale-wrapper {
  width: 100%;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  padding-bottom: 20px;
}

/* Palco do preview: largura/altura definidas por fitPreview() conforme a escala */
.preview-stage {
  position: relative;
  flex: 0 0 auto;
  margin: 0 auto;
}

.preview-stage .cv-sheet {
  margin: 0;
}

/* Desktop: preview com rolagem própria para currículos de várias páginas */
@media screen and (min-width: 1025px) {
  .preview-scale-wrapper {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
  }
}

/* Rodapé do aplicativo */
.app-footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-gray);
  border-top: 1px solid var(--surface-border);
}

.app-footer strong {
  color: var(--text-dark);
}

/* Modais (Anúncio Premiado e Instalação iOS) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(15px);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  text-align: center;
  margin-bottom: 16px;
}

.modal-badge-free {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-ad-display {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  text-align: center;
  position: relative;
}

.ad-timer-pill {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* Toast de Notificação */
.toast-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1e293b;
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 99;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-box.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsividade Mobile & Tablet (Apenas em tela, nunca na impressão) */
@media screen and (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .mobile-view-tabs {
    display: grid;
  }

  /* Quando em mobile, alternar visualização na tela.
     O preview fica fora da tela (e não em display:none) para que a
     paginação A4 continue sendo calculada com medidas reais. */
  .app-container.show-editor .preview-panel {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 100vw;
    visibility: hidden;
    pointer-events: none;
  }

  .app-container.show-preview .editor-sidebar {
    display: none;
  }

  .preview-scale-wrapper {
    padding: 0;
  }
}

@media screen and (max-width: 640px) {
  .header-container {
    padding: 10px 14px;
  }

  .brand-title {
    font-size: 16px;
  }

  .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===================================================
   NAVEGAÇÃO POR CATEGORIAS & MENU PRINCIPAL
   =================================================== */
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand);
  background: var(--brand-light);
}

.nav-link-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
}

/* Seção de Cartões de Categorias na Home */
.category-showcase-section {
  max-width: 1440px;
  margin: 10px auto 14px auto;
  padding: 0 20px;
}

.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.category-nav-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.category-nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.category-nav-card:hover::before, .category-nav-card.active::before {
  opacity: 1;
}

.category-nav-card.active {
  border-color: var(--brand);
  background: #fdfefe;
}

.category-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.category-card-icon {
  font-size: 26px;
  line-height: 1;
  background: var(--brand-light);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.category-card-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand);
}

.category-card-desc {
  font-size: 12.5px;
  color: var(--text-gray);
  line-height: 1.45;
  margin-bottom: 12px;
  flex-grow: 1;
}

.category-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-card-btn-group {
  display: flex;
  gap: 6px;
  width: 100%;
}

.btn-card-create,
.btn-card-blank,
.btn-card-example {
  flex: 1;
  padding: 7px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  line-height: 1.25;
}

.btn-card-create {
  background: var(--brand);
  color: white;
  border: none;
}

.btn-card-create:hover {
  background: var(--brand-hover);
}

.btn-card-blank {
  background: #f8fafc;
  color: var(--text-dark);
  border: 1px solid #cbd5e1;
}

.btn-card-blank:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-card-example {
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
}

.btn-card-example:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-card-guide {
  font-size: 11.5px;
  color: var(--brand);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  transition: all 0.2s;
  text-align: center;
  font-weight: 600;
  display: block;
}

.btn-card-guide:hover {
  background: #dbeafe;
  color: var(--brand-hover);
}

/* Banner de Aviso de Dados Fictícios */
.example-warning-banner {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.example-warning-content {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.example-warning-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.example-warning-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.example-warning-close:hover {
  color: #0f172a;
}

/* ===================================================
   MOCKUP DE PRÉ-VISUALIZAÇÃO DE EXEMPLO NOS GUIAS
   =================================================== */
.cv-mockup-container {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  padding: 30px 34px;
  max-width: 720px;
  margin: 20px auto;
  font-family: inherit;
  color: #1e293b;
  position: relative;
  text-align: left;
}

.cv-mockup-header {
  border-bottom: 2px solid #2563eb;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.cv-mockup-name {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.cv-mockup-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 8px;
}

.cv-mockup-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
  color: #475569;
}

.cv-mockup-section {
  margin-bottom: 16px;
}

.cv-mockup-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cv-mockup-text {
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.cv-mockup-item {
  margin-bottom: 10px;
}

.cv-mockup-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  flex-wrap: wrap;
  gap: 4px;
}

.cv-mockup-item-sub {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 3px;
}

.cv-mockup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cv-mockup-badge {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
}

.cv-mockup-watermark {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

@media screen and (max-width: 600px) {
  .cv-mockup-container {
    padding: 20px 16px;
  }
  .cv-mockup-name {
    font-size: 20px;
  }
  .cv-mockup-watermark {
    position: static;
    display: inline-block;
    margin-bottom: 12px;
  }
  .category-card-btn-group {
    flex-direction: column;
  }
}

/* ===================================================
   SELETOR DE CATEGORIA NO EDITOR (BARRA LATERAL)
   =================================================== */
.category-selector-card {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.category-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.category-selector-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-tabs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
}

.category-tab-btn {
  border: none;
  background: transparent;
  padding: 7px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  white-space: nowrap;
}

.category-tab-btn.active {
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 700;
}

.category-guidance-box {
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #334155;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.category-guidance-box strong {
  color: #1e40af;
}

/* ===================================================
   CARD DE OBJETIVO PROFISSIONAL
   =================================================== */
.objective-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-open-library {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}

.btn-open-library:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.toggle-hide-objective {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.toggle-hide-objective input[type="checkbox"] {
  accent-color: var(--brand);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.objective-hint {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.4;
}

/* ===================================================
   MODAL DO SELETOR DE OBJETIVOS PROFISSIONAIS
   =================================================== */
.modal-objective-content {
  max-width: 780px !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}

.modal-obj-header {
  padding: 18px 24px 12px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.modal-obj-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-obj-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-obj-close-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
}

.modal-obj-close-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.modal-obj-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.modal-obj-tab-btn {
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-obj-tab-btn.active {
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 700;
}

.modal-obj-search-wrapper {
  position: relative;
}

.modal-obj-search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.modal-obj-search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.modal-obj-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 14px;
}

.modal-obj-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #ffffff;
}

.objective-item-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.objective-item-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.objective-item-card.selected {
  border-color: var(--brand);
  background: #eff6ff;
  box-shadow: 0 0 0 1px var(--brand);
}

.objective-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.objective-item-area {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #2563eb;
  background: #dbeafe;
  padding: 2px 8px;
  border-radius: 4px;
}

.objective-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
  flex: 1;
}

.objective-item-text {
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.objective-item-card.selected .objective-item-text {
  color: #1e3a8a;
  font-weight: 500;
}

.modal-obj-footer {
  padding: 14px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-obj-preview-info {
  font-size: 12px;
  color: #64748b;
  flex: 1;
  min-width: 220px;
}

.modal-obj-footer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media screen and (max-width: 900px) {
  .category-cards-grid {
    grid-template-columns: 1fr;
  }
  .modal-obj-tabs {
    grid-template-columns: 1fr;
  }
}

/* ===================================================
   RODAPÉ OPCIONAL DO CURRÍCULO: CIDADE E ANO
   =================================================== */
.cv-footer-city-year {
  position: absolute;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.4px;
  box-sizing: border-box;
  padding: 2px 10px;
  line-height: 1.4;
  pointer-events: none;
  user-select: none;
  z-index: 10;
  white-space: nowrap;
}

/* ===================================================
   AVISO DISCRETO DE ATUALIZAÇÃO PWA
   =================================================== */
.pwa-update-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 460px;
  animation: slideUpFadePwa 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.pwa-update-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pwa-update-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #f8fafc;
}

.pwa-update-icon {
  flex-shrink: 0;
  color: #60a5fa;
  animation: spinSlowPwa 8s linear infinite;
}

.pwa-update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-pwa-update-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-pwa-update-primary:hover {
  background: #1d4ed8;
}

.btn-pwa-update-primary:active {
  transform: scale(0.97);
}

.btn-pwa-update-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-pwa-update-close {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.btn-pwa-update-close:hover {
  color: #ffffff;
}

@keyframes slideUpFadePwa {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spinSlowPwa {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media screen and (max-width: 640px) {
  .pwa-update-bar {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: none;
    padding: 10px 12px;
  }
  .pwa-update-text {
    font-size: 12px;
  }
  .btn-pwa-update-primary {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

/* =========================================================================
   NOVA ARQUITETURA RESPONSIVA DE ETAPAS (MOBILE & TABLET WIZARD <= 1024px)
   Totalmente isolada: o layout Desktop (> 1024px) permanece 100% inalterado
   ========================================================================= */

/* ISOLAMENTO ESTREITO DO DESKTOP (> 1024px) */
@media screen and (min-width: 1025px) {
  .mobile-wizard-progress-card,
  .mobile-wizard-nav-dock,
  .mobile-review-actions-bar,
  .btn-quick-preview-toggle,
  .mobile-hamburger-btn,
  .mobile-menu-backdrop,
  .mobile-menu-drawer,
  .mobile-hero-screen,
  .mobile-modality-heading,
  .mobile-modality-footer,
  .category-card-radio,
  .mobile-step-action-row,
  .mobile-objective-quick-select,
  .mobile-leave-blank-hint,
  .mobile-review-summary-card,
  .mobile-download-view,
  .no-desktop {
    display: none !important;
  }

  .editor-sidebar [data-wizard-step],
  .editor-sidebar .category-selector-card,
  .editor-sidebar .editor-card {
    display: block !important;
  }

  .category-showcase-section,
  .onboarding-guide {
    display: block !important;
  }
}

/* EXPERIENCIA EXCLUSIVA MOBILE & TABLET (<= 1024px) */
@media screen and (max-width: 1024px) {
  /* Compensacao para que o dock inferior fixo nunca cubra os campos ou botoes */
  .app-container {
    padding-bottom: 95px !important;
  }

  /* Oculta por padrao os cards de formulario por etapas no mobile */
  .editor-sidebar [data-wizard-step] {
    display: none;
  }

  /* Exibe exclusivamente o card da etapa ativa com transicao suave */
  .editor-sidebar [data-wizard-step].wizard-step-active {
    display: block !important;
    animation: wizardFadeIn 0.22s ease-out;
  }

  /* Controle da Secao de Categorias do Topo na Etapa 0 */
  body.wizard-on-step-0 .category-showcase-section {
    display: block !important;
    animation: wizardFadeIn 0.22s ease-out;
  }
  body.wizard-on-step-0 .mobile-hero-screen {
    display: block !important;
  }
  body.wizard-on-step-0 .onboarding-guide {
    display: none !important;
  }

  /* Em etapas de preenchimento (1 a 9), recolhe hero e categorias */
  body:not(.wizard-on-step-0) .mobile-hero-screen,
  body:not(.wizard-on-step-0) .category-showcase-section,
  body:not(.wizard-on-step-0) .onboarding-guide {
    display: none !important;
  }

  /* =========================================================================
     CABECALHO MOBILE COMPACTO (Fiel a Imagem de Referencia)
     ========================================================================= */
  .app-header {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 40;
    background: #ffffff;
  }

  .header-container {
    padding: 10px 16px;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    height: 54px;
  }

  .brand-logo {
    gap: 9px;
    text-decoration: none;
    align-items: center;
  }
  .brand-logo svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .brand-title {
    font-size: 16.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
  }
  .brand-badge {
    background: #dcfce7 !important;
    color: #16a34a !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    display: inline-block;
    margin-top: 1px;
    letter-spacing: 0.2px;
  }

  /* Oculta menus extensos no cabecalho mobile (gerenciados via Drawer) */
  .main-nav {
    display: none !important;
  }
  .header-actions {
    display: none !important;
  }

  /* Botao Hamburguer Mobile */
  .mobile-hamburger-btn {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
    transition: background 0.15s ease;
  }
  .mobile-hamburger-btn:hover, .mobile-hamburger-btn:active {
    background: #f1f5f9;
  }
  .mobile-hamburger-btn .hamburger-bar {
    width: 20px;
    height: 2.2px;
    background: #1e293b;
    border-radius: 2px;
    transition: all 0.2s ease;
  }

  /* DRAWER OFF-CANVAS MOBILE */
  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .mobile-menu-backdrop.open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 86vw;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.18);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mobile-menu-drawer.open {
    transform: translateX(0);
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
  }
  .mobile-drawer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-drawer-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
  }
  .mobile-drawer-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
  }
  .mobile-drawer-close:hover {
    background: #f1f5f9;
    color: #0f172a;
  }

  .mobile-drawer-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mobile-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .mobile-drawer-actions .btn {
    justify-content: center;
    font-size: 13.5px;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 600;
  }
  .mobile-drawer-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 0;
  }
  .mobile-drawer-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .drawer-nav-link {
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
  }
  .drawer-nav-link:hover {
    background: #eff6ff;
    color: #2563eb;
  }

  /* =========================================================================
     TELA 1: HERO INICIAL MOBILE (Fiel a Imagem de Referencia)
     ========================================================================= */
  .mobile-hero-screen {
    max-width: 580px;
    margin: 8px auto 16px auto;
    padding: 0 16px;
  }
  .mobile-hero-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 18px 18px 18px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }
  .mobile-hero-title {
    font-size: 23px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
  }
  .mobile-hero-subtitle {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.45;
    margin: 0 0 18px 0;
  }

  .mobile-hero-benefits-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
  }
  .mobile-hero-benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
  }
  .hero-check-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #16a34a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .btn-mobile-hero-start {
    width: 100%;
    background: #2563eb;
    color: #ffffff;
    padding: 13.5px 20px;
    font-size: 15.5px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .btn-mobile-hero-start:active {
    transform: scale(0.99);
    background: #1d4ed8;
  }

  .mobile-hero-stats-row {
    margin-top: 18px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 6px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
  }
  .hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
  }
  .hero-stat-item:nth-child(2) {
    border-left: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
  }
  .hero-stat-icon {
    font-size: 20px;
    line-height: 1;
  }
  .hero-stat-text strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
  }
  .hero-stat-text span {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
  }

  /* =========================================================================
     TELA 2: ESCOLHA DA MODALIDADE (Fiel a Imagem de Referencia)
     ========================================================================= */
  .category-showcase-section {
    max-width: 580px;
    margin: 8px auto 16px auto;
    padding: 0 16px;
  }
  .mobile-modality-heading {
    display: block !important;
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    margin: 4px 0 14px 0;
    line-height: 1.3;
  }

  .category-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 11px;
  }
  .category-nav-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 15px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  }
  .category-nav-card.active {
    border-color: #2563eb !important;
    background: #fafbff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  }

  .category-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
  }
  .category-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .category-nav-card.active .category-card-icon {
    background: #eff6ff;
  }

  .category-card-titles {
    flex: 1;
    min-width: 0;
  }
  .category-card-title {
    font-size: 15.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
  }
  .category-card-badge {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-top: 3px;
    background: transparent !important;
    padding: 0 !important;
  }

  /* Indicador Radio circular */
  .category-card-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.18s ease;
  }
  .category-nav-card.active .category-card-radio {
    border-color: #2563eb;
  }
  .category-nav-card.active .radio-inner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
  }

  .category-card-desc {
    display: none;
  }

  /* Botoes internos do card mantidos e acessiveis */
  .category-card-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    display: none;
  }
  .category-nav-card.active .category-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .category-card-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .btn-card-blank, .btn-card-example {
    flex: 1;
    min-width: 140px;
    padding: 7px 10px;
    font-size: 11.5px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-weight: 600;
  }
  .btn-card-blank:hover, .btn-card-example:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
  }
  .btn-card-guide {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    text-align: right;
    display: inline-block;
  }

  .mobile-modality-footer {
    margin-top: 16px;
  }
  .btn-mobile-modality-continue {
    width: 100%;
    background: #2563eb;
    color: #ffffff;
    padding: 13.5px 20px;
    font-size: 15.5px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    cursor: pointer;
  }
  .btn-mobile-modality-continue:active {
    background: #1d4ed8;
  }

  /* =========================================================================
     INDICADOR DE PROGRESSO DAS ETAPAS (Telas 4, 5, 6 da Referencia)
     ========================================================================= */
  .mobile-wizard-progress-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  }

  .mobile-wizard-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  .mobile-wizard-step-badge {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
  }
  .mobile-wizard-pct {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
  }

  .mobile-wizard-progress-track {
    width: 100%;
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
  }
  .mobile-wizard-progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 3px;
    transition: width 0.25s ease-out;
  }

  /* Box com Icone e Titulo da Etapa */
  .mobile-step-header-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
  }
  .mobile-step-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .mobile-step-titles {
    flex: 1;
    min-width: 0;
  }
  .mobile-wizard-step-name {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
  }
  .mobile-wizard-guidance {
    display: block;
    font-size: 12.5px;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.4;
  }

  /* Pilulas de etapas */
  .mobile-wizard-pills {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 6px 0 2px 0;
    scrollbar-width: none;
  }
  .mobile-wizard-pills::-webkit-scrollbar {
    display: none;
  }
  .wizard-pill {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .wizard-pill.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
  }
  .wizard-pill.completed {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #86efac;
  }

  /* =========================================================================
     TELA 3: ESCOLHA DO MODELO (2 Colunas, Miniaturas e Checkmark)
     ========================================================================= */
  .template-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    scrollbar-width: none;
  }
  .template-filters::-webkit-scrollbar {
    display: none;
  }
  .template-filter-btn {
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 700;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    white-space: nowrap;
    cursor: pointer;
  }
  .template-filter-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
  }

  .template-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 11px !important;
  }
  .template-card-option {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 7px;
    background: #ffffff;
    position: relative;
    cursor: pointer;
    transition: all 0.18s ease;
  }
  .template-card-option.active {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  }
  .template-card-option.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.4);
    z-index: 5;
  }
  .template-card-option .tpl-thumb {
    border-radius: 8px;
    overflow: hidden;
  }
  .template-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .template-desc {
    display: block;
    font-size: 11px;
    color: #64748b;
  }

  .btn-mobile-use-template {
    width: 100%;
    background: #2563eb;
    color: #ffffff;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    cursor: pointer;
  }

  /* =========================================================================
     ESTRUTURA DOS CAMPOS DE FORMULARIO (Telas 4, 5, 6)
     ========================================================================= */
  .editor-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  }
  .editor-card-header {
    margin-bottom: 14px;
  }
  .editor-card-title {
    font-size: 16.5px;
    font-weight: 800;
    color: #0f172a;
  }

  .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
    display: block;
  }
  .form-input, .form-textarea, .form-select {
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    padding: 11px 12px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
  }

  /* Etapa 3: Objetivo Profissional com frase pronta */
  .mobile-objective-quick-select {
    margin-bottom: 12px;
  }
  .select-with-arrow {
    position: relative;
  }
  .mobile-obj-phrase-preview {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.45;
    margin-top: 8px;
  }

  /* =========================================================================
     DOCK FIXO INFERIOR DE NAVEGACAO ENTRE ETAPAS
     ========================================================================= */
  .mobile-wizard-nav-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 35;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -3px 14px rgba(15, 23, 42, 0.08);
    padding: 10px 14px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .btn-wizard-back {
    flex: 1;
    max-width: 130px;
    padding: 11.5px 14px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 9px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
  }
  .btn-wizard-back:active {
    background: #f1f5f9;
  }

  .btn-wizard-next {
    flex: 2;
    padding: 11.5px 16px;
    font-size: 14.5px;
    font-weight: 700;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
    cursor: pointer;
  }
  .btn-wizard-next:active {
    background: #1d4ed8;
  }

  /* =========================================================================
     TELA 7: REVISAO DO CURRICULO (Fiel a Imagem de Referencia)
     ========================================================================= */
  .mobile-review-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }
  .mobile-review-header-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }
  .mobile-review-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .mobile-review-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
  }
  .mobile-review-sub {
    font-size: 12.5px;
    color: #64748b;
    margin: 3px 0 0 0;
  }

  .mobile-cv-overview-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
  }
  .mobile-cv-overview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
  }
  .mobile-cv-avatar-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
  }
  .mobile-cv-avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .mobile-cv-user-name {
    font-size: 16.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  .mobile-cv-user-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 3px;
  }

  .mobile-cv-sections-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }
  .mobile-cv-section-item strong {
    font-size: 12.5px;
    color: #1e293b;
    display: block;
    margin-bottom: 2px;
  }
  .mobile-cv-section-item p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
  }

  .mobile-cv-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .btn-change-tpl, .btn-toggle-sheet {
    flex: 1;
    min-width: 130px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    text-align: center;
  }

  /* =========================================================================
     TELAS 9 & 10: DOWNLOAD & POS-DOWNLOAD (Fiel a Imagem de Referencia)
     ========================================================================= */
  .mobile-download-view {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }
  .download-success-banner {
    text-align: center;
    margin-bottom: 22px;
  }
  .download-success-check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #22c55e;
    color: #ffffff;
    font-size: 30px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
  }
  .download-success-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.25;
  }
  .download-success-sub {
    font-size: 13.5px;
    color: #64748b;
    margin: 0 0 18px 0;
  }

  .btn-download-giant {
    width: 100%;
    background: #16a34a;
    color: #ffffff;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    cursor: pointer;
    margin-bottom: 12px;
  }
  .btn-download-giant:active {
    background: #15803d;
  }

  .download-secondary-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .secondary-action-btn {
    width: 100%;
    padding: 10.5px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
  }

  /* Veja tambem / Afiliados */
  .mobile-download-affiliates {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
  }
  .section-subheading {
    font-size: 15.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px 0;
  }

  /* Proximos Passos Checklist */
  .mobile-next-steps-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 18px;
  }
  .next-steps-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .next-steps-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .next-steps-checklist li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    font-weight: 600;
  }
  .chk-green {
    color: #16a34a;
    font-weight: 800;
    font-size: 14px;
  }

  /* Dicas Profissionais */
  .mobile-pro-tips-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    margin-top: 14px;
  }
  .pro-tips-header {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
  }
  .bulb-icon {
    font-size: 24px;
  }
  .pro-tips-header strong {
    font-size: 14px;
    color: #1e3a8a;
    display: block;
  }
  .pro-tips-header p {
    font-size: 12px;
    color: #3b82f6;
    margin: 2px 0 0 0;
  }
  .btn-access-guide {
    width: 100%;
    background: #2563eb;
    color: #ffffff;
    padding: 11px;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  }

  /* Animacao suave para troca de etapa */
  @keyframes wizardFadeIn {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* =========================================================================
     RESPONSIVIDADE: AJUSTES FINOS POR RESOLUCAO (320px, 360px, 390px, 430px, 768px, 1024px)
     ========================================================================= */
  @media screen and (max-width: 360px) {
    .header-container {
      padding: 8px 10px;
    }
    .brand-title {
      font-size: 15px;
    }
    .mobile-hero-title {
      font-size: 20px;
    }
    .template-grid {
      gap: 8px !important;
    }
    .btn-wizard-back {
      padding: 10px 10px;
      font-size: 12.5px;
    }
    .btn-wizard-next {
      padding: 10px 12px;
      font-size: 13px;
    }
  }

  @media screen and (min-width: 768px) and (max-width: 1024px) {
    /* Tablet Portrait e Landscape */
    .mobile-hero-screen,
    .category-showcase-section,
    .editor-sidebar {
      max-width: 720px;
      margin-left: auto;
      margin-right: auto;
    }
    .template-grid {
      grid-template-columns: repeat(3, 1fr) !important;
      gap: 14px !important;
    }
    .mobile-hero-title {
      font-size: 28px;
    }
  }
}

/* =========================================================================
   SISTEMA DE AFILIADOS HOTMART — CURRICULUMPRO
   Cursos recomendados nos Guias Oficiais e Modal no Download de PDF
   ========================================================================= */

.affiliates-section {
  margin-top: 36px;
  margin-bottom: 24px;
}

.affiliates-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  width: 100%;
  min-width: 0;
}

.affiliates-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.affiliates-title {
  font-size: clamp(16px, 4.2vw, 20px);
  font-weight: 800;
  color: var(--text-dark, #0f172a);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  min-width: 0;
  word-break: break-word;
  line-height: 1.35;
}

.affiliates-ad-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.affiliates-subtitle {
  font-size: 13.5px;
  color: #475569;
  margin: 0;
  min-width: 0;
  word-break: break-word;
  line-height: 1.45;
}

/* Grid responsivo: 3 colunas desktop, 2 tablet, 1 mobile */
.affiliates-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .affiliates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .affiliates-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

.affiliate-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.affiliate-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

/* Container de Imagem com proporção 16:9 obrigatória e object-fit: contain */
.affiliate-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.affiliate-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  background-color: #0f172a;
}

.affiliate-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.affiliate-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.affiliate-card-desc {
  font-size: 12.5px;
  color: #64748b;
  margin: 0 0 14px 0;
  line-height: 1.45;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.affiliate-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.affiliate-price-tag {
  display: flex;
  flex-direction: column;
}

.affiliate-price-label {
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
}

.affiliate-price-value {
  font-size: 16px;
  font-weight: 800;
  color: #059669;
}

.btn-affiliate-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2563eb;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn-affiliate-action:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* =========================================================================
   MODAL DE RECOMENDAÇÃO NO DOWNLOAD DE PDF
   ========================================================================= */

.affiliate-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.5vh, 20px);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  overflow-y: auto;
}

.affiliate-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.affiliate-modal-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  margin: auto;
  position: relative;
}

.affiliate-modal-backdrop.open .affiliate-modal-box {
  transform: scale(1);
}

.affiliate-modal-header {
  flex-shrink: 0;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.affiliate-modal-header-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.affiliate-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.affiliate-modal-close-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

/* Área de Rolagem Interna: Garante que imagem, texto e preço rolem enquanto topo e rodapé ficam fixos */
.affiliate-modal-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.affiliate-modal-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.affiliate-modal-scroll-area::-webkit-scrollbar-track {
  background: #f8fafc;
}

.affiliate-modal-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.affiliate-modal-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.affiliate-modal-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: clamp(160px, 28vh, 250px);
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.affiliate-modal-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
}

.affiliate-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.affiliate-modal-course-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.affiliate-modal-course-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.affiliate-modal-pricing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 4px;
}

/* Rodapé Fixo / Sticky com os botões de ação e compra sempre acessíveis */
.affiliate-modal-footer-actions {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px 18px 16px 18px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.btn-affiliate-modal-close {
  flex: 1;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.btn-affiliate-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-affiliate-modal-cta {
  flex: 1.6;
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn-affiliate-modal-cta:hover {
  background: #047857;
  transform: translateY(-1px);
}


/* Badges e Ajustes de Multiplataforma (Livro, E-book, Curso) e Preço Opcional */
.affiliate-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2.5px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  align-self: flex-start;
}

.affiliate-meta-badge.badge-livro {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.affiliate-meta-badge.badge-ebook {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.affiliate-meta-badge.badge-curso {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #dbeafe;
}

.affiliate-meta-badge.badge-outro {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.affiliate-card-footer.no-price {
  justify-content: flex-end;
}

.affiliate-card-footer.no-price .btn-affiliate-action {
  width: 100%;
  text-align: center;
}


/* Grid com 1 ou 2 produtos ativos (harmonização de layout) */
.affiliates-grid.count-1 {
  grid-template-columns: minmax(280px, 480px);
  justify-content: center;
}

.affiliates-grid.count-2 {
  grid-template-columns: repeat(2, minmax(280px, 420px));
  justify-content: center;
}

@media (max-width: 700px) {
  .affiliates-grid.count-2 {
    grid-template-columns: 1fr;
  }
}
