/* =====================================================================
   Craft Index · formulario.css
   Estilos específicos do formulário (formulario.html). Depende de base.css.
   ===================================================================== */

body { background: var(--off-white); }

/* ===== Nav (sticky, sem blur) ===== */
nav.topbar {
  position: sticky;
  top: 0;
  background: var(--branco);
  border-bottom: 1px solid var(--cinza-suave);
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
}
nav.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cinza-escuro);
  text-decoration: none;
  transition: color .15s;
}
.back-link:hover { color: var(--verde-brq); }

/* ===== Hero mini (legado — mantido para compatibilidade) ===== */
.hero-form {
  padding: var(--space-2xl) 0 var(--space-lg);
  background: var(--branco);
  border-bottom: 1px solid var(--cinza-suave);
}
.hero-form .tag { color: var(--verde-brq); display: inline-block; margin-bottom: var(--space-sm); }
.hero-form h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 80px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  max-width: 900px;
}
.hero-form p { color: var(--cinza-escuro); max-width: 760px; }

/* ===== Hero compacto (em uso) ===== */
.hero-form-compact {
  padding: var(--space-lg) 0 var(--space-md);
  background: var(--branco);
  border-bottom: 1px solid var(--cinza-suave);
}
.hero-form-compact .tag {
  color: var(--verde-brq);
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.hero-form-compact h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin-bottom: 8px;
  max-width: 800px;
  color: var(--preto);
}
.hero-form-compact p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--cinza-escuro);
  line-height: 1.5;
  max-width: 720px;
}
.hero-form-compact .dot-sep {
  color: var(--cinza-claro);
  margin: 0 8px;
}

@media (max-width: 768px) {
  .hero-form-compact { padding: var(--space-md) 0; }
  .hero-form-compact h1 { font-size: 22px; }
  .hero-form-compact p { font-size: 13px; }
  .hero-form-compact .dot-sep { display: none; }
  .hero-form-compact p::after { content: ''; display: block; }
}

/* ===== Progress bar ===== */
.progress-bar {
  position: sticky;
  top: 64px;
  background: var(--branco);
  border-bottom: 1px solid var(--cinza-suave);
  z-index: 90;
  padding: 12px 0;
}
.progress-steps {
  display: flex;
  gap: 4px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.progress-step {
  flex: 1;
  height: 4px;
  background: var(--cinza-suave);
  border-radius: 2px;
  transition: background .3s;
}
.progress-step.done,
.progress-step.active { background: var(--verde-brq); }

/* ===== Form multi-step ===== */
.form-area { padding: var(--space-xl) 0 calc(var(--space-2xl) + 80px); }
.form-step {
  background: var(--branco);
  padding: var(--space-xl);
  border-radius: 6px;
  border: 1px solid var(--cinza-suave);
  display: none;
  animation: fadeInStep .3s ease;
}
.form-step.active { display: block; }
@keyframes fadeInStep {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Step nav sticky (rodapé) ===== */
.step-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--preto);
  color: var(--branco);
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 90;
  padding: 16px 0;
}
.step-nav-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cinza-claro);
}
.step-nav-counter strong { color: var(--verde-claro); font-weight: 600; }
.step-nav-actions { display: flex; gap: 10px; }

.btn-nav {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 22px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  border: none;
  transition: background .15s, transform .15s, opacity .15s;
  white-space: nowrap;
}
.btn-nav.prev {
  background: transparent;
  color: var(--cinza-claro);
  border: 1.5px solid var(--cinza-escuro);
}
.btn-nav.prev:hover { color: var(--branco); border-color: var(--branco); }
.btn-nav.prev[disabled] { opacity: 0.3; cursor: not-allowed; }
.btn-nav.next,
.btn-nav.submit { background: var(--verde-brq); color: var(--branco); }
.btn-nav.next:hover,
.btn-nav.submit:hover { background: var(--verde-escuro); transform: translateY(-1px); }

/* ===== Step headers ===== */
.step-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--verde-brq);
  margin-bottom: var(--space-sm);
  display: block;
}
.step-title {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  font-weight: 500;
}
.step-help {
  color: var(--cinza-escuro);
  font-size: 15px;
  margin-bottom: var(--space-lg);
  max-width: 640px;
  line-height: 1.6;
}
.step-help strong { color: var(--preto); font-weight: 600; }

/* ===== Fields ===== */
.field { margin-bottom: var(--space-md); }
.field label {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--preto);
}
.field label .required { color: var(--verde-brq); margin-left: 2px; }
.field .hint {
  font-size: 13px;
  color: var(--cinza-medio);
  margin-top: 6px;
  line-height: 1.5;
}

/* Checklist live de regras de senha (alterar-senha) */
.password-rules {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.password-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  transition: color .15s;
}
.password-rule-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-mono);
  transition: background .15s, color .15s;
}
.password-rule-pristine { color: var(--cinza-medio); }
.password-rule-pristine .password-rule-icon {
  background: transparent;
  color: var(--cinza-medio);
  border: 1px solid var(--cinza-suave);
}
.password-rule-ok { color: var(--verde-escuro); }
.password-rule-ok .password-rule-icon {
  background: var(--verde-brq);
  color: var(--branco);
}
.password-rule-fail { color: #C4554D; }
.password-rule-fail .password-rule-icon {
  background: #C4554D;
  color: var(--branco);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--cinza-suave);
  background: var(--branco);
  font-family: var(--font-body);
  font-size: 15px;
  border-radius: 4px;
  color: var(--preto);
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--verde-brq);
}
.field textarea { resize: vertical; min-height: 88px; }

/* ===== Combobox (nome do projeto) ===== */
.combobox {
  position: relative;
}
.combobox-control {
  position: relative;
}
.combobox input[type="text"] {
  width: 100%;
  padding: 13px 44px 13px 16px;
  border: 1.5px solid var(--cinza-suave);
  background: var(--branco);
  font-family: var(--font-body);
  font-size: 15px;
  border-radius: 4px;
  color: var(--preto);
  transition: border-color .15s;
  cursor: pointer;
}
.combobox input[type="text"]:focus {
  outline: none;
  border-color: var(--verde-brq);
}
.combobox-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--cinza-medio);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color .15s;
}
.combobox-toggle:hover { color: var(--verde-brq); }
.combobox input[aria-expanded="true"] + .combobox-toggle { color: var(--verde-brq); }

.combobox-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--branco);
  border: 1.5px solid var(--cinza-suave);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.combobox-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: background .1s;
}
.combobox-item.active,
.combobox-item:focus-visible {
  background: var(--verde-pastel);
  outline: none;
}
.combobox-item-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--preto);
}
.combobox-item-client {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cinza-medio);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.combobox-item.active .combobox-item-client { color: var(--verde-escuro); }

.combobox-create {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border-top: 1px dashed var(--cinza-suave);
  margin-top: 4px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.combobox-create .combobox-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--verde-brq);
  color: var(--branco);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.combobox-create .combobox-item-name {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--cinza-escuro);
}
.combobox-create .combobox-item-name strong {
  color: var(--preto);
  font-weight: 600;
}
.combobox-create.active { background: var(--creme-verde); }

.combobox-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--cinza-medio);
}

/* Estado inválido */
.field-invalid .combobox input[type="text"] {
  border-color: #C4554D;
  background: #FFF7F6;
}

/* Chip de feedback do estado selecionado */
.combobox-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
  animation: fadeInStep .2s ease;
}
.combobox-status.new {
  background: var(--creme-verde);
  color: var(--verde-escuro);
  border-left: 3px solid var(--verde-brq);
}
.combobox-status.existing {
  background: var(--off-white);
  color: var(--cinza-escuro);
  border-left: 3px solid var(--cinza-claro);
}
.combobox-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--branco);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.combobox-status.new .combobox-status-icon { background: var(--verde-brq); }
.combobox-status.existing .combobox-status-icon { background: var(--verde-brq); }
.combobox-status strong { font-weight: 600; }

/* ===== Estado de erro ===== */
.field-invalid input[type="text"],
.field-invalid input[type="email"],
.field-invalid input[type="password"],
.field-invalid input[type="url"],
.field-invalid select,
.field-invalid textarea {
  border-color: #C4554D;
  background: #FFF7F6;
}
.field-invalid input:focus,
.field-invalid textarea:focus {
  border-color: #C4554D;
  box-shadow: 0 0 0 3px rgba(196, 85, 77, 0.15);
}
.field-error {
  font-family: var(--font-body);
  font-size: 13px;
  color: #C4554D;
  margin-top: 6px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-error::before {
  content: '!';
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  background: #C4554D;
  color: var(--branco);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Grupos compostos (gate, tipo, toggle) em estado de erro */
.gate-option-invalid,
.tipo-option-invalid,
.toggle-row-invalid .toggle-option,
.attachment-item-invalid {
  border-color: #C4554D !important;
}
.attachment-item-invalid .field-error { padding-top: 4px; }

.dim-block-invalid {
  box-shadow: 0 0 0 2px #C4554D inset;
}

/* ===== Anexos ===== */
.attachment-help {
  background: var(--creme-verde);
  border-left: 3px solid var(--verde-brq);
  padding: 14px 16px;
  border-radius: 4px;
  margin: 12px 0;
}
.attachment-help-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--verde-escuro);
  margin-bottom: 8px;
  font-weight: 600;
}
.attachment-help ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
}
.attachment-help ul li {
  font-size: 13px;
  color: var(--verde-escuro);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.attachment-help ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--verde-brq);
  font-family: var(--font-mono);
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.attachment-empty {
  background: var(--off-white);
  border: 1.5px dashed var(--cinza-claro);
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--cinza-medio);
}
.attachment-item {
  display: grid;
  grid-template-columns: 52px 1fr 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--branco);
  border: 1.5px solid var(--cinza-suave);
  border-radius: 4px;
  transition: border-color .15s;
}
.attachment-item:focus-within { border-color: var(--verde-brq); }
.attachment-item.link { border-left: 3px solid var(--azul-medio); }
.attachment-item.file { border-left: 3px solid var(--verde-brq); }
.attachment-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--off-white);
  color: var(--cinza-escuro);
  padding: 6px 4px;
  border-radius: 3px;
  text-align: center;
  font-weight: 600;
  line-height: 1.2;
}
.attachment-item.link .attachment-badge { background: var(--azul-pastel); color: var(--azul-marinho); }
.attachment-item.file .attachment-badge { background: var(--verde-pastel); color: var(--verde-escuro); }
.attachment-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.attachment-input input[type="text"],
.attachment-input input[type="url"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--cinza-suave);
  border-radius: 3px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--preto);
}
.attachment-input input:focus { outline: none; border-color: var(--verde-brq); }
.attachment-file-info {
  font-size: 13px;
  color: var(--preto);
  display: flex;
  align-items: center;
  gap: 8px;
}
.attachment-file-info .filename {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
}
.attachment-file-info .filesize {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cinza-medio);
}
.attachment-label-input {
  padding: 6px 10px !important;
  font-size: 12px !important;
  color: var(--cinza-escuro) !important;
  background: transparent !important;
  border: 1px dashed var(--cinza-suave) !important;
}
.attachment-remove {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--cinza-medio);
  cursor: pointer;
  font-size: 18px;
  border-radius: 3px;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.attachment-remove:hover { background: #FFE8DC; color: #A04020; }

.attachment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-attach {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--branco);
  color: var(--preto);
  border: 1.5px solid var(--preto);
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.btn-attach:hover { background: var(--preto); color: var(--branco); }
.btn-attach.primary { background: var(--verde-brq); color: var(--branco); border-color: var(--verde-brq); }
.btn-attach.primary:hover { background: var(--verde-escuro); border-color: var(--verde-escuro); }

.hidden-file-input { position: absolute; opacity: 0; pointer-events: none; }

/* Aviso inline de arquivo(s) acima do limite — substitui alert() nativo */
.attachment-oversized {
  margin-top: 12px;
  background: #FFF7F6;
  border: 1.5px solid #C4554D;
  border-radius: 4px;
  padding: 12px 14px;
  color: #A04040;
}
.attachment-oversized-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.attachment-oversized-head strong {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #A04040;
}
.attachment-oversized-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #A04040;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  border-radius: 3px;
  flex-shrink: 0;
  transition: background .15s;
}
.attachment-oversized-close:hover { background: #FFE8DC; }
.attachment-oversized ul {
  margin: 0 0 8px 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attachment-oversized ul li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
}
.attachment-oversized ul li .filename {
  color: #A04040;
  word-break: break-all;
}
.attachment-oversized ul li .filesize {
  color: #C4554D;
  font-weight: 600;
  flex-shrink: 0;
}
.attachment-oversized p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: #A04040;
}
.attachment-oversized p strong { color: #A04040; }

/* ===== Gates ===== */
.gates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gate-option {
  position: relative;
  border: 1.5px solid var(--cinza-suave);
  border-radius: 4px;
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  background: var(--branco);
}
.gate-option:hover { border-color: var(--verde-brq); }
.gate-option input { position: absolute; opacity: 0; pointer-events: none; }
.gate-option:has(input:checked) { border-color: var(--verde-brq); background: var(--verde-pastel); }
.gate-number {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cinza-medio);
  margin-bottom: 4px;
  display: block;
}
.gate-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.gate-desc { font-size: 13px; color: var(--cinza-escuro); line-height: 1.45; }

/* ===== Tipos ===== */
.tipo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tipo-option {
  position: relative;
  border: 1.5px solid var(--cinza-suave);
  border-radius: 4px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  background: var(--branco);
  text-align: center;
}
.tipo-option input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-option:hover { border-color: var(--verde-brq); }
.tipo-option:has(input:checked) { border-color: var(--verde-brq); background: var(--verde-pastel); }
.tipo-nome { font-family: var(--font-display); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }

/* ===== Toggle bom momento ===== */
.toggle-row { display: flex; gap: 10px; }
.toggle-row .toggle-option {
  flex: 1;
  position: relative;
  border: 1.5px solid var(--cinza-suave);
  border-radius: 4px;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.toggle-row .toggle-option input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row .toggle-option:has(input:checked) { border-color: var(--verde-brq); background: var(--verde-pastel); color: var(--verde-escuro); }
.toggle-row .toggle-option.no:has(input:checked) { border-color: var(--laranja); background: #FFE8DC; color: #A04020; }

/* ===== Scoring ===== */
.scoring-intro {
  background: var(--navy);
  color: var(--branco);
  padding: var(--space-lg);
  border-radius: 6px;
  margin-bottom: var(--space-lg);
}
.scoring-intro .tag { color: var(--verde-claro); margin-bottom: var(--space-sm); display: block; }
.scoring-intro h4 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
}
.scoring-intro p { color: var(--lilas-claro); font-size: 14px; line-height: 1.6; }
.scoring-intro strong { color: var(--verde-claro); font-weight: 600; }

.scoring-empty {
  background: var(--off-white);
  border: 2px dashed var(--cinza-claro);
  padding: var(--space-xl);
  border-radius: 6px;
  text-align: center;
  color: var(--cinza-escuro);
}
.scoring-empty .icon {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--verde-brq);
  display: block;
  margin-bottom: var(--space-sm);
}
.scoring-empty h4 { font-family: var(--font-display); font-size: 20px; margin-bottom: 8px; color: var(--preto); }
.scoring-empty p { font-size: 14px; max-width: 480px; margin: 0 auto; }

.tipo-group { margin-bottom: var(--space-xl); }
.tipo-group-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--preto);
  color: var(--branco);
  border-radius: 6px 6px 0 0;
}
.tipo-group-head .tag { color: var(--verde-claro); font-size: 11px; }
.tipo-group-head .tipo-group-nome {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  flex: 1;
}
.tipo-group-head .tipo-group-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cinza-claro);
}

.dim-block {
  background: var(--branco);
  border: 1.5px solid var(--cinza-suave);
  border-radius: 0;
  padding: var(--space-lg);
  border-top: none;
}
.dim-block:last-child { border-radius: 0 0 6px 6px; }
.tipo-group:not(:has(.tipo-group-head)) .dim-block {
  border-top: 1.5px solid var(--cinza-suave);
  border-radius: 6px;
  margin-bottom: 10px;
}

.dim-block-head {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--cinza-suave);
  margin-bottom: var(--space-md);
}
.dim-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--verde-brq);
  margin-bottom: 6px;
  display: block;
}
.dim-block h4 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}
.dim-pergunta {
  background: var(--creme-verde);
  padding: 12px 14px;
  border-left: 3px solid var(--verde-brq);
  border-radius: 4px;
  margin-bottom: var(--space-sm);
  font-size: 14px;
  color: var(--verde-escuro);
}
.dim-pergunta strong { font-weight: 600; }
.dim-descricao { font-size: 13px; color: var(--cinza-escuro); line-height: 1.6; }
.dim-tipo-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cinza-medio);
  margin-top: 12px;
}
.dim-tipo-hint span { color: var(--verde-brq); font-weight: 600; }

.rubric-stack { display: flex; flex-direction: column; gap: 8px; }
.rubric-option {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-sm);
  padding: 14px 16px;
  background: var(--branco);
  border: 1.5px solid var(--cinza-suave);
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
}
.rubric-option:hover { border-color: var(--verde-brq); background: #FAFDF9; }
.rubric-option input { position: absolute; opacity: 0; pointer-events: none; }
.rubric-option:has(input:checked) {
  border-color: var(--verde-brq);
  border-width: 2px;
  background: var(--verde-pastel);
  padding: calc(14px - 0.5px) calc(16px - 0.5px);
}
.rubric-option:has(input:checked) .rubric-num { background: var(--verde-brq); color: var(--branco); }
.rubric-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--off-white);
  border-radius: 4px;
  color: var(--preto);
  transition: all .15s;
}
.rubric-body { min-width: 0; }
.rubric-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.rubric-label .nivel-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--off-white);
  color: var(--cinza-escuro);
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}
.rubric-option:has(input:checked) .rubric-label .nivel-tag { background: var(--verde-brq); color: var(--branco); }
.rubric-text { font-size: 13px; color: var(--cinza-escuro); line-height: 1.55; }
.rubric-option:has(input:checked) .rubric-text { color: var(--verde-escuro); }

/* Breakdown por tipo dentro do nível */
.rubric-breakdown {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rubric-breakdown-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  padding-top: 6px;
  border-top: 1px dashed var(--cinza-suave);
}
.rubric-breakdown-item:first-child { border-top: none; padding-top: 0; }
.rubric-breakdown-tipo {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cinza-medio);
  padding-top: 2px;
}
.rubric-option:has(input:checked) .rubric-breakdown-tipo { color: var(--verde-escuro); }
.rubric-breakdown-desc { color: var(--cinza-escuro); }
.rubric-option:has(input:checked) .rubric-breakdown-desc { color: var(--verde-escuro); }

/* Justificativa opcional */
.dim-justify {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px dashed var(--cinza-suave);
}
.dim-justify label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cinza-medio);
  margin-bottom: 8px;
}
.dim-justify textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--cinza-suave);
  background: var(--branco);
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: 4px;
  color: var(--preto);
  min-height: 70px;
  resize: vertical;
  transition: border-color .15s;
}
.dim-justify textarea:focus { outline: none; border-color: var(--verde-brq); }

/* ===== Success — BRQ style ===== */
.success-panel {
  display: none;
  background: var(--preto);
  color: var(--branco);
  border-radius: 6px;
  padding: var(--space-2xl) var(--space-xl);
  margin-top: var(--space-md);
  position: relative;
  overflow: hidden;
}
.success-panel.show { display: block; animation: fadeInStep .4s ease; }
.success-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 100%;
  background: var(--verde-brq);
}
.success-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--verde-claro);
  margin-bottom: var(--space-md);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.success-tag::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verde-brq);
  box-shadow: 0 0 0 4px rgba(29,166,105,0.25);
}
.success-panel h3 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin-bottom: var(--space-md);
  max-width: 680px;
}
.success-panel h3 em { color: var(--verde-brq); font-style: normal; }
.success-panel .success-lead {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--cinza-claro);
  max-width: 620px;
  margin-bottom: var(--space-xl);
}
.success-next-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cinza-medio);
  margin-bottom: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.12);
}
.success-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.success-step {
  border-top: 2px solid var(--verde-brq);
  padding-top: var(--space-sm);
}
.success-step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--verde-claro);
  margin-bottom: 6px;
}
.success-step-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.success-step-desc {
  font-size: 14px;
  color: var(--cinza-claro);
  line-height: 1.5;
}
.success-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.success-actions .btn-primary {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--verde-brq);
  color: var(--branco);
  padding: 16px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s, transform .15s;
}
.success-actions .btn-primary:hover { background: var(--verde-escuro); transform: translateY(-1px); }
.success-actions .btn-outline {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--branco);
  padding: 16px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.3);
  transition: border-color .15s, background .15s;
  cursor: pointer;
  background: transparent;
}
.success-actions .btn-outline:hover { border-color: var(--branco); background: rgba(255,255,255,0.05); }

/* ===== Responsive — formulário ===== */
@media (max-width: 1024px) {
  .form-area { padding: var(--space-lg) 0 calc(var(--space-xl) + 80px); }
  .form-step { padding: var(--space-lg); }
  .step-title { font-size: clamp(22px, 3vw, 28px); }
  .dim-block { padding: var(--space-md); }
  .dim-block h4 { font-size: 24px; }
  .rubric-option { padding: 12px 14px; }
  .rubric-num { width: 40px; height: 40px; font-size: 20px; }
  .scoring-intro { padding: var(--space-md); }
  .scoring-intro h4 { font-size: 20px; }
}

@media (max-width: 768px) {
  .hero-form { padding: var(--space-xl) 0 var(--space-md); }
  .hero-form h1 { font-size: clamp(32px, 8vw, 48px); max-width: 100%; }
  .hero-form p { font-size: 16px; }
  .form-area { padding: var(--space-md) 0 calc(var(--space-xl) + 110px); }
  .form-step { padding: var(--space-md); border-radius: 4px; }
  .step-title { font-size: 22px; }
  .step-help { font-size: 14px; }
  .field input[type="text"],
  .field input[type="email"],
  .field input[type="password"],
  .field input[type="url"],
  .field select,
  .field textarea { font-size: 16px; } /* evita zoom no iOS */
  .gates, .tipo-grid { grid-template-columns: 1fr; }
  .gate-option[style*="span 2"] { grid-column: auto !important; }
  .toggle-row { flex-direction: column; }
  .attachment-help ul { grid-template-columns: 1fr; }
  .attachment-item { grid-template-columns: 48px 1fr 32px; gap: 8px; padding: 10px; }
  .rubric-option { grid-template-columns: 40px 1fr; padding: 10px 12px; }
  .rubric-num { width: 40px; height: 40px; font-size: 18px; }
  .rubric-breakdown-item { grid-template-columns: 1fr; gap: 2px; }
  .rubric-breakdown-tipo { font-size: 10px; }
  .dim-block h4 { font-size: 22px; }
  .dim-block-head { padding-bottom: var(--space-sm); margin-bottom: var(--space-sm); }
  .scoring-intro h4 { font-size: 18px; }
  .scoring-intro p { font-size: 13px; }
  .success-timeline { grid-template-columns: 1fr; }
  .success-panel { padding: var(--space-xl) var(--space-md); }
  .success-panel h3 { font-size: clamp(28px, 7vw, 40px); }
  .success-panel::before { width: 4px; }
  .progress-steps { padding: 0 var(--space-md); }
  /* Step nav sticky: duas linhas no mobile */
  .step-nav .form-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .step-nav-counter { text-align: center; }
  .step-nav-actions { display: flex; gap: 8px; }
  .step-nav-actions .btn-nav { flex: 1; padding: 14px 10px; font-size: 12px; }
}

@media (max-width: 420px) {
  .btn-attach { font-size: 11px; padding: 9px 12px; }
}
