.modal-overlay{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(15,29,54,.44);
  opacity:0;
  transition:opacity .18s ease;
}

.modal-overlay.show{
  opacity:1;
}

.modal{
  width:min(100%,560px);
  max-height:calc(100vh - 48px);
  overflow:auto;
  border:1px solid rgba(15,29,54,.08);
  border-radius:24px;
  background:#fff;
  box-shadow:0 24px 60px rgba(15,29,54,.22);
  color:#0f1d36;
  transform:translateY(10px) scale(.98);
  opacity:0;
  transition:transform .18s ease, opacity .18s ease;
}

.modal.show{
  transform:translateY(0) scale(1);
  opacity:1;
}

.modal-head,
.modal-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:20px 24px;
}

.modal-head{
  border-bottom:1px solid rgba(15,29,54,.08);
}

.modal-foot{
  border-top:1px solid rgba(15,29,54,.08);
  justify-content:flex-end;
}

.modal-title{
  margin:0;
  display:flex;
  align-items:center;
  gap:10px;
  font-size:1.125rem;
  font-weight:800;
}

.modal-state{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:.75rem;
  font-weight:700;
  background:#eef3fb;
  color:#17458f;
}

.modal-state.success{
  background:#e7f8ef;
  color:#147a47;
}

.modal-state.error{
  background:#fdecec;
  color:#b42318;
}

.modal-state.loading{
  background:#eef3fb;
  color:#17458f;
}

.modal-body{
  padding:24px;
}

.modal-desc{
  margin:0;
  color:#44546f;
  line-height:1.6;
}

.modal-close{
  appearance:none;
  border:0;
  background:transparent;
  color:#5f718e;
  font-size:2rem;
  line-height:1;
  cursor:pointer;
}

.modal-btn{
  appearance:none;
  border:0;
  border-radius:14px;
  padding:12px 16px;
  font-weight:800;
  cursor:pointer;
}

.modal-btn.primary{
  background:#17458f;
  color:#fff;
}

.modal-btn.danger{
  background:#b42318;
  color:#fff;
}

.modal-btn.ghost{
  background:#eef3fb;
  color:#18325b;
}

.modal-spinner{
  width:32px;
  height:32px;
  display:inline-block;
  margin-bottom:14px;
  border:3px solid rgba(23,69,143,.18);
  border-top-color:#17458f;
  border-radius:50%;
  animation:modal-spin .8s linear infinite;
}

@keyframes modal-spin{
  to{
    transform:rotate(360deg);
  }
}
