/* Screens — animação de entrada */
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Screens */
.screen {
  animation: cvfade 0.35s ease;
}

.btn-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  min-height: 36px;
}

.btn-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

/* Split layout (form + preview) */
.split-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--preview-width);
  grid-template-rows: 1fr;
  gap: 0.875rem;
  overflow: hidden;
}

.start-block {
  background: var(--color-surface);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.start-block-grow {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: unset;
}

.start-block h2 {
  margin: 0 0 0.125rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.start-desc {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.section-checklist-limit {
  max-height: 200px;
}

/* .section-check: estilos vêm inline do JS, iguais ao modelo. */
.section-check input { flex-shrink: 0; }
.section-check-label { min-width: 0; }
.section-move-actions { display: none; gap: 4px; }
.section-move-actions button { width: 32px; min-height: 32px; border: 1px solid var(--color-divider); background: var(--color-bg); color: var(--color-accent-700); font: 600 16px/1 var(--font-body); cursor: pointer; }
.section-drag-handle, .section-drag-spacer { width: 18px; flex: 0 0 18px; text-align: center; }
.section-drag-handle { color: color-mix(in srgb, var(--color-text) 42%, transparent); font-size: 20px; line-height: 1; cursor: grab; touch-action: none; }
.section-check-enabled:hover { border-color: var(--color-accent) !important; }
.section-check-dragging { opacity: .42; }
.section-check-drop-before { box-shadow: inset 0 3px 0 var(--color-accent); }
.section-check-drop-after { box-shadow: inset 0 -3px 0 var(--color-accent); }

@media (min-width: 769px) {
  #section-checklist { max-width: 780px; }
  .section-check:not(.section-check-enabled):not(.section-check-mandatory) { opacity: .68; background: transparent !important; }
}

@media (max-width: 768px) {
  .section-check { min-height: 56px; }
  .section-move-actions { display: inline-flex; }
  .section-drag-handle { display: none; }
}


.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  width: fit-content;
}

.badge-required {
  background: rgba(41, 98, 255, 0.12);
  color: var(--color-primary);
}

.template-grid-compact {
  gap: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
}

.template-card-desc {
  display: block;
  font-size: 0.625rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
  line-height: 1.2;
}

.template-card-name {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-top: 0.375rem;
}

.template-grid-compact .template-card {
  padding: 0.5rem;
}

.template-grid-compact .template-thumb {
  height: 56px;
}

.template-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.15);
}

.template-card span {
  display: block;
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Wizard layout */
.split-form {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.section-checklist {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow-y: auto;
}

/* Timeline do wizard: tabs iguais ao modelo; no mobile, uma linha rolável. */
.wizard-timeline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--color-divider);
  background: transparent;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
}

.timeline-step .timeline-step-num { font-size: 11px; opacity: 0.8; }
.timeline-step.done { color: var(--color-accent-700); }
.timeline-step.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Botao verde de conclusao */
.btn-success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.btn-success:hover { background: #0d9d70; border-color: #0d9d70; }

@media (max-width: 900px) {
  /* No celular os tabs viram fichas numeradas: cabem em qualquer tela,
     mesmo com 8 etapas, sem rolagem nem estouro. O nome da etapa
     aparece logo abaixo, no título. */
  .wizard-timeline { flex-wrap: wrap; gap: 6px; }
  .timeline-step {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    font-size: 14px;
  }
  .timeline-step .timeline-step-num { font-size: 14px; opacity: 1; }
  .timeline-step .timeline-step-label { display: none; }

  /* Cabecalho e formulario do wizard mais compactos no celular */
  #wizard-step-title { font-size: 24px !important; }
  #wizard-step-desc { margin-bottom: 14px !important; }
  #screen-wizard { padding-bottom: 150px !important; }
  #screen-wizard .list-item-card.blueprint { padding: 14px !important; }
  #screen-wizard .cv-form2[style*="1fr 1fr auto"] { grid-template-columns: 1fr 1fr !important; }
  #screen-wizard .cv-form2[style*="1fr 1fr auto"] .btn-remove-item { grid-column: 1 / -1; justify-self: start; }

  /* Barra inferior compacta: botoes maiores, sem texto de progresso */
  .wizard-bottom-inner {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    gap: 8px !important;
  }
  #wizard-progress-text { display: none; }
  #btn-prev, #btn-next, #btn-finish { flex: none; min-height: 46px !important; padding-inline: 13px !important; }
}

.wizard-panel,
.review-panel {
  background: var(--color-surface);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wizard-toolbar-actions {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.template-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.template-card:hover {
  border-color: rgba(89, 128, 166, 0.4);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(89, 128, 166, 0.15);
  background: var(--color-surface);
}

.template-card.selected {
  border-color: var(--color-primary);
  background: var(--color-bg);
  box-shadow: 0 0 0 3px rgba(89, 128, 166, 0.15);
}

.template-thumb {
  width: 100%;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  display: flex;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.template-footer {
  text-align: center;
  margin-top: 2rem;
}

/* Form fields — compact grid */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.625rem;
}

.field-grid-personal .field-group:first-child,
.field-grid-personal .field-group:nth-child(2),
.field-full {
  grid-column: 1 / -1;
}

.field-group {
  margin-bottom: 0;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  margin-bottom: 0.125rem;
}

.field-group label {
  display: block;
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.2;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  padding: 0.4375rem 0.625rem;
  font-family: inherit;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 34px;
  line-height: 1.4;
}

.field-group textarea {
  resize: vertical;
  min-height: 56px;
}

.field-tip-inline {
  margin: 0.125rem 0 0;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: help;
}

.field-tip-details {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.field-tip-details summary {
  cursor: pointer;
  user-select: none;
  color: var(--color-primary);
  font-weight: 500;
}

.field-tip-details p {
  margin: 0.25rem 0 0;
  line-height: 1.35;
}

.field-score {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: var(--color-bg);
  line-height: 1.2;
  margin: 0;
}

.required { color: var(--color-danger); }

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(89, 128, 166, 0.12);
}

.field-group input:hover:not(:focus),
.field-group textarea:hover:not(:focus),
.field-group select:hover:not(:focus) {
  border-color: var(--color-border-strong);
}

.wizard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wizard-progress {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.btn-mobile-preview { display: none; }
.btn-mobile-menu { display: none; }

body.modal-open {
  overflow: hidden;
  touch-action: none;
}


.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.wizard-nav-sticky {
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
  margin-top: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border);
  z-index: 10;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

.wizard-progress-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  max-width: 60%;
}

.wizard-progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.wizard-progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.wizard-progress-text {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* List sections — compact */
/* .list-item-card / botoes: estilos vem inline do JS, iguais ao modelo. */
.list-item-card { border-radius: 0; }

.field-score.score-fraco { color: var(--color-score-fraco); background: rgba(220, 38, 38, 0.08); }
.field-score.score-bom { color: var(--color-score-bom); background: rgba(202, 138, 4, 0.1); }
.field-score.score-otimo { color: var(--color-score-otimo); background: rgba(22, 163, 74, 0.1); }
