/* =========================================================
   MODAL DE EDIÇÃO DE ETAPA
   ========================================================= */

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(8,4,20,.7);
  backdrop-filter:blur(8px);
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
}
.modal-backdrop.show{
  opacity:1;
  pointer-events:auto;
}

.modal{
  background:linear-gradient(180deg, #251a4d 0%, #1a1235 100%);
  border:1px solid var(--border-strong);
  border-radius:var(--radius-xl);
  max-width:760px;
  width:100%;
  max-height:calc(100vh - 48px);
  display:flex;
  flex-direction:column;
  box-shadow:
    0 32px 80px rgba(0,0,0,.6),
    0 0 0 1px rgba(117,239,255,.1),
    inset 0 1px 0 rgba(255,255,255,.06);
  transform:scale(.96) translateY(8px);
  transition:transform .3s cubic-bezier(.34,1.56,.64,1);
  overflow:hidden;
  position:relative;
}
.modal-backdrop.show .modal{transform:scale(1) translateY(0)}

.modal::before{
  content:'';
  position:absolute;
  top:0;left:0;right:0;
  height:1px;
  background:linear-gradient(90deg, transparent 10%, var(--cyan) 50%, transparent 90%);
  opacity:.6;
}

.modal-header{
  padding:20px 24px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-shrink:0;
  background:linear-gradient(180deg, rgba(117,239,255,.03), transparent);
}

.modal-header-left{display:flex;align-items:center;gap:12px;min-width:0}
.modal-header-badge{
  width:40px;height:40px;
  border-radius:var(--radius-sm);
  display:grid;place-items:center;
  flex-shrink:0;
  font-family:'JetBrains Mono',monospace;
  font-weight:700;
  font-size:13px;
}
.modal-header-badge.b-blue   {background:rgba(122,169,255,.15);color:var(--blue);   border:1px solid rgba(122,169,255,.3)}
.modal-header-badge.b-cyan   {background:var(--cyan-glow);     color:var(--cyan);   border:1px solid var(--border-strong)}
.modal-header-badge.b-purple {background:rgba(184,164,255,.15);color:var(--purple); border:1px solid rgba(184,164,255,.3)}
.modal-header-badge.b-green  {background:rgba(95,255,176,.15); color:var(--success);border:1px solid rgba(95,255,176,.3)}

.modal-header-text{min-width:0}
.modal-header-text .mh-eyebrow{
  font-size:10px;
  font-family:'JetBrains Mono',monospace;
  color:var(--cyan);
  letter-spacing:.12em;
  font-weight:600;
  text-transform:uppercase;
  margin-bottom:2px;
}
.modal-header-text .mh-title{
  font-size:17px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.modal-body{
  padding:24px;
  overflow-y:auto;
  flex:1;
}

.modal-footer{
  padding:16px 24px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-shrink:0;
  background:linear-gradient(0deg, rgba(0,0,0,.2), transparent);
}
.modal-footer-left{display:flex;gap:8px;align-items:center}
.modal-footer-right{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

.modal-shortcuts{
  font-size:11px;
  color:var(--muted-2);
  font-family:'JetBrains Mono',monospace;
  display:flex;
  align-items:center;
  gap:8px;
}
.modal-shortcuts kbd{
  background:rgba(255,255,255,.06);
  border:1px solid var(--border);
  border-bottom-width:2px;
  border-radius:4px;
  padding:1px 6px;
  font-family:inherit;
  font-size:10px;
  color:var(--cyan);
}

/* Section dentro do modal */
.modal-section{
  background:rgba(0,0,0,.2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-md);
  padding:16px;
  margin-bottom:14px;
}
.modal-section-title{
  font-size:11px;
  font-family:'JetBrains Mono',monospace;
  color:var(--muted);
  letter-spacing:.1em;
  text-transform:uppercase;
  font-weight:600;
  margin-bottom:12px;
  display:flex;
  align-items:center;
  gap:6px;
}
.modal-section-title svg{color:var(--cyan)}

/* Live preview no modal */
.live-preview{
  background:rgba(0,0,0,.4);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:14px 16px;
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
  color:#c5bbe0;
  line-height:1.7;
  white-space:pre-wrap;
  word-wrap:break-word;
  max-height:200px;
  overflow-y:auto;
}
.live-preview .ph-media{
  background:var(--cyan-glow);
  color:var(--cyan);
  padding:2px 6px;
  border-radius:3px;
  font-weight:600;
}

@media(max-width:640px){
  .modal-backdrop{padding:12px}
  .modal{max-height:calc(100vh - 24px)}
  .modal-header{padding:16px}
  .modal-body{padding:16px}
  .modal-footer{padding:14px 16px;flex-wrap:wrap}
  .modal-shortcuts{display:none}
}
